Bug 1375012 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling.
MozReview-Commit-ID: JKK0JqG1y1p
--- a/layout/reftests/bugs/508816-1-ref.xul
+++ b/layout/reftests/bugs/508816-1-ref.xul
@@ -27,14 +27,15 @@ button {
</hbox>
<script type="text/javascript">
<![CDATA[
function load() {
document.getElementById("sb1").scrollIntoView({ behavior: "instant" });
document.getElementById("asb1").scrollIntoView({ behavior: "instant" });
- document.documentElement.removeAttribute("class");
+ window.promiseDocumentFlushed(() => {})
+ .then(() => document.documentElement.removeAttribute("class"));
}
]]>
</script>
</window>
--- a/layout/reftests/bugs/508816-1.xul
+++ b/layout/reftests/bugs/508816-1.xul
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<!DOCTYPE window>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="RTL overflow test" width="640px" height="480px" style="direction: rtl">
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="RTL overflow test" width="640px" height="480px" style="direction: rtl" onload="load()" class="reftest-wait">
<style type="text/css" xmlns="http://www.w3.org/1999/xhtml"><![CDATA[
button {
margin: 0;
}
]]></style>
<hbox style="max-width: 200px; border: 1px solid red;">
@@ -21,9 +21,18 @@ button {
</hbox>
<hbox style="max-width: 200px; border: 1px solid black">
<hbox align="end" pack="end" flex="1">
<button label="test1"/><button label="test2"/><button label="test3"/><button label="test4"/><button label="test5"/>
</hbox>
</hbox>
+<script type="text/javascript">
+ <![CDATA[
+ function load() {
+ window.promiseDocumentFlushed(() => {})
+ .then(() => document.documentElement.removeAttribute("class"));
+ }
+ ]]>
+</script>
+
</window>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1405,17 +1405,17 @@ needs-focus fails == 503531-1.html 50353
fuzzy-if(Android,5,2800) == 506481-1.html 506481-1-ref.html
== 507187-1.html 507187-1-ref.html
== 507487-1.html 507487-1-ref.html
== 507487-2.xhtml 507487-2-ref.xhtml
== 507762-1.html 507762-1-ref.html
== 507762-2.html 507762-2-ref.html
== 507762-3.html 507762-1-ref.html
== 507762-4.html 507762-2-ref.html
-random == 508816-1.xul 508816-1-ref.xul # Bug 1375012
+== 508816-1.xul 508816-1-ref.xul
== 508816-2.html 508816-2-ref.html
skip-if(isDebugBuild) == 508908-1.xul 508908-1-ref.xul
== 508919-1.xhtml 508919-1-ref.xhtml
== 509155-1.xhtml 509155-1-ref.xhtml
fuzzy-if(Android,5,1656) fuzzy-if(skiaContent,1,1200) == 512410.html 512410-ref.html
== 512631-1.html 512631-1-ref.html
== 513153-1a.html 513153-1-ref.html
== 513153-1b.html 513153-1-ref.html
--- a/layout/tools/reftest/manifest.jsm
+++ b/layout/tools/reftest/manifest.jsm
@@ -648,17 +648,18 @@ function CreateUrls(test) {
if (file === null)
return file;
var testURI = g.ioService.newURI(file, null, testbase);
secMan.checkLoadURIWithPrincipal(principal, testURI,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
// Load XUL files from "chrome:" URIs to run them with privileges.
- if (testURI.spec.endsWith(".xul")) {
+ if (testURI.spec.endsWith(".xul") &&
+ testURI.spec.includes("508816-1")) {
let chromeURI = g.ioService.newURI("chrome://reftest-file/content" +
testURI.pathQueryRef);
chromeReg.registerChromeURLOverrideForTest(chromeURI, testURI);
return chromeURI;
}
return testURI;
}