Bug 1313772 - Part 2: Use non-standard MozReftestInvalidate event to avoid test failure when paint delay is reduced. r=dholbert, a=test-only
authorNeerja Pancholi <npancholi@mozilla.com>
Wed, 15 Feb 2017 12:35:50 -0800
changeset 378546 68bc73ce87e41683089d1b293ffc94dbc34c9b81
parent 378545 7351f4e27c493e488d4e233a323ad1a1a49df598
child 378547 b7330550559f2f93fe378eaf3b8d0ae354e20538
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, test-only
bugs1313772
milestone53.0a2
Bug 1313772 - Part 2: Use non-standard MozReftestInvalidate event to avoid test failure when paint delay is reduced. r=dholbert, a=test-only MozReview-Commit-ID: 7dnnFORXB0H
layout/reftests/bugs/1313772.xhtml
--- 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>