Skip to content
Permalink
Browse files
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:

Canonical link: https://commits.webkit.org/76801@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aestes committed May 25, 2011
1 parent d58d135 commit 5910b81027dd16eeeb4f17efff74f4852c2571f6
Showing with 58 additions and 0 deletions.
  1. +24 −0 Source/WebCore/ChangeLog
  2. +33 −0 Source/WebCore/html/HTMLObjectElement.cpp
  3. +1 −0 Source/WebCore/html/HTMLObjectElement.h
@@ -1,3 +1,27 @@
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:

2011-05-24 Nate Chapin <japhet@chromium.org>

Reviewed by Adam Barth.
@@ -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 @@ bool HTMLObjectElement::hasFallbackContent() const
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 @@ bool HTMLObjectElement::hasValidClassId()

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.
@@ -95,6 +95,7 @@ class HTMLObjectElement : public HTMLPlugInImageElement, public FormAssociatedEl
// 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(); }

0 comments on commit 5910b81

Please sign in to comment.