Bug 1313772 - Part2:Use non-standard MozReftestInvalidate event to avoid test failure when paint delay is reduced. r?dholbert
MozReview-Commit-ID: 7dnnFORXB0H
--- a/layout/reftests/bugs/1313772.xhtml
+++ b/layout/reftests/bugs/1313772.xhtml
@@ -1,10 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
<link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
<link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
<link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
<link rel="match" href="box-sizing-replaced-002-ref.xht" />
<meta content="image" name="flags"></meta>
<meta name="assert" content="All images should be sized at 75px x 75px, with 5px of padding and 5px of blue border around each." />
@@ -127,16 +127,32 @@
}
#img19 {
max-width: 95px;
min-height: 95px;
}
</style>
</head>
+ <script>
+ /* This test is a copy of the original w3c-submitted test at
+ * w3c-css/submitted/ui3/box-sizing-replaced-002.xht.
+ * We need this copy so that we can use non-standard MozReftestInvalidate here
+ * without hindering the w3c testsuite.
+ * Without MozReftestInvalidate, for img3 the right half of the element
+ * simply isn't painted.
+ * This copy can be removed (along with the fuzzy annotation in the original
+ * test) when we've fixed the underlying issue i.e. Bug 1316772.
+ */
+ window.addEventListener("MozReftestInvalidate", endTest);
+
+ function endTest() {
+ document.documentElement.removeAttribute("class");
+ }
+ </script>
<body>
<div>All rectangles should be the same size.</div>
<p><img id="img0" class="with-borderpadding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
<p><img id="img1" class="with-borderpadding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
<p><img id="img2" class="with-borderpadding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
<p><img id="img3" class="with-borderpadding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
<p><img id="img4" class="with-borderpadding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
<p><img id="img5" class="with-borderpadding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>