Bug 1363805 - Part 4: Fix tests that need style flushing. r?heycam
Some properties will not trigger style flushing if there is no dirty ancestor.
Instead, use a property which needs layout flushing will do the trick.
MozReview-Commit-ID: C2lRjl5t3ry
--- a/layout/style/test/test_font_loading_api.html
+++ b/layout/style/test/test_font_loading_api.html
@@ -158,17 +158,17 @@ function awaitRefresh() {
requestAnimationFrame(aResolve);
});
}
return awaitOneRefresh().then(awaitOneRefresh);
}
function flushStyles() {
- getComputedStyle(document.body).color;
+ getComputedStyle(document.body).width;
}
function runTest() {
// Document and window from inside the display:none iframe.
var nframe = document.getElementById("n");
var ndocument = nframe.contentDocument;
var nwindow = nframe.contentWindow;
--- a/layout/style/test/test_transitions.html
+++ b/layout/style/test/test_transitions.html
@@ -360,17 +360,17 @@ after_test = make_pseudo_elem_test("afte
var pseudo_element_tests = [ before_test, after_test ];
// FIXME (Bug 522599): Test a transition that reverses partway through.
var lateref = make_reference_p();
var laterefcs = getComputedStyle(lateref, "");
// flush style changes
-var x = getComputedStyle(div, "").color;
+var x = getComputedStyle(div, "").width;
// Start our timer as close as possible to when we start the first
// transition.
// Do not use setInterval because once it gets off in time, it stays off.
for (var i = 1; i <= 8; ++i) {
setTimeout(process_future_calls, i * 1000, i);
}
gStartTime1 = Date.now(); // set before any transitions have started
@@ -411,17 +411,17 @@ to_none_test.style.display = "none";
always_none_test.style.textIndent = "100px";
for (var i in pseudo_element_tests) {
var test = pseudo_element_tests[i];
test.element.classList.add("started");
}
lateref.style.textIndent = "1000px";
// flush style changes
-x = getComputedStyle(div, "").color;
+x = getComputedStyle(div, "").width;
gStartTime2 = Date.now(); // set after all transitions have started
gCurrentTime = gStartTime2;
/**
* Assert that a transition whose timing function yields the bezier
* |func|, running from |start_time| to |end_time| (both in seconds
* relative to when the transitions were started) should have produced