From kde-commits Mon Jul 03 20:24:32 2006 From: Koos Vriezen Date: Mon, 03 Jul 2006 20:24:32 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/khtml/rendering Message-Id: <1151958272.319822.9815.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115195829007292 SVN commit 557699 by vriezen: Restore that object elements should have an URL, but like http://www.w3.org/TR/html4/struct/objects.html suggests, if there is a CLASSID attr. and we found a servicetype, allow than an empty URL. (w/o the servicetype check, Germain found this error case data:text/html,alternative is rendered where service type becomes text/html in the KHTMLPart object loading) M +12 -7 render_frames.cpp --- branches/KDE/3.5/kdelibs/khtml/rendering/render_frames.cpp #557698:557699 @@ -757,6 +757,7 @@ params.append( QString::fromLatin1("__KHTML__PLUGINBASEURL=\"%1\"").arg(element()->getDocument()->baseURL().url())); HTMLEmbedElementImpl *embed = 0; + QString classId; QString serviceType = objbase->serviceType; if ( element()->id() == ID_EMBED ) { @@ -771,8 +772,9 @@ embed = static_cast( child ); break; } + classId = objbase->classId; - params.append( QString::fromLatin1("__KHTML__CLASSID=\"%1\"").arg( objbase->classId ) ); + params.append( QString::fromLatin1("__KHTML__CLASSID=\"%1\"").arg( classId ) ); params.append( QString::fromLatin1("__KHTML__CODEBASE=\"%1\"").arg( objbase->getAttribute(ATTR_CODEBASE).string() ) ); if (!objbase->getAttribute(ATTR_WIDTH).isEmpty()) params.append( QString::fromLatin1("WIDTH=\"%1\"").arg( objbase->getAttribute(ATTR_WIDTH).string() ) ); @@ -805,7 +807,7 @@ serviceType = "application/x-activex-handler"; #endif - if(objbase->classId.find(QString::fromLatin1("D27CDB6E-AE6D-11cf-96B8-444553540000")) >= 0) { + if(classId.find(QString::fromLatin1("D27CDB6E-AE6D-11cf-96B8-444553540000")) >= 0) { // It is ActiveX, but the nsplugin system handling // should also work, that's why we don't override the // serviceType with application/x-activex-handler @@ -814,17 +816,17 @@ // with nspluginviewer (Niko) serviceType = "application/x-shockwave-flash"; } - else if(objbase->classId.find(QString::fromLatin1("CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")) >= 0) + else if(classId.find(QString::fromLatin1("CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")) >= 0) serviceType = "audio/x-pn-realaudio-plugin"; - else if(objbase->classId.find(QString::fromLatin1("8AD9C840-044E-11D1-B3E9-00805F499D93")) >= 0 || + else if(classId.find(QString::fromLatin1("8AD9C840-044E-11D1-B3E9-00805F499D93")) >= 0 || objbase->classId.find(QString::fromLatin1("CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA")) >= 0) serviceType = "application/x-java-applet"; // http://www.apple.com/quicktime/tools_tips/tutorials/activex.html - else if(objbase->classId.find(QString::fromLatin1("02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) >= 0) + else if(classId.find(QString::fromLatin1("02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) >= 0) serviceType = "video/quicktime"; // http://msdn.microsoft.com/library/en-us/dnwmt/html/adding_windows_media_to_web_pages__etse.asp?frame=true else if(objbase->classId.find(QString::fromLatin1("6BF52A52-394A-11d3-B153-00C04F79FAA6")) >= 0 || - objbase->classId.find(QString::fromLatin1("22D6f312-B0F6-11D0-94AB-0080C74C7E95")) >= 0) + classId.find(QString::fromLatin1("22D6f312-B0F6-11D0-94AB-0080C74C7E95")) >= 0) serviceType = "video/x-msvideo"; else @@ -833,7 +835,10 @@ // TODO: add more plugins here } } - if (!document()->isURLAllowed(url) || !part->requestObject( this, url, serviceType, params )) + if ((url.isEmpty() && !embed && + (serviceType.isEmpty() || classId.isEmpty())) || + !document()->isURLAllowed(url) || + !part->requestObject( this, url, serviceType, params )) objbase->renderAlternative(); } }