[CSS Regions] Layout Test for selection direction
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2013 18:04:40 +0000 (18:04 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Sep 2013 18:04:40 +0000 (18:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121501

Reviewed by Darin Adler.

Selection follows DOM tree, so the highlighted text in this test case is
the opposite to what the user is actually selecting. This was not
working properly from r139197 to r155058, so adding a Layout Test to
prevent future breaks. It is a reftest comparing regions and absolute
positions behavior.

* fast/regions/selection-direction-expected.html: Added.
* fast/regions/selection-direction.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/regions/selection-direction-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/selection-direction.html [new file with mode: 0644]

index 504d690..8d54bcb 100644 (file)
@@ -1,3 +1,19 @@
+2013-09-17  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Regions] Layout Test for selection direction
+        https://bugs.webkit.org/show_bug.cgi?id=121501
+
+        Reviewed by Darin Adler.
+
+        Selection follows DOM tree, so the highlighted text in this test case is
+        the opposite to what the user is actually selecting. This was not
+        working properly from r139197 to r155058, so adding a Layout Test to
+        prevent future breaks. It is a reftest comparing regions and absolute
+        positions behavior.
+
+        * fast/regions/selection-direction-expected.html: Added.
+        * fast/regions/selection-direction.html: Added.
+
 2013-09-17  Hans Muller  <hmuller@adobe.com>
 
         Bad ASSERT() in RasterShapeIntervals::firstIncludedIntervalY()
diff --git a/LayoutTests/fast/regions/selection-direction-expected.html b/LayoutTests/fast/regions/selection-direction-expected.html
new file mode 100644 (file)
index 0000000..0bf352e
--- /dev/null
@@ -0,0 +1,48 @@
+<html>
+<head>
+    <style>
+        #region {
+            height: 100px;
+            width: 200px;
+            position: absolute;
+            top: 100px;
+        }
+
+        #outside {
+            height: 100px;
+            width: 200px;
+            position: absolute;
+            top: 0px;
+        }
+
+        body {
+            margin-top: 0;
+        }
+
+        #description {
+            width: 600px;
+            position: absolute;
+            top: 200px;
+        }
+    </style>
+    <script>
+        function selectText() {
+            if (window.testRunner) {
+                eventSender.mouseMoveTo(100, 10);
+                eventSender.mouseDown();
+
+                eventSender.mouseMoveTo(100, 110);
+                eventSender.mouseUp();
+            }
+        }
+    </script>
+</head>
+<body onload="selectText();">
+    <div id="region">inside region inside region inside region inside region</div>
+    <div id="outside">outside region outside region outside region outside region</div>
+    <div id="description">
+        <h1><a href="https://bugs.webkit.org/show_bug.cgi?id=121501">Bug #121501 - [CSS Regions] Layout Test for selection direction</a></h1>
+        <p>Selection is based in DOM tree, so if you select text from "outise region" to "inside region" the highlighted area is exactly the opposite to what the user is actually selecting.</p>
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/fast/regions/selection-direction.html b/LayoutTests/fast/regions/selection-direction.html
new file mode 100644 (file)
index 0000000..85e7b21
--- /dev/null
@@ -0,0 +1,48 @@
+<html>
+<head>
+    <style>
+        #source {
+            -webkit-flow-into: content;
+        }
+
+        #region {
+            -webkit-flow-from: content;
+            height: 100px;
+            width: 200px;
+        }
+
+        #outside {
+            height: 100px;
+            width: 200px;
+        }
+
+        body {
+            margin-top: 0;
+        }
+
+        #description {
+            width: 600px;
+        }
+    </style>
+    <script>
+        function selectText() {
+            if (window.testRunner) {
+                eventSender.mouseMoveTo(100, 10);
+                eventSender.mouseDown();
+
+                eventSender.mouseMoveTo(100, 110);
+                eventSender.mouseUp();
+            }
+        }
+    </script>
+</head>
+<body onload="selectText();">
+    <div id="source">inside region inside region inside region inside region</div>
+    <div id="outside">outside region outside region outside region outside region</div>
+    <div id="region"></div>
+    <div id="description">
+        <h1><a href="https://bugs.webkit.org/show_bug.cgi?id=121501">Bug #121501 - [CSS Regions] Layout Test for selection direction</a></h1>
+        <p>Selection is based in DOM tree, so if you select text from "outise region" to "inside region" the highlighted area is exactly the opposite to what the user is actually selecting.</p>
+    </div>
+</body>
+</html>