[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aestes at apple.com
aestes at apple.com
Wed Dec 22 13:11:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7925a4e122fd501adcdbf3f0f503b5ee87f22864
Author: aestes at apple.com <aestes at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 8 17:08:14 2010 +0000
2010-09-08 Andy Estes <aestes at apple.com>
Reviewed by Eric Carlson.
Fallback content should be rendered when an <object> doesn't specify a
data, type or classid attribute.
https://bugs.webkit.org/show_bug.cgi?id=45364
<rdar://problem/8375816>
HTML5 says that if no data or type attribute is specified on an <object>,
fallback content should be rendered. However, WebKit has traditionally
supported specifying a URL and MIME type in <param> elements.
To more closely match the spec while maintaining compatibility with
content that relied on our old behavior, we will continue to load
a resource specified by <param> elements if we can determine a priori
that it will be handled by a plug-in.
If we can't make this determination, and the <object> element has no
"data" or "type" attribute, the <param> elements will be ignored and
fallback content will be rendered. Otherwise, there is no change in
behavior.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin): If an empty url is
passed to this function and a <param> exists that specifies a url that
references a plug-in resource, set it to url, making it the url that
will be loaded by the <object> element.
(WebCore::HTMLObjectElement::updateWidget): If no type attribute was
specified, but there is a classid attribute, try to map the classid to
a MIME type. This needs to be done before calling
HTMLObjectElement::parametersForPlugin().
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::resourceWillUsePlugin): Make a public method
that determines if a resource will load a plug-in based on its url and
MIME type. This is equivalent to calling
SubframeLoader::shouldUsePlugin(), but does not burden the caller with
the details of fallback content.
* loader/SubframeLoader.h:
2010-09-08 Andy Estes <aestes at apple.com>
Reviewed by Eric Carlson.
Fallback content should be rendered when an <object> doesn't specify a
data, type or classid attribute.
https://bugs.webkit.org/show_bug.cgi?id=45364
<rdar://problem/8375816>
* 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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index bbfbbe0..f391d31 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-08 Andy Estes <aestes at apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Fallback content should be rendered when an <object> doesn't specify a
+ data, type or classid attribute.
+ https://bugs.webkit.org/show_bug.cgi?id=45364
+ <rdar://problem/8375816>
+
+ * 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-08 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
diff --git a/LayoutTests/fast/replaced/object-param-url-control-char.html b/LayoutTests/fast/replaced/object-param-url-control-char.html
index 95590f4..9fb4b40 100644
--- a/LayoutTests/fast/replaced/object-param-url-control-char.html
+++ b/LayoutTests/fast/replaced/object-param-url-control-char.html
@@ -21,7 +21,7 @@
</script>
</head>
<body>
- <object width="0" height="0">
+ <object width="0" height="0" type="application/x-webkit-test-netscape">
<param name="movie" value="
uRl('scheme://url-with-control-char/')
">
</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>
diff --git a/LayoutTests/fast/replaced/object-with-embed-url-param-expected.txt b/LayoutTests/fast/replaced/object-with-embed-url-param-expected.txt
index d280a75..5c011dc 100644
--- a/LayoutTests/fast/replaced/object-with-embed-url-param-expected.txt
+++ b/LayoutTests/fast/replaced/object-with-embed-url-param-expected.txt
@@ -1,7 +1,8 @@
-
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.
+
diff --git a/LayoutTests/fast/replaced/object-with-embed-url-param.html b/LayoutTests/fast/replaced/object-with-embed-url-param.html
index ec34270..96c1de8 100644
--- a/LayoutTests/fast/replaced/object-with-embed-url-param.html
+++ b/LayoutTests/fast/replaced/object-with-embed-url-param.html
@@ -9,9 +9,11 @@
var object1Result = "";
var object2Result = "";
var embed3Result = "";
+ var embed4Result = "";
+ var object5Result = "";
+ var notified = false;
document.addEventListener("beforeload", function(event) {
-
if (event.url == "")
return;
@@ -21,12 +23,19 @@
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();
}
@@ -38,18 +47,26 @@
</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>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c34e146..c1554e1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2010-09-08 Andy Estes <aestes at apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Fallback content should be rendered when an <object> doesn't specify a
+ data, type or classid attribute.
+ https://bugs.webkit.org/show_bug.cgi?id=45364
+ <rdar://problem/8375816>
+
+ HTML5 says that if no data or type attribute is specified on an <object>,
+ fallback content should be rendered. However, WebKit has traditionally
+ supported specifying a URL and MIME type in <param> elements.
+
+ To more closely match the spec while maintaining compatibility with
+ content that relied on our old behavior, we will continue to load
+ a resource specified by <param> elements if we can determine a priori
+ that it will be handled by a plug-in.
+
+ If we can't make this determination, and the <object> element has no
+ "data" or "type" attribute, the <param> elements will be ignored and
+ fallback content will be rendered. Otherwise, there is no change in
+ behavior.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parametersForPlugin): If an empty url is
+ passed to this function and a <param> exists that specifies a url that
+ references a plug-in resource, set it to url, making it the url that
+ will be loaded by the <object> element.
+ (WebCore::HTMLObjectElement::updateWidget): If no type attribute was
+ specified, but there is a classid attribute, try to map the classid to
+ a MIME type. This needs to be done before calling
+ HTMLObjectElement::parametersForPlugin().
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::resourceWillUsePlugin): Make a public method
+ that determines if a resource will load a plug-in based on its url and
+ MIME type. This is equivalent to calling
+ SubframeLoader::shouldUsePlugin(), but does not burden the caller with
+ the details of fallback content.
+ * loader/SubframeLoader.h:
+
2010-09-08 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 56a6095..51eb232 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -163,6 +163,7 @@ static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramV
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 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S
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 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S
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() && !urlParam.isEmpty()) {
+ SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
+ if (loader->resourceWillUsePlugin(urlParam, serviceType))
+ url = urlParam;
+ }
}
@@ -250,7 +257,12 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
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;
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index c25b37e..d364e88 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -87,6 +87,15 @@ bool SubframeLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const Str
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)
diff --git a/WebCore/loader/SubframeLoader.h b/WebCore/loader/SubframeLoader.h
index 6c3baf8..a6626cb 100644
--- a/WebCore/loader/SubframeLoader.h
+++ b/WebCore/loader/SubframeLoader.h
@@ -75,6 +75,8 @@ public:
bool allowPlugins(ReasonForCallingAllowPlugins);
bool containsPlugins() const { return m_containsPlugins; }
+
+ bool resourceWillUsePlugin(const String&, const String&);
private:
Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const KURL&, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list