mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852413 - Wait even more for painting to finish before forcing a paint. r=mattwoodrow
--HG-- extra : rebase_source : 8a0513da9cea80677b1d4739fad429044a24255d
This commit is contained in:
parent
94ec89296d
commit
90723b2fd7
@ -19,26 +19,37 @@ SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var image = document.getElementById("image");
|
||||
var lastPaintCount;
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
|
||||
function changeImage() {
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
utils.checkAndClearPaintedState(image);
|
||||
|
||||
image.src = "./image_rrgg-256x256.png";
|
||||
image.onload = function() {
|
||||
lastPaintCount = window.mozPaintCount;
|
||||
document.body.style.background = "black";
|
||||
checkDone();
|
||||
checkDonePainting();
|
||||
}
|
||||
}
|
||||
|
||||
// Wait until we've painted after the image loads, then force a paint and make
|
||||
// sure the image doesn't get drawn.
|
||||
function checkDonePainting() {
|
||||
if (window.mozPaintCount == lastPaintCount || utils.isMozAfterPaintPending) {
|
||||
setTimeout(checkDonePainting, 30);
|
||||
return;
|
||||
}
|
||||
|
||||
lastPaintCount = window.mozPaintCount;
|
||||
document.body.style.background = "black";
|
||||
checkDone();
|
||||
}
|
||||
|
||||
function checkDone() {
|
||||
if (window.mozPaintCount == lastPaintCount) {
|
||||
if (window.mozPaintCount == lastPaintCount || utils.isMozAfterPaintPending) {
|
||||
setTimeout(checkDone, 30);
|
||||
return;
|
||||
}
|
||||
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
ok(!utils.checkAndClearPaintedState(image), "Should not paint any thebes layers for our image!");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user