Diff
Modified: trunk/LayoutTests/ChangeLog (156913 => 156914)
--- trunk/LayoutTests/ChangeLog 2013-10-04 21:52:29 UTC (rev 156913)
+++ trunk/LayoutTests/ChangeLog 2013-10-04 21:59:32 UTC (rev 156914)
@@ -1,3 +1,32 @@
+2013-10-04 Manuel Rego Casasnovas <[email protected]>
+
+ [CSS Regions] Layout Tests for selecting text in 2 regions for other writing modes
+ https://bugs.webkit.org/show_bug.cgi?id=122327
+
+ Reviewed by Alexandru Chiculita.
+
+ Add versions for other writing modes (horizontal-bt, vertical-lr and
+ vertical-rl) for test
+ fast/regions/selection/selecting-text-in-2-regions.html.
+
+ * fast/regions/resources/helper.js:
+ (selectContentByIdsVert): Add new method when selecting context in a
+ vertical writing mode.
+ * fast/regions/resources/region-style.css: Add some new CSS classes for
+ vertical writing mode.
+ * fast/regions/selection/selecting-text-in-2-regions-horiz-bt-expected.html:
+ Added.
+ * fast/regions/selection/selecting-text-in-2-regions-horiz-bt.html:
+ Added.
+ * fast/regions/selection/selecting-text-in-2-regions-vert-lr-expected.html:
+ Added.
+ * fast/regions/selection/selecting-text-in-2-regions-vert-lr.html:
+ Added.
+ * fast/regions/selection/selecting-text-in-2-regions-vert-rl-expected.html:
+ Added.
+ * fast/regions/selection/selecting-text-in-2-regions-vert-rl.html:
+ Added.
+
2013-10-04 Oliver Hunt <[email protected]>
Support for-of syntax
Modified: trunk/LayoutTests/fast/regions/resources/helper.js (156913 => 156914)
--- trunk/LayoutTests/fast/regions/resources/helper.js 2013-10-04 21:52:29 UTC (rev 156913)
+++ trunk/LayoutTests/fast/regions/resources/helper.js 2013-10-04 21:59:32 UTC (rev 156914)
@@ -224,6 +224,16 @@
selectContentByRange(fromRect.left, fromRectVerticalCenter, toRect.right, toRectVerticalCenter);
}
+function selectContentByIdsVert(fromId, toId) {
+ var fromRect = document.getElementById(fromId).getBoundingClientRect();
+ var toRect = document.getElementById(toId).getBoundingClientRect();
+
+ var fromRectHorizontalCenter = fromRect.left + fromRect.width / 2;
+ var toRectHorizontalCenter = toRect.left + toRect.width / 2;
+
+ selectContentByRange(fromRectHorizontalCenter, fromRect.top, toRectHorizontalCenter, toRect.bottom);
+}
+
function selectBaseAndExtent(fromId, fromOffset, toId, toOffset) {
var from = document.getElementById(fromId);
var to = document.getElementById(toId);
Modified: trunk/LayoutTests/fast/regions/resources/region-style.css (156913 => 156914)
--- trunk/LayoutTests/fast/regions/resources/region-style.css 2013-10-04 21:52:29 UTC (rev 156913)
+++ trunk/LayoutTests/fast/regions/resources/region-style.css 2013-10-04 21:59:32 UTC (rev 156914)
@@ -94,3 +94,18 @@
width: 300px;
background-color: lightgrey;
}
+
+.descriptionVert {
+ height: 600px;
+}
+
+.bigBoxVert {
+ height: 300px;
+ width: 100px;
+}
+
+.greyBigBoxVert {
+ height: 300px;
+ width: 100px;
+ background-color: lightgrey;
+}
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt-expected.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt-expected.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: horizontal-bt;
+ }
+
+ #region-1 {
+ position: absolute;
+ bottom: 0px;
+ }
+
+ #region-2 {
+ position: absolute;
+ bottom: 200px;
+ }
+
+ #outside {
+ position: absolute;
+ bottom: 100px;
+ }
+
+ #description {
+ position: absolute;
+ bottom: 300px;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIds('word1', 'word2');" style="margin-bottom: 0;">
+ <div id="region-1" class="greyBigBox">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="region-2" class="greyBigBox">
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="outside" class="bigBox">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div id="description" class="description">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-horiz-bt.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: horizontal-bt;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIds('word1', 'word2');" style="margin-bottom: 0;">
+ <div class="flowArticle">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ <span class="break"></span>
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div class="regionArticle greyBigBox"></div>
+ <div class="bigBox">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div class="regionArticle greyBigBox"></div>
+ <div class="description">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr-expected.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr-expected.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: vertical-lr;
+ }
+
+ #region-1 {
+ position: absolute;
+ left: 0px;
+ }
+
+ #region-2 {
+ position: absolute;
+ left: 200px;
+ }
+
+ #outside {
+ position: absolute;
+ left: 100px;
+ }
+
+ #description {
+ position: absolute;
+ left: 300px;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIdsVert('word1', 'word2');" style="margin-left: 0;">
+ <div id="region-1" class="greyBigBoxVert">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="region-2" class="greyBigBoxVert">
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="outside" class="bigBoxVert">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div id="description" class="descriptionVert">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-lr.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: vertical-lr;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIdsVert('word1', 'word2');" style="margin-left: 0;">
+ <div class="flowArticle">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ <span class="break"></span>
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div class="regionArticle greyBigBoxVert"></div>
+ <div class="bigBoxVert">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div class="regionArticle greyBigBoxVert"></div>
+ <div class="descriptionVert">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl-expected.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl-expected.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: vertical-rl;
+ }
+
+ #region-1 {
+ position: absolute;
+ right: 0px;
+ }
+
+ #region-2 {
+ position: absolute;
+ right: 200px;
+ }
+
+ #outside {
+ position: absolute;
+ right: 100px;
+ }
+
+ #description {
+ position: absolute;
+ right: 300px;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIdsVert('word1', 'word2');" style="margin-right: 0;">
+ <div id="region-1" class="greyBigBoxVert">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="region-2" class="greyBigBoxVert">
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div id="outside" class="bigBoxVert">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div id="description" class="descriptionVert">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl.html (0 => 156914)
--- trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl.html (rev 0)
+++ trunk/LayoutTests/fast/regions/selection/selecting-text-in-2-regions-vert-rl.html 2013-10-04 21:59:32 UTC (rev 156914)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <link rel="stylesheet" href=""
+ <style>
+ html {
+ -webkit-writing-mode: vertical-rl;
+ }
+ </style>
+ <script>
+ onMouseUpLogSelection("selected-content");
+ </script>
+</head>
+<body _onload_="selectContentByIdsVert('word1', 'word2');" style="margin-right: 0;">
+ <div class="flowArticle">
+ inside region inside region inside region inside region
+ <span id="word1" class="token">word1</span>
+ inside region inside region inside region inside region
+ <span class="break"></span>
+ inside region inside region inside region inside region
+ <span id="word2" class="token">word2</span>
+ inside region inside region inside region inside region
+ </div>
+ <div class="regionArticle greyBigBoxVert"></div>
+ <div class="bigBoxVert">
+ outside region outside region outside region outside region
+ outside region outside region outside region outside region
+ </div>
+ <div class="regionArticle greyBigBoxVert"></div>
+ <div class="descriptionVert">
+ <h1><a href="" #121841 - [CSS Regions] Layout Test for selecting text in 2 regions</a></h1>
+ <p>This test checks the selection in 2 regions. If you select from <span class="token">word1</span> to <span class="token">word2</span> you will see that "outside region" text is not highlighted and not included in the selected content.</p>
+ <dl>
+ <dt>Selected content:</dt>
+ <dd id="selected-content"></dd>
+ </dl>
+ </div>
+</body>
+</html>