Bug 1295466 - Use MozReftestInvalidate event in box-sizing-replaced-001.xht to avoid test failure when paint delay is reduced r=mstange
authorNeerja Pancholi <npancholi@mozilla.com>
Mon, 07 Nov 2016 16:32:48 -0800
changeset 351882 358036b9cda869e57f9f1cd30e4a587cd9086244
parent 351881 69fd9d1c09c53dd20dfd3db56b5508c6a68b4646
child 351883 05db990f8787e761f12418ec2da0f7d4a7cc04fe
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1295466
milestone52.0a1
Bug 1295466 - Use MozReftestInvalidate event in box-sizing-replaced-001.xht to avoid test failure when paint delay is reduced r=mstange MozReview-Commit-ID: IXK2WwM3mrH
layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-001.xht
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-001.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-001.xht
@@ -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-001-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 around each." />
@@ -126,16 +126,27 @@
       }
 
       #img19 {
         max-width:  85px;
         min-height: 85px;
       }
     </style>
   </head>
+  <script>
+  /* this test shouldn't need reftest-wait, but if the reftest snapshot is triggered before we've painted,
+   * for img5 the right 1/3rd of the element simply isn't painted.
+   * See Bug 1283302
+   */
+  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-padding" src="support/replaced-min-max.png" alt="FAIL" title="Test 0"></img></p>
     <p><img id="img1" class="with-padding" title="Test 1" alt="FAIL" src="support/replaced-min-max-1.png"></img></p>
     <p><img id="img2" class="with-padding" title="Test 2" alt="FAIL" src="support/replaced-min-max-2.png"></img></p>
     <p><img id="img3" class="with-padding" title="Test 3" alt="FAIL" src="support/replaced-min-max-3.png"></img></p>
     <p><img id="img4" class="with-padding" title="Test 4" alt="FAIL" src="support/replaced-min-max-4.png"></img></p>
     <p><img id="img5" class="with-padding" title="Test 5" alt="FAIL" src="support/replaced-min-max-5.png"></img></p>