Changeset 190859 in webkit
- Timestamp:
- Oct 12, 2015, 10:25:37 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190858 r190859 1 2015-10-09 Anders Carlsson <andersca@apple.com> 2 3 Don't allow plug-ins to override image types for <embed> elements 4 https://bugs.webkit.org/show_bug.cgi?id=149979 5 6 Reviewed by Tim Horton. 7 8 Remove test. 9 10 * platform/efl/TestExpectations: 11 * platform/gtk/TestExpectations: 12 * plugins/embed-prefers-plugins-for-images-expected.txt: Removed. 13 * plugins/embed-prefers-plugins-for-images.html: Removed. 14 1 15 2015-10-12 Ryan Haddad <ryanhaddad@apple.com> 2 16 -
trunk/LayoutTests/platform/efl/TestExpectations
r190848 r190859 1954 1954 1955 1955 webkit.org/b/127725 media/video-restricted-no-preload-auto.html [ Failure ] 1956 1957 webkit.org/b/127731 plugins/embed-prefers-plugins-for-images.html [ Failure ]1958 1956 1959 1957 # Subpixel rendering: borders are reporting float values. -
trunk/LayoutTests/platform/gtk/TestExpectations
r190717 r190859 683 683 684 684 webkit.org/b/131217 [ Debug ] plugins/no-mime-with-valid-extension.html [ Crash ] 685 webkit.org/b/131217 [ Debug ] plugins/embed-prefers-plugins-for-images.html [ Crash ]686 685 687 686 webkit.org/b/105870 [ Debug ] webaudio/audiobuffersource-loop-points.html [ Crash ] -
trunk/Source/WebCore/ChangeLog
r190853 r190859 1 2015-10-09 Anders Carlsson <andersca@apple.com> 2 3 Don't allow plug-ins to override image types for <embed> elements 4 https://bugs.webkit.org/show_bug.cgi?id=149979 5 6 Reviewed by Tim Horton. 7 8 Stop allowing plug-ins to take over image types for <embed> elements. We already do this 9 for <object> elements, but had to make <embed> elements exempt because of webkit.org/b/49016. 10 The QuickTime plug-in hasn't supported image types since Lion, so there's no point in keeping this code around. 11 12 * html/HTMLAppletElement.cpp: 13 (WebCore::HTMLAppletElement::HTMLAppletElement): 14 * html/HTMLEmbedElement.cpp: 15 (WebCore::HTMLEmbedElement::HTMLEmbedElement): 16 * html/HTMLObjectElement.cpp: 17 (WebCore::HTMLObjectElement::HTMLObjectElement): 18 (WebCore::HTMLObjectElement::parametersForPlugin): 19 * html/HTMLPlugInImageElement.cpp: 20 (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): 21 (WebCore::HTMLPlugInImageElement::isImageType): 22 (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin): 23 * html/HTMLPlugInImageElement.h: 24 (WebCore::HTMLPlugInImageElement::shouldPreferPlugInsForImages): Deleted. 25 * loader/EmptyClients.h: 26 * loader/FrameLoaderClient.h: 27 * loader/SubframeLoader.cpp: 28 (WebCore::SubframeLoader::resourceWillUsePlugin): 29 (WebCore::SubframeLoader::requestObject): 30 (WebCore::SubframeLoader::shouldUsePlugin): 31 * loader/SubframeLoader.h: 32 1 33 2015-10-12 Zan Dobersek <zdobersek@igalia.com> 2 34 -
trunk/Source/WebCore/html/HTMLAppletElement.cpp
r183160 r190859 42 42 43 43 HTMLAppletElement::HTMLAppletElement(const QualifiedName& tagName, Document& document, bool createdByParser) 44 : HTMLPlugInImageElement(tagName, document, createdByParser , ShouldNotPreferPlugInsForImages)44 : HTMLPlugInImageElement(tagName, document, createdByParser) 45 45 { 46 46 ASSERT(hasTagName(appletTag)); -
trunk/Source/WebCore/html/HTMLEmbedElement.cpp
r182120 r190859 45 45 46 46 inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document& document, bool createdByParser) 47 : HTMLPlugInImageElement(tagName, document, createdByParser , ShouldPreferPlugInsForImages)47 : HTMLPlugInImageElement(tagName, document, createdByParser) 48 48 { 49 49 ASSERT(hasTagName(embedTag)); -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r189469 r190859 65 65 66 66 inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form, bool createdByParser) 67 : HTMLPlugInImageElement(tagName, document, createdByParser , ShouldNotPreferPlugInsForImages)67 : HTMLPlugInImageElement(tagName, document, createdByParser) 68 68 , m_docNamedItem(true) 69 69 , m_useFallbackContent(false) … … 229 229 if (url.isEmpty() && !urlParameter.isEmpty()) { 230 230 SubframeLoader& loader = document().frame()->loader().subframeLoader(); 231 if (loader.resourceWillUsePlugin(urlParameter, serviceType , shouldPreferPlugInsForImages()))231 if (loader.resourceWillUsePlugin(urlParameter, serviceType)) 232 232 url = urlParameter; 233 233 } -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r188809 r190859 100 100 }; 101 101 102 HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document& document, bool createdByParser , PreferPlugInsForImagesOption preferPlugInsForImagesOption)102 HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document& document, bool createdByParser) 103 103 : HTMLPlugInElement(tagName, document) 104 104 // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay … … 107 107 // the same codepath in this class. 108 108 , m_needsWidgetUpdate(!createdByParser) 109 , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)110 109 , m_needsDocumentActivationCallbacks(false) 111 110 , m_simulatedMouseClickTimer(*this, &HTMLPlugInImageElement::simulatedMouseClickTimerFired, simulatedMouseClickTimerDelay) … … 157 156 if (Frame* frame = document().frame()) { 158 157 URL completedURL = document().completeURL(m_url); 159 return frame->loader().client().objectContentType(completedURL, m_serviceType , shouldPreferPlugInsForImages()) == ObjectContentImage;158 return frame->loader().client().objectContentType(completedURL, m_serviceType) == ObjectContentImage; 160 159 } 161 160 … … 186 185 187 186 FrameLoader& frameLoader = document().frame()->loader(); 188 if (frameLoader.client().objectContentType(completedURL, serviceType , shouldPreferPlugInsForImages()) == ObjectContentNetscapePlugin)187 if (frameLoader.client().objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin) 189 188 return true; 190 189 return false; -
trunk/Source/WebCore/html/HTMLPlugInImageElement.h
r183160 r190859 62 62 } 63 63 64 bool shouldPreferPlugInsForImages() const { return m_shouldPreferPlugInsForImages; }65 66 64 // Public for FrameView::addWidgetToUpdate() 67 65 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } … … 94 92 95 93 protected: 96 enum PreferPlugInsForImagesOption { ShouldPreferPlugInsForImages, ShouldNotPreferPlugInsForImages }; 97 HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption); 94 HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser); 98 95 99 96 virtual void didMoveToNewDocument(Document* oldDocument) override; … … 143 140 URL m_loadedUrl; 144 141 bool m_needsWidgetUpdate; 145 bool m_shouldPreferPlugInsForImages;146 142 bool m_needsDocumentActivationCallbacks; 147 143 RefPtr<MouseEvent> m_pendingClickEventFromSnapshot; -
trunk/Source/WebCore/loader/EmptyClients.h
r190611 r190859 377 377 virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const URL&, const Vector<String>&, const Vector<String>&) override; 378 378 379 virtual ObjectContentType objectContentType(const URL&, const String& , bool) override { return ObjectContentType(); }379 virtual ObjectContentType objectContentType(const URL&, const String&) override { return ObjectContentType(); } 380 380 virtual String overrideMediaType() const override { return String(); } 381 381 -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r190611 r190859 282 282 virtual void dispatchDidFailToStartPlugin(const PluginViewBase*) const { } 283 283 284 virtual ObjectContentType objectContentType(const URL&, const String& mimeType , bool shouldPreferPlugInsForImages) = 0;284 virtual ObjectContentType objectContentType(const URL&, const String& mimeType) = 0; 285 285 virtual String overrideMediaType() const = 0; 286 286 -
trunk/Source/WebCore/loader/SubframeLoader.cpp
r190826 r190859 95 95 } 96 96 97 bool SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType , bool shouldPreferPlugInsForImages)97 bool SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType) 98 98 { 99 99 URL completedURL; … … 102 102 103 103 bool useFallback; 104 return shouldUsePlugin(completedURL, mimeType, shouldPreferPlugInsForImages,false, useFallback);104 return shouldUsePlugin(completedURL, mimeType, false, useFallback); 105 105 } 106 106 … … 222 222 223 223 bool useFallback; 224 if (shouldUsePlugin(completedURL, mimeType, ownerElement.shouldPreferPlugInsForImages(),hasFallbackContent, useFallback)) {224 if (shouldUsePlugin(completedURL, mimeType, hasFallbackContent, useFallback)) { 225 225 bool success = requestPlugin(ownerElement, completedURL, mimeType, paramNames, paramValues, useFallback); 226 226 logPluginRequest(document()->page(), mimeType, completedURL, success); … … 368 368 } 369 369 370 bool SubframeLoader::shouldUsePlugin(const URL& url, const String& mimeType, bool shouldPreferPlugInsForImages, boolhasFallback, bool& useFallback)370 bool SubframeLoader::shouldUsePlugin(const URL& url, const String& mimeType, bool hasFallback, bool& useFallback) 371 371 { 372 372 if (m_frame.loader().client().shouldAlwaysUsePluginDocument(mimeType)) { … … 375 375 } 376 376 377 ObjectContentType objectType = m_frame.loader().client().objectContentType(url, mimeType , shouldPreferPlugInsForImages);377 ObjectContentType objectType = m_frame.loader().client().objectContentType(url, mimeType); 378 378 // If an object's content can't be handled and it has no fallback, let 379 379 // it be handled as a plugin to show the broken plugin icon. 380 380 useFallback = objectType == ObjectContentNone && hasFallback; 381 381 382 return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin; 382 383 } -
trunk/Source/WebCore/loader/SubframeLoader.h
r187891 r190859 70 70 bool containsPlugins() const { return m_containsPlugins; } 71 71 72 bool resourceWillUsePlugin(const String& url, const String& mimeType , bool shouldPreferPlugInsForImages);72 bool resourceWillUsePlugin(const String& url, const String& mimeType); 73 73 74 74 private: … … 78 78 bool loadPlugin(HTMLPlugInImageElement&, const URL&, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback); 79 79 80 bool shouldUsePlugin(const URL&, const String& mimeType, bool shouldPreferPlugInsForImages, boolhasFallback, bool& useFallback);80 bool shouldUsePlugin(const URL&, const String& mimeType, bool hasFallback, bool& useFallback); 81 81 bool pluginIsLoadable(HTMLPlugInImageElement&, const URL&, const String& mimeType); 82 82 -
trunk/Source/WebKit/mac/ChangeLog
r190841 r190859 1 2015-10-09 Anders Carlsson <andersca@apple.com> 2 3 Don't allow plug-ins to override image types for <embed> elements 4 https://bugs.webkit.org/show_bug.cgi?id=149979 5 6 Reviewed by Tim Horton. 7 8 * WebCoreSupport/WebFrameLoaderClient.h: 9 * WebCoreSupport/WebFrameLoaderClient.mm: 10 (WebFrameLoaderClient::objectContentType): 11 1 12 2015-10-10 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r190611 r190859 214 214 const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues) override; 215 215 216 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType , bool shouldPreferPlugInsForImages) override;216 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType) override; 217 217 virtual WTF::String overrideMediaType() const override; 218 218 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r190841 r190859 1652 1652 } 1653 1653 1654 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeType , bool shouldPreferPlugInsForImages)1654 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeType) 1655 1655 { 1656 1656 BEGIN_BLOCK_OBJC_EXCEPTIONS; … … 1698 1698 1699 1699 if (MIMETypeRegistry::isSupportedImageMIMEType(type)) 1700 return shouldPreferPlugInsForImages && plugInType != ObjectContentNone ? plugInType :ObjectContentImage;1700 return ObjectContentImage; 1701 1701 1702 1702 if (plugInType != ObjectContentNone) -
trunk/Source/WebKit/win/ChangeLog
r190611 r190859 1 2015-10-09 Anders Carlsson <andersca@apple.com> 2 3 Don't allow plug-ins to override image types for <embed> elements 4 https://bugs.webkit.org/show_bug.cgi?id=149979 5 6 Reviewed by Tim Horton. 7 8 * WebCoreSupport/WebFrameLoaderClient.cpp: 9 (WebFrameLoaderClient::objectContentType): 10 * WebCoreSupport/WebFrameLoaderClient.h: 11 1 12 2015-10-06 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r190611 r190859 1085 1085 } 1086 1086 1087 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeTypeIn , bool shouldPreferPlugInsForImages)1087 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeTypeIn) 1088 1088 { 1089 1089 String mimeType = mimeTypeIn; … … 1103 1103 1104 1104 if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) 1105 return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? WebCore::ObjectContentNetscapePlugin :WebCore::ObjectContentImage;1105 return WebCore::ObjectContentImage; 1106 1106 1107 1107 if (plugInSupportsMIMEType) -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
r190611 r190859 190 190 virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::URL& baseURL, const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues) override; 191 191 192 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType , bool shouldPreferPlugInsForImages) override;192 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType) override; 193 193 virtual WTF::String overrideMediaType() const override; 194 194 -
trunk/Source/WebKit2/ChangeLog
r190851 r190859 1 2015-10-09 Anders Carlsson <andersca@apple.com> 2 3 Don't allow plug-ins to override image types for <embed> elements 4 https://bugs.webkit.org/show_bug.cgi?id=149979 5 6 Reviewed by Tim Horton. 7 8 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 9 (WebKit::WebFrameLoaderClient::objectContentType): 10 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 11 1 12 2015-10-12 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 13 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r190611 r190859 1513 1513 } 1514 1514 1515 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeTypeIn , bool shouldPreferPlugInsForImages)1515 ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const String& mimeTypeIn) 1516 1516 { 1517 1517 // FIXME: This should be merged with WebCore::FrameLoader::defaultObjectContentType when the plugin code … … 1547 1547 1548 1548 if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) 1549 return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? ObjectContentNetscapePlugin :ObjectContentImage;1549 return ObjectContentImage; 1550 1550 1551 1551 if (plugInSupportsMIMEType) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r190611 r190859 201 201 virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::URL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) override; 202 202 203 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const String& mimeType , bool shouldPreferPlugInsForImages) override;203 virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const String& mimeType) override; 204 204 virtual String overrideMediaType() const override; 205 205
Note:
See TracChangeset
for help on using the changeset viewer.