Bug 1399310 - (Part 2) Add a bunch of test cases for text selection.
MozReview-Commit-ID: 5e43Sc6vPB7
--- a/layout/reftests/selection/reftest.list
+++ b/layout/reftests/selection/reftest.list
@@ -29,22 +29,25 @@ random-if(Android) needs-focus != pseudo
# These tests uses Highlight and HighlightText color keywords, they are not same as text selection color on Mac.
random-if(Android) fails-if(cocoaWidget) needs-focus == non-themed-widget.html non-themed-widget-ref.html
random-if(Android) fails-if(cocoaWidget) needs-focus == themed-widget.html themed-widget-ref.html
== addrange-1.html addrange-ref.html
fuzzy-if(skiaContent,1,1200) == addrange-2.html addrange-ref.html
== splitText-normalize.html splitText-normalize-ref.html
== modify-range.html modify-range-ref.html
== dom-mutations.html dom-mutations-ref.html
-fuzzy-if(OSX==1010,9,1) fuzzy-if(OSX&&skiaContent,6,1) fuzzy-if(skiaContent&&!OSX,1,2138) == trailing-space-1.html trailing-space-1-ref.html
+fuzzy-if(OSX==1010,9,1) fuzzy-if(OSX&&skiaContent,6,1) fuzzy-if(skiaContent&&!OSX,1,2138) fails-if(webrender) == trailing-space-1.html trailing-space-1-ref.html # Bug 1414125
!= invalidation-1-ref.html invalidation-2-ref.html
== invalidation-1a.html invalidation-1-ref.html
== invalidation-1b.html invalidation-1-ref.html
== invalidation-1c.html invalidation-1-ref.html
== invalidation-1d.html invalidation-1-ref.html
== invalidation-1e.html invalidation-1-ref.html
== invalidation-1f.html invalidation-1-ref.html
== invalidation-2a.html invalidation-2-ref.html
== invalidation-2b.html invalidation-2-ref.html
== invalidation-2c.html invalidation-2-ref.html
== invalidation-2d.html invalidation-2-ref.html
== invalidation-2e.html invalidation-2-ref.html
== invalidation-2f.html invalidation-2-ref.html
+fuzzy(7,2) fuzzy-if(OSX,1,1) fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&isDebugBuild&&!browserIsRemote) fails-if(Android) needs-focus == rtl-selection-with-decoration.html rtl-selection-with-decoration-ref.html
+fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&isDebugBuild&&!browserIsRemote) fails-if(Android) needs-focus == semitransparent-decoration-line.html semitransparent-decoration-line-ref.html
+fuzzy-if(OSX,1,6) fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&isDebugBuild&&!browserIsRemote) fails-if(Android) needs-focus == writing-mode.html writing-mode-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/rtl-selection-with-decoration-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>rtl-selection-with-decoration-ref</title>
+ <style>
+ p {
+ font-size: 2em;
+ text-decoration-color: rgba(0, 0, 0, 0.3);
+ }
+ #text1 {
+ text-decoration-line: line-through underline;
+ }
+ #text2 {
+ text-decoration-line: line-through overline;
+ }
+ </style>
+ </head>
+ <body>
+ <p id="text1" lang="he">זוהי עובדה הקורא שדעתו מבוססת של תהיה</p>
+ <p id="text2" lang="he" dir="rtl">זוהי עובדה הקורא שדעתו מבוססת של תהיה</p>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/rtl-selection-with-decoration.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>rtl-selection-with-decoration</title>
+ <style>
+ p {
+ font-size: 2em;
+ text-decoration-color: rgba(0, 0, 0, 0.3);
+ }
+ #text1 {
+ text-decoration-line: line-through underline;
+ }
+ #text2 {
+ text-decoration-line: line-through overline;
+ }
+ ::-moz-selection {
+ background-color: white;
+ color: black;
+ }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ function select() {
+ window.getSelection().removeAllRanges();
+ var elems = document.getElementsByTagName('p');
+ for (var i = 0; i < elems.length; ++i) {
+ var range = document.createRange();
+ range.setStart(elems[i].firstChild, 2);
+ range.setEnd(elems[i].firstChild, 9);
+ window.getSelection().addRange(range);
+ }
+ }
+ </script>
+ </head>
+ <body onload="select()">
+ <p id="text1" lang="he">זוהי עובדה הקורא שדעתו מבוססת של תהיה</p>
+ <p id="text2" lang="he" dir="rtl">זוהי עובדה הקורא שדעתו מבוססת של תהיה</p>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/semitransparent-decoration-line-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>semitransparent-decoration-line-ref</title>
+ <style>
+ .underline {
+ text-decoration: underline rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ .overline {
+ text-decoration: overline rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ .line-through {
+ text-decoration: line-through rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ </style>
+ </head>
+ <body>
+ <p class="underline">Lorem ipsum dolor sit amet</p>
+ <p class="overline">Lorem ipsum dolor sit amet</p>
+ <p class="line-through">Lorem ipsum dolor sit amet</p>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/semitransparent-decoration-line.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>semitransparent-decoration-line</title>
+ <style>
+ .underline {
+ text-decoration: underline rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ .overline {
+ text-decoration: overline rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ .line-through {
+ text-decoration: line-through rgba(0,0,0,0.3);
+ font-size: 2em;
+ }
+ ::-moz-selection {
+ background-color: white;
+ color: black;
+ }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ function select() {
+ window.getSelection().removeAllRanges();
+ var elems = document.getElementsByTagName('p');
+ for (var i = 0; i < elems.length; ++i) {
+ var range = document.createRange();
+ range.setStart(elems[i].firstChild, 2);
+ range.setEnd(elems[i].firstChild, 9);
+ window.getSelection().addRange(range);
+ }
+ }
+ </script>
+ </head>
+ <body onload="select()">
+ <p class="underline">Lorem ipsum dolor sit amet</p>
+ <p class="overline">Lorem ipsum dolor sit amet</p>
+ <p class="line-through">Lorem ipsum dolor sit amet</p>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/writing-mode-ref.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>writing-mode-ref</title>
+ <style>
+ p {
+ display: inline-block;
+ margin: 10px;
+ }
+ .line-through {
+ text-decoration: line-through wavy rgba(0, 0, 0, 0.3);
+ }
+ .wm-vertical-lr {
+ writing-mode: vertical-lr;
+ }
+ .wm-vertical-rl {
+ writing-mode: vertical-rl;
+ }
+ .wm-sideways-lr {
+ writing-mode: sideways-lr;
+ }
+ .wm-sideways-rl {
+ writing-mode: sideways-rl;
+ }
+ </style>
+ </head>
+ <body>
+ <p lang="zh" dir="ltr" class="wm-vertical-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-vertical-rl line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-sideways-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-sideways-rl line-through">你好世界!Hello World!</p>
+ <br/>
+ <p lang="zh" dir="rtl" class="wm-vertical-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-vertical-rl line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-sideways-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-sideways-rl line-through">你好世界!Hello World!</p>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/selection/writing-mode.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>writing-mode</title>
+ <style>
+ p {
+ display: inline-block;
+ margin: 10px;
+ }
+ .line-through {
+ text-decoration: line-through wavy rgba(0, 0, 0, 0.3);
+ }
+ ::-moz-selection {
+ background-color: white;
+ color: black;
+ }
+ .wm-vertical-lr {
+ writing-mode: vertical-lr;
+ display: inline-block;
+ }
+ .wm-vertical-rl {
+ writing-mode: vertical-rl;
+ }
+ .wm-sideways-lr {
+ writing-mode: sideways-lr;
+ }
+ .wm-sideways-rl {
+ writing-mode: sideways-rl;
+ }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ function select() {
+ window.getSelection().removeAllRanges();
+ var elems = document.getElementsByTagName('p');
+ for (var i = 0; i < elems.length; ++i) {
+ var range = document.createRange();
+ range.setStart(elems[i].firstChild, 2);
+ range.setEnd(elems[i].firstChild, 9);
+ window.getSelection().addRange(range);
+ }
+ }
+ </script>
+ </head>
+ <body onload="select()">
+ <p lang="zh" dir="ltr" class="wm-vertical-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-vertical-rl line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-sideways-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="ltr" class="wm-sideways-rl line-through">你好世界!Hello World!</p>
+ <br/>
+ <p lang="zh" dir="rtl" class="wm-vertical-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-vertical-rl line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-sideways-lr line-through">你好世界!Hello World!</p>
+ <p lang="zh" dir="rtl" class="wm-sideways-rl line-through">你好世界!Hello World!</p>
+ </body>
+</html>
--- a/layout/reftests/text-shadow/reftest.list
+++ b/layout/reftests/text-shadow/reftest.list
@@ -8,17 +8,17 @@ random-if(Android) == basic-negcoord.xul
== blur-opacity.html blur-opacity-ref.html
== basic.html basic-ref.html
== basic-negcoord.html basic-negcoord-ref.html
== basic-opacity.html basic-opacity-ref.html
!= blur.html blur-notref.html
== color-inherit.html color-inherit-ref.html
== color-parserorder.html color-parserorder-ref.html
-== decorations-multiple-zorder.html decorations-multiple-zorder-ref.html
+fails-if(webrender) == decorations-multiple-zorder.html decorations-multiple-zorder-ref.html # Bug 1414125
== multiple-noblur.html multiple-noblur-ref.html
== quirks-decor-noblur.html quirks-decor-noblur-ref.html
== standards-decor-noblur.html standards-decor-noblur-ref.html
== padding-decoration.html padding-decoration-ref.html
== textindent.html textindent-ref.html
== lineoverflow.html lineoverflow-ref.html
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref.html