Bug 627776: Rewrite reftests for bug 621253 to fix randomorange. r=roc a=tests
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 30 Jan 2011 20:58:18 -0800
changeset 61643 fcc4f82e4d3ca18226565c41e3d91735c9ea9636
parent 61642 9679a78759adf851dc0ad769034f4c97b35ea6db
child 61644 ee7c16ea0e606be5e37a17b5d137270953ff17c1
push idunknown
push userunknown
push dateunknown
reviewersroc, tests
bugs627776, 621253
milestone2.0b11pre
Bug 627776: Rewrite reftests for bug 621253 to fix randomorange. r=roc a=tests
layout/reftests/bugs/621253-1-externalFilter.html
layout/reftests/bugs/621253-1-helper.svg
layout/reftests/bugs/621253-1-internalFilter.html
layout/reftests/bugs/621253-1-ref.html
layout/reftests/bugs/621253-1-ref.xhtml
layout/reftests/bugs/621253-1.xhtml
layout/reftests/bugs/621253-2-externalFilter.html
layout/reftests/bugs/621253-2-internalFilter.html
layout/reftests/bugs/621253-2-ref.html
layout/reftests/bugs/621253-helper-externalFilter.xhtml
layout/reftests/bugs/621253-helper-internalFilter.xhtml
layout/reftests/bugs/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-1-externalFilter.html
@@ -0,0 +1,20 @@
+<html class="reftest-wait"
+      reftest-zoom="0.5">
+<head>
+<script>
+  function doTest() {
+    var iframe = document.getElementsByTagName("iframe")[0];
+    iframe.setAttribute("onload", "snapshot()");
+    iframe.contentWindow.location.reload();
+  }
+
+  function snapshot() {
+    document.documentElement.removeAttribute("class");
+  }
+</script>
+</head>
+<body onload="doTest()" style="margin: 0">
+<iframe src="621253-helper-externalFilter.xhtml"
+	style="border: 0; overflow: hidden"></iframe>
+</body>
+</html>
deleted file mode 100644
--- a/layout/reftests/bugs/621253-1-helper.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<svg xmlns="http://www.w3.org/2000/svg">
-  <filter id="greyscale">
-    <feColorMatrix values="0.5 0.5 0.5 0 0
-                           0.5 0.5 0.5 0 0
-                           0.5 0.5 0.5 0 0
-                           0   0   0   1 0"/>
-  </filter>
-</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-1-internalFilter.html
@@ -0,0 +1,20 @@
+<html class="reftest-wait"
+      reftest-zoom="0.5">
+<head>
+<script>
+  function doTest() {
+    var iframe = document.getElementsByTagName("iframe")[0];
+    iframe.setAttribute("onload", "snapshot()");
+    iframe.contentWindow.location.reload();
+  }
+
+  function snapshot() {
+    document.documentElement.removeAttribute("class");
+  }
+</script>
+</head>
+<body onload="doTest()" style="margin: 0">
+<iframe src="621253-helper-internalFilter.xhtml"
+	style="border: 0; overflow: hidden"></iframe>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-1-ref.html
@@ -0,0 +1,9 @@
+<html>
+<body style="margin: 0">
+  <div style="background: black;
+              width: 25px; height: 25px"></div>
+  <!-- XXXdholbert The above div should actually be 50x50 instead of 25x25, but
+       bug 541270 makes our testcases render smaller than they should. Once
+       that bug is fixed, we need a s/25px/50px/ in this file. -->
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-2-externalFilter.html
@@ -0,0 +1,20 @@
+<html class="reftest-wait"
+      reftest-zoom="1.5">
+<head>
+<script>
+  function doTest() {
+    var iframe = document.getElementsByTagName("iframe")[0];
+    iframe.setAttribute("onload", "snapshot()");
+    iframe.contentWindow.location.reload();
+  }
+
+  function snapshot() {
+    document.documentElement.removeAttribute("class");
+  }
+</script>
+</head>
+<body onload="doTest()" style="margin: 0">
+<iframe src="621253-helper-externalFilter.xhtml"
+	style="border: 0; overflow: hidden"></iframe>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-2-internalFilter.html
@@ -0,0 +1,20 @@
+<html class="reftest-wait"
+      reftest-zoom="1.5">
+<head>
+<script>
+  function doTest() {
+    var iframe = document.getElementsByTagName("iframe")[0];
+    iframe.setAttribute("onload", "snapshot()");
+    iframe.contentWindow.location.reload();
+  }
+
+  function snapshot() {
+    document.documentElement.removeAttribute("class");
+  }
+</script>
+</head>
+<body onload="doTest()" style="margin: 0">
+<iframe src="621253-helper-internalFilter.xhtml"
+	style="border: 0; overflow: hidden"></iframe>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/621253-2-ref.html
@@ -0,0 +1,6 @@
+<html>
+<body style="margin: 0">
+  <div style="background: black;
+              width: 150px; height: 150px"></div>
+</body>
+</html>
rename from layout/reftests/bugs/621253-1.xhtml
rename to layout/reftests/bugs/621253-helper-externalFilter.xhtml
--- a/layout/reftests/bugs/621253-1.xhtml
+++ b/layout/reftests/bugs/621253-helper-externalFilter.xhtml
@@ -1,10 +1,14 @@
 <?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml"
