diff options
author | Michael BrĂ¼ning <michael.bruning@digia.com> | 2014-06-18 14:40:09 +0200 |
---|---|---|
committer | Michael Bruning <michael.bruning@digia.com> | 2014-06-30 17:40:35 +0200 |
commit | be96f33d7d8355c0d388a8577d4a4ea2a4d5f5a9 (patch) | |
tree | 3392b865656dd7f229955e548e62d3ff83e1bf59 /Source/WebCore/html | |
parent | 24b78f24e88087dfc27e45df85df07a5253fd5ac (diff) |
Prevent interpreting URL parameter for Qt plugins as content URLs.
This prevents a compatibility workaround for NPAPI plugins from
interfering with the Qt plugins.
Task-number: QTBUG-39483
Change-Id: Ic9342d3bdeec4c26c21f56b475d3d3751b30f057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r-- | Source/WebCore/html/HTMLObjectElement.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp index 95c7953cc..272394001 100644 --- a/Source/WebCore/html/HTMLObjectElement.cpp +++ b/Source/WebCore/html/HTMLObjectElement.cpp @@ -81,6 +81,11 @@ RenderWidget* HTMLObjectElement::renderWidgetForJSBindings() const return renderPart(); // This will return 0 if the renderer is not a RenderPart. } +static bool isQtPluginServiceType(const String& serviceType) +{ + return equalIgnoringCase(serviceType, "application/x-qt-plugin") || equalIgnoringCase(serviceType, "application/x-qt-styled-widget"); +} + bool HTMLObjectElement::isPresentationAttribute(const QualifiedName& name) const { if (name == borderAttr) @@ -167,7 +172,7 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S paramValues.append(p->value()); // FIXME: url adjustment does not belong in this function. - if (url.isEmpty() && urlParameter.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) + if (url.isEmpty() && urlParameter.isEmpty() && !isQtPluginServiceType(serviceType) && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) urlParameter = stripLeadingAndTrailingHTMLSpaces(p->value()); // FIXME: serviceType calculation does not belong in this function. if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) { @@ -207,7 +212,7 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S // attribute, not by a param element. However, for compatibility, allow the // resource's URL to be given by a param named "src", "movie", "code" or "url" // if we know that resource points to a plug-in. - if (url.isEmpty() && !urlParameter.isEmpty()) { + if (url.isEmpty() && !urlParameter.isEmpty() && !isQtPluginServiceType(serviceType)) { SubframeLoader* loader = document()->frame()->loader()->subframeLoader(); if (loader->resourceWillUsePlugin(urlParameter, serviceType, shouldPreferPlugInsForImages())) url = urlParameter; @@ -257,7 +262,7 @@ bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk() bool HTMLObjectElement::hasValidClassId() { #if PLATFORM(QT) - if (equalIgnoringCase(serviceType(), "application/x-qt-plugin") || equalIgnoringCase(serviceType(), "application/x-qt-styled-widget")) + if (isQtPluginServiceType(serviceType())) return true; #endif |