Unreviewed, rolling out r67178.
http://trac.webkit.org/changeset/67178
https://bugs.webkit.org/show_bug.cgi?id=45524
re-roll-out patch to put original changes back in
* fast/replaced/object-param-url-control-char.html:
* fast/replaced/object-with-embed-url-param-expected.txt:
* fast/replaced/object-with-embed-url-param.html:
2010-09-10 Dirk Pranke <dpranke@chromium.org>
Unreviewed, rolling out r67178.
http://trac.webkit.org/changeset/67178
https://bugs.webkit.org/show_bug.cgi?id=45524
re-roll-out patch to put original changes back in
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
(WebCore::HTMLObjectElement::updateWidget):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::resourceWillUsePlugin):
* loader/SubframeLoader.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67179
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-09-10 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, rolling out r67178.
+ http://trac.webkit.org/changeset/67178
+ https://bugs.webkit.org/show_bug.cgi?id=45524
+
+ re-roll-out patch to put original changes back in
+
+ * fast/replaced/object-param-url-control-char.html:
+ * fast/replaced/object-with-embed-url-param-expected.txt:
+ * fast/replaced/object-with-embed-url-param.html:
+
2010-09-10 Dirk Pranke <dpranke@chromium.org>
Reviewed by Kent Tamura.
</script>
</head>
<body>
- <object width="0" height="0">
+ <object width="0" height="0" type="application/x-webkit-test-netscape">
<param name="movie" value=" \1c uRl('scheme://url-with-\ 5control-char/') \1e ">
</object>
<p>This test verifies that a URL specified in a <param> of an <object> is parsed the same as if it was specified as the data attribute of the <object>. Specifically, this verifies that control characters and leading/trailing whitespace are stripped, and that a resource surrounded with url('') is understood.</p>
-
This test verifies that the right URL is loaded when there is an <object> with a 'src' <param> and a fallback <embed>.
An <object> with a 'data' @attr and a 'src' <param> should load the URL from the 'data' @attr and does.
An <object> with a 'src' <param> should load the URL from the 'src' <param> and does.
An <object> with no URL specified and a nested <embed> should load the URL from the 'src' @attr of the <embed> and does.
-
+An <object> with a URL specified in a 'src' <param> and a nested <embed> should load the URL from the 'src' @attr of the <embed> and does.
+An <object> with a URL specified in a 'src' <param> and a MIME type specified in a 'type' <param> should load the URL from the 'src' <param> and does.
+
var object1Result = "";
var object2Result = "";
var embed3Result = "";
+ var embed4Result = "";
+ var object5Result = "";
+ var notified = false;
document.addEventListener("beforeload", function(event) {
-
if (event.url == "")
return;
object2Result = (event.url == "object-param" ? "does" : "does not");
} else if (event.target.id == "embed3") {
embed3Result = (event.url == "embed-attr" ? "does" : "does not");
+ } else if (event.target.id == "embed4") {
+ embed4Result = (event.url == "embed-attr" ? "does" : "does not");
+ } else if (event.target.id == "object5") {
+ object5Result = (event.url == "object-param" ? "does" : "does not");
}
- if (object1Result != "" && object2Result != "" && embed3Result != "") {
+ if (!notified && object1Result != "" && object2Result != "" && embed3Result != "" && embed4Result != "" && object5Result != "") {
debug("An <object> with a 'data' @attr and a 'src' <param> should load the URL from the 'data' @attr and " + object1Result + ".");
debug("An <object> with a 'src' <param> should load the URL from the 'src' <param> and " + object2Result + ".");
debug("An <object> with no URL specified and a nested <embed> should load the URL from the 'src' @attr of the <embed> and " + embed3Result + ".");
+ debug("An <object> with a URL specified in a 'src' <param> and a nested <embed> should load the URL from the 'src' @attr of the <embed> and " + embed3Result + ".");
+ debug("An <object> with a URL specified in a 'src' <param> and a MIME type specified in a 'type' <param> should load the URL from the 'src' <param> and " + object5Result + ".");
+ notified = true;
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
<body>
+ <p>This test verifies that the right URL is loaded when there is an <object> with a 'src' <param> and a fallback <embed>.</p>
+ <div id="console"></div>
<object id="object1" type="application/x-webkit-test-netscape" data="object-attr">
- <param id="param1" name="src" value="object-param"></param>
+ <param name="src" value="object-param"></param>
<embed id="embed1" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object2" type="application/x-webkit-test-netscape">
- <param id="param2" name="movie" value="object-param"></param>
+ <param name="movie" value="object-param"></param>
<embed id="embed2" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
<object id="object3">
<embed id="embed3" type="application/x-webkit-test-netscape" src="embed-attr">
</object>
- <p>This test verifies that the right URL is loaded when there is an <object> with a 'src' <param> and a fallback <embed>.</p>
- <div id="console"></div>
+ <object id="object4">
+ <param name="code" value="object-param"></param>
+ <embed id="embed4" type="application/x-webkit-test-netscape" src="embed-attr">
+ </object>
+ <object id="object5">
+ <param name="url" value="object-param"></param>
+ <param name="type" value="application/x-webkit-test-netscape"></param>
+ </object>
</body>
</html>
+2010-09-10 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, rolling out r67178.
+ http://trac.webkit.org/changeset/67178
+ https://bugs.webkit.org/show_bug.cgi?id=45524
+
+ re-roll-out patch to put original changes back in
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parametersForPlugin):
+ (WebCore::HTMLObjectElement::updateWidget):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::resourceWillUsePlugin):
+ * loader/SubframeLoader.h:
+
2010-09-10 Dirk Pranke <dpranke@chromium.org>
Reviewed by Kent Tamura.
void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType)
{
HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
+ String urlParameter;
// 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.
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() && urlParameter.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
+ urlParameter = deprecatedParseURL(p->value());
// FIXME: serviceType calculation does not belong in this function.
if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
serviceType = p->value();
mapDataParamToSrc(¶mNames, ¶mValues);
- // 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() && !urlParameter.isEmpty()) {
+ SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
+ if (loader->resourceWillUsePlugin(urlParameter, serviceType))
+ url = urlParameter;
+ }
}
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;
return true;
}
+
+bool SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType)
+{
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = completeURL(url);
+ bool useFallback;
+ return shouldUsePlugin(completedURL, mimeType, false, useFallback);
+}
bool SubframeLoader::requestObject(HTMLPlugInImageElement* ownerElement, const String& url, const AtomicString& frameName,
const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
bool allowPlugins(ReasonForCallingAllowPlugins);
bool containsPlugins() const { return m_containsPlugins; }
+
+ bool resourceWillUsePlugin(const String& url, const String& mimeType);
private:
Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const KURL&, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList);