Tests for bug 645642, r=dbaron
authorSimon Montagu <smontagu@smontagu.org>
Thu, 07 May 2015 11:25:16 -0700
changeset 274230 a28f0621cf7edb2b1790eea3ba89f0bac51fbfaa
parent 274229 ddab177fd4c4877ce7ff372666558aab25138947
child 274231 956a03448bbe9f217b57dc55c4023e2707189aec
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs645642
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Tests for bug 645642, r=dbaron
layout/reftests/text/reftest.list
layout/reftests/text/text-align-match-parent-01.html
layout/reftests/text/text-align-match-parent-02.html
layout/reftests/text/text-align-match-parent-03.html
layout/reftests/text/text-align-match-parent-04.html
layout/reftests/text/text-align-match-parent-ref.html
layout/reftests/text/text-align-match-parent-root-ltr-ref.html
layout/reftests/text/text-align-match-parent-root-ltr.html
layout/reftests/text/text-align-match-parent-root-rtl-ref.html
layout/reftests/text/text-align-match-parent-root-rtl.html
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -99,16 +99,22 @@ HTTP(..) == synthetic-bold-papyrus-01.ht
 != text-align-center-last-center.html text-align-center-last-justify.html
 != text-align-justify-last-start.html text-align-justify-last-end.html
 != text-align-justify-last-start.html text-align-justify-last-center.html
 != text-align-justify-last-start.html text-align-justify-last-justify.html
 != text-align-justify-last-end.html text-align-justify-last-center.html
 != text-align-justify-last-end.html text-align-justify-last-justify.html
 != text-align-justify-last-center.html text-align-justify-last-justify.html
 == text-align-left-in-rtl-block.html text-align-left-in-rtl-block-ref.html
+== text-align-match-parent-01.html text-align-match-parent-ref.html
+== text-align-match-parent-02.html text-align-match-parent-ref.html
+== text-align-match-parent-03.html text-align-match-parent-ref.html
+== text-align-match-parent-04.html text-align-match-parent-ref.html
+== text-align-match-parent-root-ltr.html text-align-match-parent-root-ltr-ref.html
+== text-align-match-parent-root-rtl.html text-align-match-parent-root-rtl-ref.html
 HTTP(..) == variation-selector-unsupported-1.html variation-selector-unsupported-1-ref.html
 == white-space-1a.html white-space-1-ref.html
 == white-space-1b.html white-space-1-ref.html
 == white-space-2.html white-space-2-ref.html
 == wordbreak-1.html wordbreak-1-ref.html
 == wordbreak-2.html wordbreak-2-ref.html
 == wordbreak-3.html wordbreak-3-ref.html
 skip-if((Android&&AndroidVersion!=15)||(B2G&&browserIsRemote)) == wordbreak-4a.html wordbreak-4a-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-01.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+div.start  { text-align: start; }
