Diff
Modified: trunk/LayoutTests/ChangeLog (214589 => 214590)
--- trunk/LayoutTests/ChangeLog 2017-03-30 01:31:53 UTC (rev 214589)
+++ trunk/LayoutTests/ChangeLog 2017-03-30 01:31:59 UTC (rev 214590)
@@ -1,3 +1,28 @@
+2017-03-29 Simon Fraser <simon.fra...@apple.com>
+
+ Add some tests that dump the touch event regions with various content configurations
+ https://bugs.webkit.org/show_bug.cgi?id=170216
+
+ Reviewed by Dean Jackson.
+
+ Tests for touch event regions. Some of these are modeled after tests in tiled-drawing/scrolling/non-fast-region/.
+
+ * fast/events/touch/ios/touch-event-regions/resources/touch-regions-helper.js: Added.
+ * fast/events/touch/ios/touch-event-regions/active-passive-nesting-expected.html: Added.
+ * fast/events/touch/ios/touch-event-regions/active-passive-nesting.html: Added.
+ * fast/events/touch/ios/touch-event-regions/columns-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/columns.html: Added.
+ * fast/events/touch/ios/touch-event-regions/complex-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/complex.html: Added.
+ * fast/events/touch/ios/touch-event-regions/document-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/document.html: Added.
+ * fast/events/touch/ios/touch-event-regions/iframes-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/iframes.html: Added.
+ * fast/events/touch/ios/touch-event-regions/overflow-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/overflow.html: Added.
+ * fast/events/touch/ios/touch-event-regions/range-sliders-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/range-sliders.html: Added.
+
2017-03-28 Simon Fraser <simon.fra...@apple.com>
Make it possible to dump touch event regions for testing
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/active-passive-nesting.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/active-passive-nesting.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/active-passive-nesting.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .container {
+ width: 150px;
+ height: 150px;
+ margin: 40px;
+ padding: 10px;
+ border: 4px solid gray;
+ }
+
+ .box {
+ width: 100px;
+ height: 100px;
+ border: 4px solid black;
+ margin-left: 100px;
+ }
+
+ .active {
+ border-color: orange;
+ }
+
+ .passive {
+ border-color: gray;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function doTest()
+ {
+ var activeElements = document.querySelectorAll('.active');
+ for (var element of activeElements) {
+ element.addEventListener('touchstart', function(e) { });
+ }
+
+ var passiveElements = document.querySelectorAll('.passive');
+ for (var element of passiveElements) {
+ element.addEventListener('touchstart', function(e) { }, { 'passive': true });
+ }
+
+ dumpRegions();
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+
+<div class="passive container">
+ Passive
+ <div class="active box">
+ Active
+ </div>
+</div>
+
+<div class="active container">
+ Active
+ <div class="passive box">
+ Passive
+ </div>
+</div>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/columns.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/columns.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/columns.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .columns {
+ margin: 20px;
+ width: 400px;
+ height: 320px;
+ column-width: 120px;
+ }
+ .target {
+ color: blue;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+
+<div class="columns">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ <p class="target" _ontouchstart_="(void)0">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
+</div>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/complex.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/complex.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/complex.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .box {
+ width: 100px;
+ height: 100px;
+ margin: 20px;
+ border: 4px solid black;
+ position: relative;
+ }
+
+ #target {
+ margin-top: 200px;
+ background-color: cyan;
+ }
+
+ .overflowing-transformed {
+ position: absolute;
+ top: 100px;
+ left: 300px;
+ width: 200px;
+ height: 100px;
+ border: 1px solid green;
+ transform: rotate(30deg);
+ }
+
+ .container {
+ position: absolute;
+ top: 350px;
+ height: 100px;
+ border: 1px solid green;
+ }
+
+ .inner {
+ position: relative;
+ top: 20px;
+ left: 200px;
+ padding: 10px;
+ background-color: orange;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+
+<div class="box" style="position: relative" _ontouchstart_="(void)0">
+ touch start
+ <div class="box" style="position: relative; left: 170px; top: 40px">positioned child</div>
+</div>
+
+<div style="height: 100px"></div>
+
+<span id="target" _ontouchstart_="(void)0">inline with positioned and transformed children
+ <div class="box">
+ box
+ <div class="overflowing-transformed">
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ </div>
+ </div>
+here</span>
+
+<!-- Handler on skipped containing block -->
+<div class="container" _ontouchstart_="(void)0" style="top: 600px;">
+ positioned block
+ <div class="intermediate">
+ in-flow block
+ <div class="inner">
+ positioned child
+ </div>
+ </div>
+</div>
+
+<div class="container" style="top: 800px;">
+ positioned block
+ <!-- Handler on skipped containing block -->
+ <div class="intermediate" _ontouchstart_="(void)0">
+ in-flow block
+ <div class="inner">
+ positioned child
+ </div>
+ </div>
+</div>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/document.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/document.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/document.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+ <script>
+ document.addEventListener('touchstart', function() { });
+ </script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/iframes.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/iframes.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/iframes.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ iframe {
+ display: block;
+ margin: 10px 10px 120px 10px;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+
+<iframe scrolling="no" width="200" height="120" srcdoc="
+ <div _ontouchstart_='(void)0'>This has a touchstart</div>
+ <div style='width: 100px; height: 100px; margin: 100px;' _ontouchstart_='(void)0'>This has a touchstart</div>
+"></iframe>
+
+<iframe width="200" height="120" srcdoc="
+ iframe with window touchstart listener
+ <script>
+ window.addEventListener('touchstart', function() { }, false);
+ </script>
+"></iframe>
+
+<iframe style="transform: rotate(10deg)" srcdoc="
+ <div style='width: 100px; height: 100px; margin: 50px;' _ontouchstart_='(void)0'>This has a touchstart</div>
+"></iframe>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/overflow.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/overflow.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/overflow.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ .container {
+ height: 200px;
+ width: 200px;
+ border: 1px solid black;
+ margin: 50px;
+ overflow: hidden;
+ }
+ .box {
+ height: 100px;
+ width: 120px;
+ border: 1px solid black;
+ margin: 150px 10px;
+ }
+ .contents {
+ height: 500px;
+ background-color: silver;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+
+ <div class="container" _ontouchstart_="(void)0">
+ <div class="contents">
+ touch start on container
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="box" _ontouchstart_="(void)0">touchstart inside overflow</div>
+ </div>
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/range-sliders.html (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/range-sliders.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/range-sliders.html 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', dumpRegions, false);
+ </script>
+</head>
+<body>
+
+ <input type="range" style="width: 10px; height: 200px; -webkit-appearance: slider-vertical;">
+ <input type="range">
+ <input type="range" style="transform: scale(2); transform-origin: top left;">
+
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/resources/touch-regions-helper.js (0 => 214590)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/resources/touch-regions-helper.js (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/resources/touch-regions-helper.js 2017-03-30 01:31:59 UTC (rev 214590)
@@ -0,0 +1,37 @@
+function rectsAsString(rects)
+{
+ var result = "";
+ for (var i = 0; i < rects.length; ++i) {
+ var rect = rects[i];
+ if (i)
+ result += '\n';
+ result += rect.left + ', ' + rect.top + ' - ' + rect.right + ', ' + rect.bottom;
+ }
+ return result;
+}
+
+function dumpRegions()
+{
+ if (!window.internals)
+ return;
+
+ var resultString = 'touchstart\n';
+ var rectList = internals.touchEventRectsForEvent('touchstart');
+ resultString += rectsAsString(rectList);
+
+ rectList = internals.touchEventRectsForEvent('touchmove');
+ resultString += '\ntouchstart\n' + rectsAsString(rectList);
+
+ rectList = internals.touchEventRectsForEvent('touchend');
+ resultString += '\ntouchend\n' + rectsAsString(rectList);
+
+ rectList = internals.touchEventRectsForEvent('touchforcechange');
+ resultString += '\ntouchforcechange\n' + rectsAsString(rectList);
+
+ rectList = internals.passiveTouchEventListenerRects();
+ resultString += '\npassive\n' + rectsAsString(rectList);
+
+ var resultsPre = document.createElement('pre');
+ resultsPre.textContent = resultString;
+ document.body.appendChild(resultsPre);
+}