-      reftest-zoom="0.5">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <body style="margin: 0px">
-  <div style="filter: url(621253-1-helper.svg#greyscale);
+  <div style="filter: url(../filters.svg#NonWhiteToBlack);
               background: lime;
               height: 100px; width: 100px">
   </div>
+  <svg xmlns="http://www.w3.org/2000/svg"
+       xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- use an empty g to force filters.svg to load before onload -->
+    <use xlink:href="../filters.svg#empty" />
+  </svg>
 </body>
 </html>
rename from layout/reftests/bugs/621253-1-ref.xhtml
rename to layout/reftests/bugs/621253-helper-internalFilter.xhtml
--- a/layout/reftests/bugs/621253-1-ref.xhtml
+++ b/layout/reftests/bugs/621253-helper-internalFilter.xhtml
@@ -1,20 +1,30 @@
 <?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml"
-     reftest-zoom="0.5">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <body style="margin: 0px">
   <svg xmlns="http://www.w3.org/2000/svg" style="display: block; height: 0px">
     <defs>
-      <filter id="greyscale">
-        <feColorMatrix values="0.5 0.5 0.5 0 0
-                               0.5 0.5 0.5 0 0
-                               0.5 0.5 0.5 0 0
-                               0   0   0   1 0"/>
+      <!-- Copied verbatim from layout/reftests/filters.svg: -->
+      <filter id="NonWhiteToBlack" x="0%" y="0%" width="100%" height="100%">
+        <feComponentTransfer>
+          <feFuncR type="linear" slope="-1" intercept="1" />
+          <feFuncG type="linear" slope="-1" intercept="1" />
+          <feFuncB type="linear" slope="-1" intercept="1" />
+        </feComponentTransfer>
+        <feColorMatrix type="matrix" values="255 255 255 0 0
+                                             255 255 255 0 0
+                                             255 255 255 0 0
+                                             0 0 0 1 0" />
+        <feComponentTransfer>
+          <feFuncR type="linear" slope="-1" intercept="1" />
+          <feFuncG type="linear" slope="-1" intercept="1" />
+          <feFuncB type="linear" slope="-1" intercept="1" />
+        </feComponentTransfer>
       </filter>
     </defs>
   </svg>
-  <div style="filter: url(#greyscale);
+  <div style="filter: url(#NonWhiteToBlack);
               background: lime;
               height: 100px; width: 100px">
   </div>
 </body>
 </html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1563,14 +1563,17 @@ fails-if(!haveTestPlugin) == 599476.html
 == 613433-3.html 613433-2-ref.html
 == 613433-3.html 613433-3-ref.html
 == 614272-1.svg  614272-1-ref.svg
 HTTP(..) == 615121-1.html 615121-1-ref.html
 HTTP(..) != 615121-2.html 615121-2-notref.html
 == 617242-1.html 617242-1-ref.html
 != 618071.html 618071-notref.html
 == 619117-1.html 619117-1-ref.html
-== 621253-1.xhtml 621253-1-ref.xhtml
+HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html # XXX update reference case after bug 541270 is fixed
+== 621253-1-internalFilter.html 621253-1-ref.html # XXX update reference case after bug 541270 is fixed
+HTTP(..) == 621253-2-externalFilter.html 621253-2-ref.html
+== 621253-2-internalFilter.html 621253-2-ref.html
 HTTP(..) == 619511-1.html 619511-1-ref.html
 random-if(winWidget) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
 random-if(winWidget) HTTP(..) == 621918-2.svg 621918-2-ref.svg # same 1px issue as above, and HTTP(..) for filters.svg, used to mask antialiasing issues where glyphs touch
 == 625409-1.html 625409-1-ref.html
 == 627393-1.html about:blank