haikuwebkit/LayoutTests/plugins/clicking-missing-plugin-fir...

22 lines
638 B
HTML
Raw Permalink Normal View History

WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Test: plugins/clicking-missing-plugin-fires-delegate.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize m_isCapturingMouseEvents. (WebCore::HTMLPlugInElement::detach): If we're still capturing when getting detached, clear the capturing node on the EventHandler. (WebCore::HTMLPlugInElement::defaultEventHandler): Call handleMissingPluginIndicatorEvent when the missing plugin indicator is showing. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::isCapturingMouseEvents): (WebCore::HTMLPlugInElement::setIsCapturingMouseEvents): * page/ChromeClient.h: (WebCore::ChromeClient::shouldMissingPluginMessageBeButton): Added default implementation. * rendering/RenderEmbeddedObject.cpp: (WebCore::replacementTextRoundedRectPressedColor): (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): (WebCore::RenderEmbeddedObject::setMissingPluginIndicatorIsPressed): Added. Causes a repaint when the state changes. (WebCore::RenderEmbeddedObject::paintReplaced): Call getReplacementTextGeometry. (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): Factored this out so it can be used in paintReplaced and in isInMissingPluginIndicator. (WebCore::RenderEmbeddedObject::isInMissingPluginIndicator): Hit test to see if the mouse event is in the missing plugin indicator. (WebCore::RenderEmbeddedObject::handleMissingPluginIndicatorEvent): Capture mouse events as needed and track the pressed appearance. * rendering/RenderEmbeddedObject.h: WebKit/mac: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldMissingPluginMessageBeButton): WebKit/win: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::shouldMissingPluginMessageBeButton): * WebCoreSupport/WebChromeClient.h: WebKitTools: Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Log when the missing plugin button is pressed. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:didPressMissingPluginButton:]): * DumpRenderTree/win/UIDelegate.cpp: (UIDelegate::QueryInterface): (UIDelegate::createWebViewWithRequest): (UIDelegate::drawBackground): (UIDelegate::decidePolicyForGeolocationRequest): (UIDelegate::didPressMissingPluginButton): * DumpRenderTree/win/UIDelegate.h: LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. * platform/gtk/Skipped: * platform/qt/Skipped: * plugins/clicking-missing-plugin-fires-delegate-expected.txt: Added. * plugins/clicking-missing-plugin-fires-delegate.html: Added. Canonical link: https://commits.webkit.org/53767@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-09 01:01:14 +00:00
<html>
<body>
Block all plugins smaller than 5x5px https://bugs.webkit.org/show_bug.cgi?id=195702 <rdar://problem/28435204> Reviewed by Sam Weinig. Source/WebCore: Block all plugins that are smaller than a threshold, in this case 5px x 5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. Test: plugins/small-plugin-blocked.html * en.lproj/Localizable.strings: New message for a small plugin. * platform/LocalizedStrings.cpp: (WebCore::pluginTooSmallText): * platform/LocalizedStrings.h: * html/HTMLPlugInElement.cpp: Helper function for Internals testing. (WebCore::HTMLPlugInElement::isBelowSizeThreshold const): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: Removed an unused function. (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * page/Settings.yaml: Add flag for new feature. * rendering/RenderEmbeddedObject.cpp: New unavailability reason for embedded objects. (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const): * testing/Internals.cpp: Helper function for testing. (WebCore::Internals::pluginIsBelowSizeThreshold): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Block all plugins that are smaller than a threshold, in this case 5x5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. * Shared/WebPreferences.yaml: New setting for this feature. * UIProcess/WebPageProxy.cpp: Handle new unavailability type. (WebKit::WebPageProxy::unavailablePluginButtonClicked): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function as it was never being called. (WebKit::WebFrameLoaderClient::recreatePlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::pluginIsSmall): Checks the size of the plugin. (WebKit::WebPage::createPlugin): If the plugin is too small, stop it from launching. Source/WebKitLegacy/mac: Removed a function that was never being called. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::recreatePlugin): Deleted. LayoutTests: New test for some small plugins. Updated existing tests to create plugins bigger than a threshold if necessary. * plugins/clicking-missing-plugin-fires-delegate.html: * plugins/destroy-stream-twice.html: * plugins/npruntime/npruntime.html: * plugins/object-embed-plugin-scripting.html: * plugins/small-plugin-blocked-expected.txt: Added. * plugins/small-plugin-blocked.html: Added. * platform/mac-wk1/TestExpectations: Skip new test on WK1. Canonical link: https://commits.webkit.org/210011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-13 23:37:32 +00:00
<embed name="plg" type="application/x-non-existent" style="width:200px;height:200px;" width=200 height=200></embed>
WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Test: plugins/clicking-missing-plugin-fires-delegate.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize m_isCapturingMouseEvents. (WebCore::HTMLPlugInElement::detach): If we're still capturing when getting detached, clear the capturing node on the EventHandler. (WebCore::HTMLPlugInElement::defaultEventHandler): Call handleMissingPluginIndicatorEvent when the missing plugin indicator is showing. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::isCapturingMouseEvents): (WebCore::HTMLPlugInElement::setIsCapturingMouseEvents): * page/ChromeClient.h: (WebCore::ChromeClient::shouldMissingPluginMessageBeButton): Added default implementation. * rendering/RenderEmbeddedObject.cpp: (WebCore::replacementTextRoundedRectPressedColor): (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): (WebCore::RenderEmbeddedObject::setMissingPluginIndicatorIsPressed): Added. Causes a repaint when the state changes. (WebCore::RenderEmbeddedObject::paintReplaced): Call getReplacementTextGeometry. (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): Factored this out so it can be used in paintReplaced and in isInMissingPluginIndicator. (WebCore::RenderEmbeddedObject::isInMissingPluginIndicator): Hit test to see if the mouse event is in the missing plugin indicator. (WebCore::RenderEmbeddedObject::handleMissingPluginIndicatorEvent): Capture mouse events as needed and track the pressed appearance. * rendering/RenderEmbeddedObject.h: WebKit/mac: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldMissingPluginMessageBeButton): WebKit/win: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::shouldMissingPluginMessageBeButton): * WebCoreSupport/WebChromeClient.h: WebKitTools: Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Log when the missing plugin button is pressed. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:didPressMissingPluginButton:]): * DumpRenderTree/win/UIDelegate.cpp: (UIDelegate::QueryInterface): (UIDelegate::createWebViewWithRequest): (UIDelegate::drawBackground): (UIDelegate::decidePolicyForGeolocationRequest): (UIDelegate::didPressMissingPluginButton): * DumpRenderTree/win/UIDelegate.h: LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. * platform/gtk/Skipped: * platform/qt/Skipped: * plugins/clicking-missing-plugin-fires-delegate-expected.txt: Added. * plugins/clicking-missing-plugin-fires-delegate.html: Added. Canonical link: https://commits.webkit.org/53767@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-09 01:01:14 +00:00
<p>This test checks if the missing plug-in button can be clicked. This is a test for <a href="https://bugs.webkit.org/show_bug.cgi?id=41721">Bug 41721</a>.</p>
<script>
Block all plugins smaller than 5x5px https://bugs.webkit.org/show_bug.cgi?id=195702 <rdar://problem/28435204> Reviewed by Sam Weinig. Source/WebCore: Block all plugins that are smaller than a threshold, in this case 5px x 5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. Test: plugins/small-plugin-blocked.html * en.lproj/Localizable.strings: New message for a small plugin. * platform/LocalizedStrings.cpp: (WebCore::pluginTooSmallText): * platform/LocalizedStrings.h: * html/HTMLPlugInElement.cpp: Helper function for Internals testing. (WebCore::HTMLPlugInElement::isBelowSizeThreshold const): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: Removed an unused function. (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * page/Settings.yaml: Add flag for new feature. * rendering/RenderEmbeddedObject.cpp: New unavailability reason for embedded objects. (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const): * testing/Internals.cpp: Helper function for testing. (WebCore::Internals::pluginIsBelowSizeThreshold): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Block all plugins that are smaller than a threshold, in this case 5x5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. * Shared/WebPreferences.yaml: New setting for this feature. * UIProcess/WebPageProxy.cpp: Handle new unavailability type. (WebKit::WebPageProxy::unavailablePluginButtonClicked): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function as it was never being called. (WebKit::WebFrameLoaderClient::recreatePlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::pluginIsSmall): Checks the size of the plugin. (WebKit::WebPage::createPlugin): If the plugin is too small, stop it from launching. Source/WebKitLegacy/mac: Removed a function that was never being called. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::recreatePlugin): Deleted. LayoutTests: New test for some small plugins. Updated existing tests to create plugins bigger than a threshold if necessary. * plugins/clicking-missing-plugin-fires-delegate.html: * plugins/destroy-stream-twice.html: * plugins/npruntime/npruntime.html: * plugins/object-embed-plugin-scripting.html: * plugins/small-plugin-blocked-expected.txt: Added. * plugins/small-plugin-blocked.html: Added. * platform/mac-wk1/TestExpectations: Skip new test on WK1. Canonical link: https://commits.webkit.org/210011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-13 23:37:32 +00:00
if (!window.testRunner)
document.write("This test does not work in manual mode.");
else {
testRunner.dumpAsText();
WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Test: plugins/clicking-missing-plugin-fires-delegate.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize m_isCapturingMouseEvents. (WebCore::HTMLPlugInElement::detach): If we're still capturing when getting detached, clear the capturing node on the EventHandler. (WebCore::HTMLPlugInElement::defaultEventHandler): Call handleMissingPluginIndicatorEvent when the missing plugin indicator is showing. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::isCapturingMouseEvents): (WebCore::HTMLPlugInElement::setIsCapturingMouseEvents): * page/ChromeClient.h: (WebCore::ChromeClient::shouldMissingPluginMessageBeButton): Added default implementation. * rendering/RenderEmbeddedObject.cpp: (WebCore::replacementTextRoundedRectPressedColor): (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): (WebCore::RenderEmbeddedObject::setMissingPluginIndicatorIsPressed): Added. Causes a repaint when the state changes. (WebCore::RenderEmbeddedObject::paintReplaced): Call getReplacementTextGeometry. (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): Factored this out so it can be used in paintReplaced and in isInMissingPluginIndicator. (WebCore::RenderEmbeddedObject::isInMissingPluginIndicator): Hit test to see if the mouse event is in the missing plugin indicator. (WebCore::RenderEmbeddedObject::handleMissingPluginIndicatorEvent): Capture mouse events as needed and track the pressed appearance. * rendering/RenderEmbeddedObject.h: WebKit/mac: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldMissingPluginMessageBeButton): WebKit/win: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::shouldMissingPluginMessageBeButton): * WebCoreSupport/WebChromeClient.h: WebKitTools: Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Log when the missing plugin button is pressed. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:didPressMissingPluginButton:]): * DumpRenderTree/win/UIDelegate.cpp: (UIDelegate::QueryInterface): (UIDelegate::createWebViewWithRequest): (UIDelegate::drawBackground): (UIDelegate::decidePolicyForGeolocationRequest): (UIDelegate::didPressMissingPluginButton): * DumpRenderTree/win/UIDelegate.h: LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. * platform/gtk/Skipped: * platform/qt/Skipped: * plugins/clicking-missing-plugin-fires-delegate-expected.txt: Added. * plugins/clicking-missing-plugin-fires-delegate.html: Added. Canonical link: https://commits.webkit.org/53767@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-09 01:01:14 +00:00
Block all plugins smaller than 5x5px https://bugs.webkit.org/show_bug.cgi?id=195702 <rdar://problem/28435204> Reviewed by Sam Weinig. Source/WebCore: Block all plugins that are smaller than a threshold, in this case 5px x 5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. Test: plugins/small-plugin-blocked.html * en.lproj/Localizable.strings: New message for a small plugin. * platform/LocalizedStrings.cpp: (WebCore::pluginTooSmallText): * platform/LocalizedStrings.h: * html/HTMLPlugInElement.cpp: Helper function for Internals testing. (WebCore::HTMLPlugInElement::isBelowSizeThreshold const): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: Removed an unused function. (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * page/Settings.yaml: Add flag for new feature. * rendering/RenderEmbeddedObject.cpp: New unavailability reason for embedded objects. (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const): * testing/Internals.cpp: Helper function for testing. (WebCore::Internals::pluginIsBelowSizeThreshold): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Block all plugins that are smaller than a threshold, in this case 5x5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. * Shared/WebPreferences.yaml: New setting for this feature. * UIProcess/WebPageProxy.cpp: Handle new unavailability type. (WebKit::WebPageProxy::unavailablePluginButtonClicked): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function as it was never being called. (WebKit::WebFrameLoaderClient::recreatePlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::pluginIsSmall): Checks the size of the plugin. (WebKit::WebPage::createPlugin): If the plugin is too small, stop it from launching. Source/WebKitLegacy/mac: Removed a function that was never being called. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::recreatePlugin): Deleted. LayoutTests: New test for some small plugins. Updated existing tests to create plugins bigger than a threshold if necessary. * plugins/clicking-missing-plugin-fires-delegate.html: * plugins/destroy-stream-twice.html: * plugins/npruntime/npruntime.html: * plugins/object-embed-plugin-scripting.html: * plugins/small-plugin-blocked-expected.txt: Added. * plugins/small-plugin-blocked.html: Added. * platform/mac-wk1/TestExpectations: Skip new test on WK1. Canonical link: https://commits.webkit.org/210011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-13 23:37:32 +00:00
window.onload = function () {
WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Test: plugins/clicking-missing-plugin-fires-delegate.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize m_isCapturingMouseEvents. (WebCore::HTMLPlugInElement::detach): If we're still capturing when getting detached, clear the capturing node on the EventHandler. (WebCore::HTMLPlugInElement::defaultEventHandler): Call handleMissingPluginIndicatorEvent when the missing plugin indicator is showing. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::isCapturingMouseEvents): (WebCore::HTMLPlugInElement::setIsCapturingMouseEvents): * page/ChromeClient.h: (WebCore::ChromeClient::shouldMissingPluginMessageBeButton): Added default implementation. * rendering/RenderEmbeddedObject.cpp: (WebCore::replacementTextRoundedRectPressedColor): (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): (WebCore::RenderEmbeddedObject::setMissingPluginIndicatorIsPressed): Added. Causes a repaint when the state changes. (WebCore::RenderEmbeddedObject::paintReplaced): Call getReplacementTextGeometry. (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): Factored this out so it can be used in paintReplaced and in isInMissingPluginIndicator. (WebCore::RenderEmbeddedObject::isInMissingPluginIndicator): Hit test to see if the mouse event is in the missing plugin indicator. (WebCore::RenderEmbeddedObject::handleMissingPluginIndicatorEvent): Capture mouse events as needed and track the pressed appearance. * rendering/RenderEmbeddedObject.h: WebKit/mac: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldMissingPluginMessageBeButton): WebKit/win: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::shouldMissingPluginMessageBeButton): * WebCoreSupport/WebChromeClient.h: WebKitTools: Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Log when the missing plugin button is pressed. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:didPressMissingPluginButton:]): * DumpRenderTree/win/UIDelegate.cpp: (UIDelegate::QueryInterface): (UIDelegate::createWebViewWithRequest): (UIDelegate::drawBackground): (UIDelegate::decidePolicyForGeolocationRequest): (UIDelegate::didPressMissingPluginButton): * DumpRenderTree/win/UIDelegate.h: LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. * platform/gtk/Skipped: * platform/qt/Skipped: * plugins/clicking-missing-plugin-fires-delegate-expected.txt: Added. * plugins/clicking-missing-plugin-fires-delegate.html: Added. Canonical link: https://commits.webkit.org/53767@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-09 01:01:14 +00:00
eventSender.mouseMoveTo(0,0);
eventSender.mouseMoveTo(105, 105);
eventSender.mouseDown();
eventSender.mouseUp();
Block all plugins smaller than 5x5px https://bugs.webkit.org/show_bug.cgi?id=195702 <rdar://problem/28435204> Reviewed by Sam Weinig. Source/WebCore: Block all plugins that are smaller than a threshold, in this case 5px x 5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. Test: plugins/small-plugin-blocked.html * en.lproj/Localizable.strings: New message for a small plugin. * platform/LocalizedStrings.cpp: (WebCore::pluginTooSmallText): * platform/LocalizedStrings.h: * html/HTMLPlugInElement.cpp: Helper function for Internals testing. (WebCore::HTMLPlugInElement::isBelowSizeThreshold const): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: Removed an unused function. (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * page/Settings.yaml: Add flag for new feature. * rendering/RenderEmbeddedObject.cpp: New unavailability reason for embedded objects. (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const): * testing/Internals.cpp: Helper function for testing. (WebCore::Internals::pluginIsBelowSizeThreshold): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Block all plugins that are smaller than a threshold, in this case 5x5px. Other browsers have implemented this for a while, and now that we have Intersection Observers, small plugins are no longer necessary. * Shared/WebPreferences.yaml: New setting for this feature. * UIProcess/WebPageProxy.cpp: Handle new unavailability type. (WebKit::WebPageProxy::unavailablePluginButtonClicked): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function as it was never being called. (WebKit::WebFrameLoaderClient::recreatePlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::pluginIsSmall): Checks the size of the plugin. (WebKit::WebPage::createPlugin): If the plugin is too small, stop it from launching. Source/WebKitLegacy/mac: Removed a function that was never being called. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::recreatePlugin): Deleted. LayoutTests: New test for some small plugins. Updated existing tests to create plugins bigger than a threshold if necessary. * plugins/clicking-missing-plugin-fires-delegate.html: * plugins/destroy-stream-twice.html: * plugins/npruntime/npruntime.html: * plugins/object-embed-plugin-scripting.html: * plugins/small-plugin-blocked-expected.txt: Added. * plugins/small-plugin-blocked.html: Added. * platform/mac-wk1/TestExpectations: Skip new test on WK1. Canonical link: https://commits.webkit.org/210011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-13 23:37:32 +00:00
};
}
WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Test: plugins/clicking-missing-plugin-fires-delegate.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize m_isCapturingMouseEvents. (WebCore::HTMLPlugInElement::detach): If we're still capturing when getting detached, clear the capturing node on the EventHandler. (WebCore::HTMLPlugInElement::defaultEventHandler): Call handleMissingPluginIndicatorEvent when the missing plugin indicator is showing. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::isCapturingMouseEvents): (WebCore::HTMLPlugInElement::setIsCapturingMouseEvents): * page/ChromeClient.h: (WebCore::ChromeClient::shouldMissingPluginMessageBeButton): Added default implementation. * rendering/RenderEmbeddedObject.cpp: (WebCore::replacementTextRoundedRectPressedColor): (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): (WebCore::RenderEmbeddedObject::setMissingPluginIndicatorIsPressed): Added. Causes a repaint when the state changes. (WebCore::RenderEmbeddedObject::paintReplaced): Call getReplacementTextGeometry. (WebCore::RenderEmbeddedObject::getReplacementTextGeometry): Factored this out so it can be used in paintReplaced and in isInMissingPluginIndicator. (WebCore::RenderEmbeddedObject::isInMissingPluginIndicator): Hit test to see if the mouse event is in the missing plugin indicator. (WebCore::RenderEmbeddedObject::handleMissingPluginIndicatorEvent): Capture mouse events as needed and track the pressed appearance. * rendering/RenderEmbeddedObject.h: WebKit/mac: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldMissingPluginMessageBeButton): WebKit/win: Fix for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Implement shouldMissingPluginMessageBeButton. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::shouldMissingPluginMessageBeButton): * WebCoreSupport/WebChromeClient.h: WebKitTools: Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. Log when the missing plugin button is pressed. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:didPressMissingPluginButton:]): * DumpRenderTree/win/UIDelegate.cpp: (UIDelegate::QueryInterface): (UIDelegate::createWebViewWithRequest): (UIDelegate::drawBackground): (UIDelegate::decidePolicyForGeolocationRequest): (UIDelegate::didPressMissingPluginButton): * DumpRenderTree/win/UIDelegate.h: LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=41721 <rdar://problem/8158561> Missing plug-in indicator should have a pressed state Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler. * platform/gtk/Skipped: * platform/qt/Skipped: * plugins/clicking-missing-plugin-fires-delegate-expected.txt: Added. * plugins/clicking-missing-plugin-fires-delegate.html: Added. Canonical link: https://commits.webkit.org/53767@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-09 01:01:14 +00:00
</script>
</body>
</html>