Title: [87244] trunk/Source/WebCore
Revision
87244
Author
[email protected]
Date
2011-05-24 17:48:00 -0700 (Tue, 24 May 2011)

Log Message

2011-05-24  Andy Estes  <[email protected]>

        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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87243 => 87244)


--- trunk/Source/WebCore/ChangeLog	2011-05-25 00:33:00 UTC (rev 87243)
+++ trunk/Source/WebCore/ChangeLog	2011-05-25 00:48:00 UTC (rev 87244)
@@ -1,3 +1,27 @@
+2011-05-24  Andy Estes  <[email protected]>
+
+        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:
+
 2011-05-24  Nate Chapin  <[email protected]>
 
         Reviewed by Adam Barth.

Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (87243 => 87244)


--- trunk/Source/WebCore/html/HTMLObjectElement.cpp	2011-05-25 00:33:00 UTC (rev 87243)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp	2011-05-25 00:48:00 UTC (rev 87244)
@@ -32,14 +32,18 @@
 #include "HTMLDocument.h"
 #include "HTMLFormElement.h"
 #include "HTMLImageLoader.h"
+#include "HTMLMetaElement.h"
 #include "HTMLNames.h"
 #include "HTMLParamElement.h"
 #include "HTMLParserIdioms.h"
 #include "MIMETypeRegistry.h"
+#include "NodeList.h"
+#include "Page.h"
 #include "RenderEmbeddedObject.h"
 #include "RenderImage.h"
 #include "RenderWidget.h"
 #include "ScriptEventListener.h"
+#include "Settings.h"
 #include "Text.h"
 
 namespace WebCore {
@@ -235,6 +239,32 @@
     return false;
 }
     
+bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk()
+{
+    // 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.
+    if (!document()->page()
+        || !document()->page()->settings()->needsSiteSpecificQuirks()
+        || hasFallbackContent()
+        || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
+        return false;
+
+    RefPtr<NodeList> metaElements = document()->getElementsByTagName(HTMLNames::metaTag.localName());
+    unsigned length = metaElements->length();
+    for (unsigned i = 0; i < length; ++i) {
+        ASSERT(metaElements->item(i)->isHTMLElement());
+        HTMLMetaElement* metaElement = static_cast<HTMLMetaElement*>(metaElements->item(i));
+        if (equalIgnoringCase(metaElement->name(), "generator") && metaElement->content().startsWith("Mac OS X Server Web Services Server", false))
+            return true;
+    }
+    
+    return false;
+}
+    
 bool HTMLObjectElement::hasValidClassId()
 {
 #if PLATFORM(QT)
@@ -244,6 +274,9 @@
 
     if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false))
         return true;
+    
+    if (shouldAllowQuickTimeClassIdQuirk())
+        return true;
 
     // 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.

Modified: trunk/Source/WebCore/html/HTMLObjectElement.h (87243 => 87244)


--- trunk/Source/WebCore/html/HTMLObjectElement.h	2011-05-25 00:33:00 UTC (rev 87243)
+++ trunk/Source/WebCore/html/HTMLObjectElement.h	2011-05-25 00:48:00 UTC (rev 87244)
@@ -95,6 +95,7 @@
     // so that we can better share code between <object> and <embed>.
     void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
     
+    bool shouldAllowQuickTimeClassIdQuirk();
     bool hasValidClassId();
 
     virtual void refFormAssociatedElement() { ref(); }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to