Title: [226932] trunk/LayoutTests
Revision
226932
Author
[email protected]
Date
2018-01-12 17:03:42 -0800 (Fri, 12 Jan 2018)

Log Message

Touch events not received with initial-scale=1 viewport
https://bugs.webkit.org/show_bug.cgi?id=181566
rdar://problem/36460221

Reviewed by Tim Horton.

Add a testcase for this touch event case.

* fast/events/touch/ios/target-taller-than-view-expected.txt: Added.
* fast/events/touch/ios/target-taller-than-view.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226931 => 226932)


--- trunk/LayoutTests/ChangeLog	2018-01-13 00:46:06 UTC (rev 226931)
+++ trunk/LayoutTests/ChangeLog	2018-01-13 01:03:42 UTC (rev 226932)
@@ -1,3 +1,16 @@
+2018-01-12  Simon Fraser  <[email protected]>
+
+        Touch events not received with initial-scale=1 viewport
+        https://bugs.webkit.org/show_bug.cgi?id=181566
+        rdar://problem/36460221
+
+        Reviewed by Tim Horton.
+
+        Add a testcase for this touch event case.
+
+        * fast/events/touch/ios/target-taller-than-view-expected.txt: Added.
+        * fast/events/touch/ios/target-taller-than-view.html: Added.
+
 2018-01-12  Myles C. Maxfield  <[email protected]>
 
         Data URL fonts split in the middle of an alphabet cause random letters to disappear

Added: trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view-expected.txt (0 => 226932)


--- trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view-expected.txt	2018-01-13 01:03:42 UTC (rev 226932)
@@ -0,0 +1,16 @@
+Checks that touches work on elements that are taller than the view.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+touchstart fired.
+PASS event.touches.length is 1
+PASS event.touches[0].clientX is 113
+PASS event.touches[0].clientY is 178
+touchend fired.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Test
+
+

Added: trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view.html (0 => 226932)


--- trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/target-taller-than-view.html	2018-01-13 01:03:42 UTC (rev 226932)
@@ -0,0 +1,82 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+    <meta name="viewport" content="initial-scale=1">
+    <style>
+        main {
+            display: flex;
+        }
+        .foo {
+            flex-basis: 0;
+        }
+        .map {
+            flex-grow: 2;
+            overflow: hidden;
+            position: relative;
+            outline: 2px solid green;
+        }
+        #container {
+            height: 10px;
+            background-color: silver;
+            outline: 2px solid black;
+        }
+        #target {
+            background-color: blue;
+        }
+    </style>
+    <script src=""
+    <script>
+        description("Checks that touches work on elements that are taller than the view.");
+        window.jsTestIsAsync = true;
+
+        function getUIScript(x, y)
+        {
+            return `
+            (function() {
+                uiController.singleTapAtPoint(${x}, ${y}, function() {
+                    uiController.uiScriptComplete();
+                });
+            })();`
+        }
+
+        function runTest()
+        {
+            var container = document.getElementById('container');
+            target.addEventListener('touchstart', function() {
+                debug("touchstart fired.");
+                shouldBe("event.touches.length", "1");
+                shouldBe("event.touches[0].clientX", "113");
+                shouldBe("event.touches[0].clientY", "178");
+            }, false);
+
+            window.addEventListener("touchend", (event) => {
+                debug("touchend fired.");
+                finishJSTest();
+            });
+
+            var targetRect = document.getElementById('target').getBoundingClientRect();
+            
+            var tapPointX = targetRect.x + targetRect.width / 2;
+            var tapPointY = targetRect.y + 50; // Tap near the top.
+
+            if (window.testRunner)
+                testRunner.runUIScript(getUIScript(tapPointX, tapPointY), function(result) { });
+        }
+        
+        window.addEventListener('load', runTest, false);
+    </script>
+</head>
+<body>
+<main>
+    <div class="foo">
+        <h1>Test</h1>
+    </div>
+    <div class="map">
+        <div id="container">
+            <div id="target" style="position: absolute; width: 100px; height: 800px;"></div>
+        </div>
+    </div>
+</main>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to