Changeset 87244 in webkit


Ignore:
Timestamp:
May 24, 2011 5:48:00 PM (13 years ago)
Author:
aestes@apple.com
Message:

2011-05-24 Andy Estes <aestes@apple.com>

Reviewed by Geoffrey Garen.

REGRESSION (r70748): WebKit cannot play QuickTime movies on Mac OS X Wiki Server pages
https://bugs.webkit.org/show_bug.cgi?id=61229

This site-specific hack maintains compatibility with Mac OS X Wiki Server,
which embeds QuickTime movies using an object tag containing QuickTime's
ActiveX classid. Treat this classid as valid only if OS X Server's unique
'generator' meta tag is present. Only apply this quirk if there is no
fallback content, which ensures the quirk will disable itself if Wiki
Server is updated to generate an alternate embed tag as fallback content.

  • html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Return true if site-specific quirks are enabled, the object element has no fallback content, the classid attribute matches QuickTime's classid and the document has a 'generator' meta tag matching Mac OS X Web Services Server's unique generator string. (WebCore::HTMLObjectElement::hasValidClassId): Call shouldAllowQuickTimeClassIdQuirk()
  • html/HTMLObjectElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87239 r87244  
     12011-05-24  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        REGRESSION (r70748): WebKit cannot play QuickTime movies on Mac OS X Wiki Server pages
     6        https://bugs.webkit.org/show_bug.cgi?id=61229
     7
     8        This site-specific hack maintains compatibility with Mac OS X Wiki Server,
     9        which embeds QuickTime movies using an object tag containing QuickTime's
     10        ActiveX classid. Treat this classid as valid only if OS X Server's unique
     11        'generator' meta tag is present. Only apply this quirk if there is no
     12        fallback content, which ensures the quirk will disable itself if Wiki
     13        Server is updated to generate an alternate embed tag as fallback content.
     14
     15        * html/HTMLObjectElement.cpp:
     16        (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Return
     17        true if site-specific quirks are enabled, the object element has no
     18        fallback content, the classid attribute matches QuickTime's classid and
     19        the document has a 'generator' meta tag matching Mac OS X Web Services
     20        Server's unique generator string.
     21        (WebCore::HTMLObjectElement::hasValidClassId): Call
     22        shouldAllowQuickTimeClassIdQuirk()
     23        * html/HTMLObjectElement.h:
     24
    1252011-05-24  Nate Chapin  <japhet@chromium.org>
    226
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r87125 r87244  
    3333#include "HTMLFormElement.h"
    3434#include "HTMLImageLoader.h"
     35#include "HTMLMetaElement.h"
    3536#include "HTMLNames.h"
    3637#include "HTMLParamElement.h"
    3738#include "HTMLParserIdioms.h"
    3839#include "MIMETypeRegistry.h"
     40#include "NodeList.h"
     41#include "Page.h"
    3942#include "RenderEmbeddedObject.h"
    4043#include "RenderImage.h"
    4144#include "RenderWidget.h"
    4245#include "ScriptEventListener.h"
     46#include "Settings.h"
    4347#include "Text.h"
    4448
     
    236240}
    237241   
     242bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk()
     243{
     244    // This site-specific hack maintains compatibility with Mac OS X Wiki Server,
     245    // which embeds QuickTime movies using an object tag containing QuickTime's
     246    // ActiveX classid. Treat this classid as valid only if OS X Server's unique
     247    // 'generator' meta tag is present. Only apply this quirk if there is no
     248    // fallback content, which ensures the quirk will disable itself if Wiki
     249    // Server is updated to generate an alternate embed tag as fallback content.
     250    if (!document()->page()
     251        || !document()->page()->settings()->needsSiteSpecificQuirks()
     252        || hasFallbackContent()
     253        || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
     254        return false;
     255
     256    RefPtr<NodeList> metaElements = document()->getElementsByTagName(HTMLNames::metaTag.localName());
     257    unsigned length = metaElements->length();
     258    for (unsigned i = 0; i < length; ++i) {
     259        ASSERT(metaElements->item(i)->isHTMLElement());
     260        HTMLMetaElement* metaElement = static_cast<HTMLMetaElement*>(metaElements->item(i));
     261        if (equalIgnoringCase(metaElement->name(), "generator") && metaElement->content().startsWith("Mac OS X Server Web Services Server", false))
     262            return true;
     263    }
     264   
     265    return false;
     266}
     267   
    238268bool HTMLObjectElement::hasValidClassId()
    239269{
     
    244274
    245275    if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false))
     276        return true;
     277   
     278    if (shouldAllowQuickTimeClassIdQuirk())
    246279        return true;
    247280
  • trunk/Source/WebCore/html/HTMLObjectElement.h

    r87125 r87244  
    9696    void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
    9797   
     98    bool shouldAllowQuickTimeClassIdQuirk();
    9899    bool hasValidClassId();
    99100
Note: See TracChangeset for help on using the changeset viewer.