Allow testing of plug-ins that handle wheel events.
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 23:02:11 +0000 (23:02 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 23:02:11 +0000 (23:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144413

Reviewed by Tim Horton.

Source/WebKit2:

Allow the Test Netscape Plug-in to pretend to handle wheel events,
so layout tests can use it.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::determineQuirks):

LayoutTests:

Test the non-fast scrollable region with top content inset and header height, and with a plug-in.

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm

index db49e2a..fc4b589 100644 (file)
@@ -1,3 +1,19 @@
+2015-04-29  Simon Fraser  <simon.fraser@apple.com>
+
+        Allow testing of plug-ins that handle wheel events.
+        https://bugs.webkit.org/show_bug.cgi?id=144413
+
+        Reviewed by Tim Horton.
+        
+        Test the non-fast scrollable region with top content inset and header height, and with a plug-in.
+
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset.html: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html: Added.
+
 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] Add support for automatic hyphenation
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt
new file mode 100644 (file)
index 0000000..ed44c33
--- /dev/null
@@ -0,0 +1,3 @@
+Wheel event rect:
+
+28, 110 - 128, 210
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt
new file mode 100644 (file)
index 0000000..ed44c33
--- /dev/null
@@ -0,0 +1,3 @@
+Wheel event rect:
+
+28, 110 - 128, 210
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header.html
new file mode 100644 (file)
index 0000000..0013973
--- /dev/null
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            height: 100px;
+            width: 100px;
+            margin: 10px 20px;
+            background-color: blue;
+            box-shadow: 0 0 10px black;
+        }
+        
+    </style>
+    <script src="resources/wheel-handler-region-helper.js"></script>
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        if (window.internals) {
+            internals.setTopContentInset(60);
+            internals.setHeaderHeight(23);
+        }
+
+        function doTest()
+        {
+            window.setTimeout(function() {
+                // Scroll to test the mapping from document to view coords.
+                document.body.scrollTop = 195;
+                dumpRegion();
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0)
+        }
+
+        window.addEventListener('load', doTest);
+    </script>
+</head>
+<body>
+
+<p>Wheel event rect:</p>
+<div class="box" onmousewheel="(void)0"></div>
+
+<pre id="output"></pre>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset.html
new file mode 100644 (file)
index 0000000..a30a265
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            height: 100px;
+            width: 100px;
+            margin: 10px 20px;
+            background-color: blue;
+            box-shadow: 0 0 10px black;
+        }
+        
+    </style>
+    <script src="resources/wheel-handler-region-helper.js"></script>
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        if (window.internals)
+            internals.setTopContentInset(60);
+
+        function doTest()
+        {
+            window.setTimeout(function() {
+                // Scroll to test the mapping from document to view coords.
+                document.body.scrollTop = 195;
+                dumpRegion();
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0)
+        }
+
+        window.addEventListener('load', doTest);
+    </script>
+</head>
+<body>
+
+<p>Wheel event rect:</p>
+<div class="box" onmousewheel="(void)0"></div>
+
+<pre id="output"></pre>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin-expected.txt
new file mode 100644 (file)
index 0000000..029b0c9
--- /dev/null
@@ -0,0 +1,4 @@
+Wheel event rect for plug-in:
+
+
+28, 70 - 328, 220
diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-event-plugin.html
new file mode 100644 (file)
index 0000000..63cbaac
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            height: 100px;
+            width: 100px;
+            margin: 10px 20px;
+            background-color: blue;
+            box-shadow: 0 0 10px black;
+        }
+        
+        embed {
+            margin: 20px;
+        }
+        
+    </style>
+    <script src="resources/wheel-handler-region-helper.js"></script>
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        if (window.internals) {
+            internals.setTopContentInset(60);
+            internals.setHeaderHeight(23);
+        }
+
+        function doTest()
+        {
+            if (window.internals)
+                internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+
+            // Scroll to test the mapping from document to view coords.
+            document.body.scrollTop = 197;
+            dumpRegion();
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }
+
+        window.addEventListener('load', doTest);
+    </script>
+</head>
+<body>
+
+<p>Wheel event rect for plug-in:</p>
+<embed id="plugin" type="application/x-webkit-test-netscape" drawingmodel="coreanimation"></embed>
+<pre id="output"></pre>
+
+</body>
+</html>
index d7db74d..b96ab8f 100644 (file)
@@ -1,3 +1,16 @@
+2015-04-29  Simon Fraser  <simon.fraser@apple.com>
+
+        Allow testing of plug-ins that handle wheel events.
+        https://bugs.webkit.org/show_bug.cgi?id=144413
+
+        Reviewed by Tim Horton.
+        
+        Allow the Test Netscape Plug-in to pretend to handle wheel events,
+        so layout tests can use it.
+
+        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+        (WebKit::NetscapePluginModule::determineQuirks):
+
 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
 
         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
index e6cf81a..2280488 100644 (file)
@@ -534,7 +534,7 @@ void NetscapePluginModule::determineQuirks()
     }
 #endif
 
-    if (plugin.bundleIdentifier == "com.adobe.acrobat.pdfviewerNPAPI") {
+    if (plugin.bundleIdentifier == "com.adobe.acrobat.pdfviewerNPAPI" || plugin.bundleIdentifier == "com.apple.testnetscapeplugin") {
         // The Adobe Reader plug-in wants wheel events.
         m_pluginQuirks.add(PluginQuirks::WantsWheelEvents);
     }