Skip to content
Permalink
Browse files
2010-10-27 Andy Estes <aestes@apple.com>
        Reviewed by Adam Barth.

        r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
        https://bugs.webkit.org/show_bug.cgi?id=45679

        This patch removes WebKit's map of classid values to MIME types. It also
        changes the behavior of object elements to render fallback content when
        a non-empty classid attribute is specified, which is the behavior HTML5
        specifies when a UA encounters a classid it doesn't understand.

        Test: fast/replaced/object-with-non-empty-classid-triggers-fallback.html

        * html/HTMLObjectElement.cpp: Remove serviceTypeForClassId(),
        createClassIdToTypeMap(), and the ClassIdToTypeMap typedef.
        (WebCore::HTMLObjectElement::updateWidget): Do not call
        serviceTypeForClassId() when there is no type attribute, and render
        fallback content if the classid attribute is non-empty.
2010-10-27  Andy Estes  <aestes@apple.com>

        Reviewed by Adam Barth.

        r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
        https://bugs.webkit.org/show_bug.cgi?id=45679

        * fast/dom/object-embed-plugin-scripting.html: Changed classid
        attributes to type attributes.
        * fast/dom/object-plugin-hides-properties.html: Ditto.
        * fast/replaced/object-with-non-empty-classid-triggers-fallback-expected.txt: Added.
        * fast/replaced/object-with-non-empty-classid-triggers-fallback.html: Added.


Canonical link: https://commits.webkit.org/61264@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aestes committed Oct 28, 2010
1 parent cec2112 commit 099c390ca3e8b4e9c1b2f53ed284aea42e6217a9
@@ -1,3 +1,16 @@
2010-10-27 Andy Estes <aestes@apple.com>

Reviewed by Adam Barth.

r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
https://bugs.webkit.org/show_bug.cgi?id=45679

* fast/dom/object-embed-plugin-scripting.html: Changed classid
attributes to type attributes.
* fast/dom/object-plugin-hides-properties.html: Ditto.
* fast/replaced/object-with-non-empty-classid-triggers-fallback-expected.txt: Added.
* fast/replaced/object-with-non-empty-classid-triggers-fallback.html: Added.

2010-10-27 Kinuko Yasuda <kinuko@chromium.org>

Unreviewed, updating drt_expectations.txt.
@@ -34,7 +34,7 @@

<OBJECT
id="myO"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
type="audio/mp4"
width = 0 height = 0
>
<PARAM name="src" value="resources/articles.m4a">
@@ -100,7 +100,7 @@

<object
name="Plugin"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
type="audio/mp4"
width = 0 height = 0
>
<param name="src" value="resources/articles.m4a">
@@ -19,6 +19,6 @@
If the test passes, you will see a "PASSED" message below.
</p>
<p id="result"></p>
<object id="obj" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!-- quicktime -->
<object id="obj" type="video/quicktime"><!-- quicktime -->
</object>
</body>
@@ -0,0 +1,4 @@
This tests that fallback content is rendered for objects with non-empty classid attributes. The test passes if two lines are printed below containing the work 'PASS'.

object with classid attribute but no type attribute renders fallback: PASS
object with classid and type attributes renders fallback: PASS
@@ -0,0 +1,13 @@
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<p>This tests that fallback content is rendered for objects with non-empty classid attributes. The test passes if two lines are printed below containing the work 'PASS'.</p>
<object id="obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
object with classid attribute but no type attribute renders fallback: PASS
</object>
<br>
<object id="obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type=application/x-webkit-test-netscape">
object with classid and type attributes renders fallback: PASS
</object>

@@ -1,3 +1,23 @@
2010-10-27 Andy Estes <aestes@apple.com>

Reviewed by Adam Barth.

r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
https://bugs.webkit.org/show_bug.cgi?id=45679

This patch removes WebKit's map of classid values to MIME types. It also
changes the behavior of object elements to render fallback content when
a non-empty classid attribute is specified, which is the behavior HTML5
specifies when a UA encounters a classid it doesn't understand.

Test: fast/replaced/object-with-non-empty-classid-triggers-fallback.html

* html/HTMLObjectElement.cpp: Remove serviceTypeForClassId(),
createClassIdToTypeMap(), and the ClassIdToTypeMap typedef.
(WebCore::HTMLObjectElement::updateWidget): Do not call
serviceTypeForClassId() when there is no type attribute, and render
fallback content if the classid attribute is non-empty.

2010-10-27 Eric Uhrhane <ericu@chromium.org>

Reviewed by David Levin.
@@ -116,31 +116,6 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
HTMLPlugInImageElement::parseMappedAttribute(attr);
}

typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;

static ClassIdToTypeMap* createClassIdToTypeMap()
{
ClassIdToTypeMap* map = new ClassIdToTypeMap;
map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
return map;
}

static String serviceTypeForClassId(const String& classId)
{
// Return early if classId is empty (since we won't do anything below).
// Furthermore, if classId is null, calling get() below will crash.
if (classId.isEmpty())
return String();

static ClassIdToTypeMap* map = createClassIdToTypeMap();
return map->get(classId);
}

static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
{
// Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP
@@ -255,14 +230,9 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
// FIXME: This should ASSERT isFinishedParsingChildren() instead.
if (!isFinishedParsingChildren())
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 url = this->url();
String serviceType = this->serviceType();
if (serviceType.isEmpty())
serviceType = serviceTypeForClassId(classId());

// FIXME: These should be joined into a PluginParameters class.
Vector<String> paramNames;
@@ -291,8 +261,12 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
if (!renderer())
return;

// HTML5 says that fallback content should be rendered if a non-empty
// classid is specified for which the UA can't find a suitable plug-in.
bool hasEmptyClassId = classId().isEmpty();

SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
bool success = beforeLoadAllowedLoad && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
bool success = beforeLoadAllowedLoad && hasEmptyClassId && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);

if (!success && fallbackContent)
renderFallbackContent();

0 comments on commit 099c390

Please sign in to comment.