Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2578)

Unified Diff: WebCore/html/HTMLObjectElement.cpp

Issue 3551010: Merge 66992 - 2010-09-08 Andy Estes <aestes@apple.com>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/loader/SubframeLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/HTMLObjectElement.cpp
===================================================================
--- WebCore/html/HTMLObjectElement.cpp (revision 68934)
+++ WebCore/html/HTMLObjectElement.cpp (working copy)
@@ -163,6 +163,7 @@
void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType)
{
HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
+ String urlParam;
// Scan the PARAM children and store their name/value pairs.
// Get the URL and type from the params if we don't already have them.
@@ -180,8 +181,8 @@
paramValues.append(p->value());
// FIXME: url adjustment does not belong in this function.
- if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
- url = deprecatedParseURL(p->value());
+ if (url.isEmpty() && urlParam.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
+ urlParam = deprecatedParseURL(p->value());
// FIXME: serviceType calculation does not belong in this function.
if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
serviceType = p->value();
@@ -217,9 +218,15 @@
mapDataParamToSrc(&paramNames, &paramValues);
- // If we still don't have a type, try to map from a specific CLASSID to a type.
- if (serviceType.isEmpty())
- serviceType = serviceTypeForClassId(classId());
+ // HTML5 says that an object resource's URL is specified by the object's data
+ // attribute, not by a param element. However, for compatibility, allow the
+ // resource's URL to be given by a param named "src", "movie", "code" or "url"
+ // if we know that resource points to a plug-in.
+ if (url.isEmpty() && !urlParam.isEmpty()) {
+ SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
+ if (loader->resourceWillUsePlugin(urlParam, serviceType))
+ url = urlParam;
+ }
}
@@ -250,7 +257,12 @@
return;
String url = this->url();
+
+ // If the object does not specify a MIME type via a type attribute, but does
+ // contain a classid attribute, try to map the classid to a MIME type.
String serviceType = this->serviceType();
+ if (serviceType.isEmpty())
+ serviceType = serviceTypeForClassId(classId());
// FIXME: These should be joined into a PluginParameters class.
Vector<String> paramNames;
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/loader/SubframeLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698