Skip to content

Commit

Permalink
Add workaround for Chrome not painting images (#248)
Browse files Browse the repository at this point in the history
See <jugglinmike/chrome-screenshot-race#1>.

This appears to avoid it from happening, and guarantees we've painted
after the load event and (potentially) reftest-wait being removed.

r=jgraham
  • Loading branch information
gsnedders authored Apr 5, 2017
1 parent ee2e0ce commit bea0e99
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion wptrunner/executors/reftest-wait_webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ var callback = arguments[arguments.length - 1];
function test(x) {
if (!root.classList.contains("reftest-wait")) {
observer.disconnect();
callback()

// As of 2017-04-05, the Chromium web browser exhibits a rendering bug
// (https://bugs.chromium.org/p/chromium/issues/detail?id=708757) that
// produces instability during screen capture. The following use of
// `requestAnimationFrame` is intended as a short-term workaround, though
// it is not guaranteed to resolve the issue.
//
// For further detail, see:
// https://github.com/jugglinmike/chrome-screenshot-race/issues/1

requestAnimationFrame(function() {
requestAnimationFrame(function() {
callback();
});
});
}
}

Expand Down

0 comments on commit bea0e99

Please sign in to comment.