+div.end    { text-align: end; }
+div.left   { text-align: left; }
+div.right  { text-align: right; }
+div > div  { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+   <div class="start" dir="ltr"><div dir="ltr">Left</div></div>
+   <div class="start" dir="ltr"><div dir="rtl">Left</div></div>
+   <div class="start" dir="rtl"><div dir="ltr">Right</div></div>
+   <div class="start" dir="rtl"><div dir="rtl">Right</div></div>
+   <div class="end" dir="ltr"><div dir="ltr">Right</div></div>
+   <div class="end" dir="ltr"><div dir="rtl">Right</div></div>
+   <div class="end" dir="rtl"><div dir="ltr">Left</div></div>
+   <div class="end" dir="rtl"><div dir="rtl">Left</div></div>
+   <div class="left" dir="ltr"><div dir="ltr">Left</div></div>
+   <div class="left" dir="ltr"><div dir="rtl">Left</div></div>
+   <div class="left" dir="rtl"><div dir="ltr">Left</div></div>
+   <div class="left" dir="rtl"><div dir="rtl">Left</div></div>
+   <div class="right" dir="ltr"><div dir="ltr">Right</div></div>
+   <div class="right" dir="ltr"><div dir="rtl">Right</div></div>
+   <div class="right" dir="rtl"><div dir="ltr">Right</div></div>
+   <div class="right" dir="rtl"><div dir="rtl">Right</div></div>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-02.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+div.start  { text-align: start; }
+div.end    { text-align: end; }
+div.left   { text-align: left; }
+div.right  { text-align: right; }
+div > div  { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+   <div id="d0" class="start" dir="rtl"><div dir="ltr">Left</div></div>
+   <div id="d1" class="start" dir="rtl"><div dir="rtl">Left</div></div>
+   <div id="d2" class="start" dir="ltr"><div dir="ltr">Right</div></div>
+   <div id="d3" class="start" dir="ltr"><div dir="rtl">Right</div></div>
+   <div id="d4" class="end" dir="rtl"><div dir="ltr">Right</div></div>
+   <div id="d5" class="end" dir="rtl"><div dir="rtl">Right</div></div>
+   <div id="d6" class="end" dir="ltr"><div dir="ltr">Left</div></div>
+   <div id="d7" class="end" dir="ltr"><div dir="rtl">Left</div></div>
+   <div id="d8" class="left" dir="rtl"><div dir="ltr">Left</div></div>
+   <div id="d9" class="left" dir="rtl"><div dir="rtl">Left</div></div>
+   <div id="d10" class="left" dir="ltr"><div dir="ltr">Left</div></div>
+   <div id="d11" class="left" dir="ltr"><div dir="rtl">Left</div></div>
+   <div id="d12" class="right" dir="rtl"><div dir="ltr">Right</div></div>
+   <div id="d13" class="right" dir="rtl"><div dir="rtl">Right</div></div>
+   <div id="d14" class="right" dir="ltr"><div dir="ltr">Right</div></div>
+   <div id="d15" class="right" dir="ltr"><div dir="rtl">Right</div></div>
+
+   <script type="text/javascript">
+function changeParentDir()
+{
+  for (parent = 0; parent < 16; ++parent) {
+     var parentDiv = document.getElementById("d" + parent);
+     if (parentDiv.dir == "rtl") {
+       parentDiv.dir = "ltr";
+     } else {
+       parentDiv.dir = "rtl";
+     }
+   }
+
+  document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", changeParentDir, false);
+   </script>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-03.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+div.start  { text-align: start; }
+div.end    { text-align: end; }
+div.left   { text-align: left; }
+div.right  { text-align: right; }
+div.center { text-align: center; }
+div.match  { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+   <div class="start" dir="ltr"><div id="d0" class="center" dir="ltr">Left</div></div>
+   <div class="start" dir="ltr"><div id="d1" class="center" dir="rtl">Left</div></div>
+   <div class="start" dir="rtl"><div id="d2" class="center" dir="ltr">Right</div></div>
+   <div class="start" dir="rtl"><div id="d3" class="center" dir="rtl">Right</div></div>
+   <div class="end" dir="ltr"><div id="d4" class="center" dir="ltr">Right</div></div>
+   <div class="end" dir="ltr"><div id="d5" class="center" dir="rtl">Right</div></div>
+   <div class="end" dir="rtl"><div id="d6" class="center" dir="ltr">Left</div></div>
+   <div class="end" dir="rtl"><div id="d7" class="center" dir="rtl">Left</div></div>
+   <div class="left" dir="ltr"><div id="d8" class="center" dir="ltr">Left</div></div>
+   <div class="left" dir="ltr"><div id="d9" class="center" dir="rtl">Left</div></div>
+   <div class="left" dir="rtl"><div id="d10" class="center" dir="ltr">Left</div></div>
+   <div class="left" dir="rtl"><div id="d11" class="center" dir="rtl">Left</div></div>
+   <div class="right" dir="ltr"><div id="d12" class="center" dir="ltr">Right</div></div>
+   <div class="right" dir="ltr"><div id="d13" class="center" dir="rtl">Right</div></div>
+   <div class="right" dir="rtl"><div id="d14" class="center" dir="ltr">Right</div></div>
+   <div class="right" dir="rtl"><div id="d15" class="center" dir="rtl">Right</div></div>
+
+   <script type="text/javascript">
+function changeChildAlign()
+{
+  for (child = 0; child < 16; ++child) {
+     var childDiv = document.getElementById("d" + child);
+     childDiv.className = "match";
+   }
+
+  document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", changeChildAlign, false);
+   </script>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-04.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+div.start  { text-align: start; }
+div.end    { text-align: end; }
+div.left   { text-align: left; }
+div.right  { text-align: right; }
+div > div  { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+   <div id="d0" style="width: 50%;" class="start" dir="ltr"><div dir="ltr">Left</div></div>
+   <div id="d1" style="width: 50%;" class="start" dir="ltr"><div dir="rtl">Left</div></div>
+   <div id="d2" style="width: 50%;" class="start" dir="rtl"><div dir="ltr">Right</div></div>
+   <div id="d3" style="width: 50%;" class="start" dir="rtl"><div dir="rtl">Right</div></div>
+   <div id="d4" style="width: 50%;" class="end" dir="ltr"><div dir="ltr">Right</div></div>
+   <div id="d5" style="width: 50%;" class="end" dir="ltr"><div dir="rtl">Right</div></div>
+   <div id="d6" style="width: 50%;" class="end" dir="rtl"><div dir="ltr">Left</div></div>
+   <div id="d7" style="width: 50%;" class="end" dir="rtl"><div dir="rtl">Left</div></div>
+   <div id="d8" style="width: 50%;" class="left" dir="ltr"><div dir="ltr">Left</div></div>
+   <div id="d9" style="width: 50%;" class="left" dir="ltr"><div dir="rtl">Left</div></div>
+   <div id="d10" style="width: 50%;" class="left" dir="rtl"><div dir="ltr">Left</div></div>
+   <div id="d11" style="width: 50%;" class="left" dir="rtl"><div dir="rtl">Left</div></div>
+   <div id="d12" style="width: 50%;" class="right" dir="ltr"><div dir="ltr">Right</div></div>
+   <div id="d13" style="width: 50%;" class="right" dir="ltr"><div dir="rtl">Right</div></div>
+   <div id="d14" style="width: 50%;" class="right" dir="rtl"><div dir="ltr">Right</div></div>
+   <div id="d15" style="width: 50%;" class="right" dir="rtl"><div dir="rtl">Right</div></div>
+
+   <script type="text/javascript">
+function changeParentWidth()
+{
+  for (parent = 0; parent < 16; ++parent) {
+     var parentDiv = document.getElementById("d" + parent);
+     parentDiv.style.width = "";
+   }
+
+  document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", changeParentWidth, false);
+   </script>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+div.start  { text-align: start; }
+div.end    { text-align: end; }
+div.left   { text-align: left; }
+div.right  { text-align: right; }
+    </style>
+  </head>
+  <body>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="left">Left</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+   <div class="right">Right</div>
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-root-ltr-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+html { text-align: start; }
+    </style>
+  </head>
+  <body>
+    Root element ltr
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-root-ltr.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+html { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+    Root element ltr
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-root-rtl-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html dir="rtl">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+html { text-align: start; }
+    </style>
+  </head>
+  <body>
+    Root element rtl
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text/text-align-match-parent-root-rtl.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html dir="rtl">
+  <head>
+    <meta charset="utf-8">
+    <title>Text-align: match-parent</title>
+    <style>
+html { text-align: match-parent; }
+    </style>
+  </head>
+  <body>
+    Root element rtl
+  </body>
+</html>