Changeset 70748 in webkit


Ignore:
Timestamp:
Oct 27, 2010 11:15:09 PM (14 years ago)
Author:
aestes@apple.com
Message:

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.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70746 r70748  
     12010-10-27  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
     6        https://bugs.webkit.org/show_bug.cgi?id=45679
     7
     8        * fast/dom/object-embed-plugin-scripting.html: Changed classid
     9        attributes to type attributes.
     10        * fast/dom/object-plugin-hides-properties.html: Ditto.
     11        * fast/replaced/object-with-non-empty-classid-triggers-fallback-expected.txt: Added.
     12        * fast/replaced/object-with-non-empty-classid-triggers-fallback.html: Added.
     13
    1142010-10-27  Kinuko Yasuda  <kinuko@chromium.org>
    215
  • trunk/LayoutTests/fast/dom/object-embed-plugin-scripting.html

    r66156 r70748  
    3535<OBJECT
    3636    id="myO"
    37     classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
     37    type="audio/mp4"
    3838    width = 0 height = 0
    3939    >
     
    101101<object
    102102    name="Plugin"
    103     classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
     103    type="audio/mp4"
    104104    width = 0 height = 0
    105105    >
  • trunk/LayoutTests/fast/dom/object-plugin-hides-properties.html

    r11995 r70748  
    2020</p>
    2121<p id="result"></p>
    22 <object id="obj" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!-- quicktime -->
     22<object id="obj" type="video/quicktime"><!-- quicktime -->
    2323</object>
    2424</body>
  • trunk/WebCore/ChangeLog

    r70745 r70748  
     12010-10-27  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
     6        https://bugs.webkit.org/show_bug.cgi?id=45679
     7
     8        This patch removes WebKit's map of classid values to MIME types. It also
     9        changes the behavior of object elements to render fallback content when
     10        a non-empty classid attribute is specified, which is the behavior HTML5
     11        specifies when a UA encounters a classid it doesn't understand.
     12
     13        Test: fast/replaced/object-with-non-empty-classid-triggers-fallback.html
     14
     15        * html/HTMLObjectElement.cpp: Remove serviceTypeForClassId(),
     16        createClassIdToTypeMap(), and the ClassIdToTypeMap typedef.
     17        (WebCore::HTMLObjectElement::updateWidget): Do not call
     18        serviceTypeForClassId() when there is no type attribute, and render
     19        fallback content if the classid attribute is non-empty.
     20
    1212010-10-27  Eric Uhrhane  <ericu@chromium.org>
    222
  • trunk/WebCore/html/HTMLObjectElement.cpp

    r69596 r70748  
    117117}
    118118
    119 typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;
    120 
    121 static ClassIdToTypeMap* createClassIdToTypeMap()
    122 {
    123     ClassIdToTypeMap* map = new ClassIdToTypeMap;
    124     map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
    125     map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
    126     map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
    127     map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
    128     map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
    129     map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
    130     return map;
    131 }
    132 
    133 static String serviceTypeForClassId(const String& classId)
    134 {
    135     // Return early if classId is empty (since we won't do anything below).
    136     // Furthermore, if classId is null, calling get() below will crash.
    137     if (classId.isEmpty())
    138         return String();
    139    
    140     static ClassIdToTypeMap* map = createClassIdToTypeMap();
    141     return map->get(classId);
    142 }
    143 
    144119static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
    145120{
     
    256231    if (!isFinishedParsingChildren())
    257232        return;
    258 
     233   
    259234    String url = this->url();
    260    
    261     // If the object does not specify a MIME type via a type attribute, but does
    262     // contain a classid attribute, try to map the classid to a MIME type.
    263235    String serviceType = this->serviceType();
    264     if (serviceType.isEmpty())
    265         serviceType = serviceTypeForClassId(classId());
    266236
    267237    // FIXME: These should be joined into a PluginParameters class.
     
    292262        return;
    293263
     264    // HTML5 says that fallback content should be rendered if a non-empty
     265    // classid is specified for which the UA can't find a suitable plug-in.
     266    bool hasEmptyClassId = classId().isEmpty();
     267
    294268    SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
    295     bool success = beforeLoadAllowedLoad && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
     269    bool success = beforeLoadAllowedLoad && hasEmptyClassId && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
    296270
    297271    if (!success && fallbackContent)
Note: See TracChangeset for help on using the changeset viewer.