mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
1d9e644eb7
--HG-- extra : transplant_source : n%F7%0D%20J%D9%DF%CBY%60J0%09%F2%02h2%DC%C6%E7
58 lines
1.9 KiB
HTML
58 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<head>
|
|
<title>Test for bugs 807728 and 810426</title>
|
|
<script>
|
|
function start()
|
|
{
|
|
document.removeEventListener("MozReftestInvalidate", start, false);
|
|
|
|
var plugin = document.getElementById("plugin");
|
|
var color = "FF000000";
|
|
var color_count = 0;
|
|
var last_paint_count = 0;
|
|
// Enough paints to test reusing a surface after it has been
|
|
// moved from front to back buffer.
|
|
var final_paint_count = window.mozPaintCount + 10;
|
|
var final_color = "FFFF0000";
|
|
|
|
// Using mozPaintCount to track when content has been updated as an
|
|
// indication that the browser has received updates, instead of
|
|
// plugin.getPaintCount() which tracks when the plugin sends updates or
|
|
// MozAfterPaint events which track OS paints. Not using
|
|
// MozPaintWaitFinished because invalidation causes no geometry changes.
|
|
function wait_for_paints() {
|
|
var paint_count = window.mozPaintCount;
|
|
if (paint_count >= final_paint_count && color == final_color) {
|
|
document.documentElement.removeAttribute("class");
|
|
return;
|
|
}
|
|
if (paint_count != last_paint_count) {
|
|
last_paint_count = paint_count;
|
|
if (paint_count + 1 >= final_paint_count) {
|
|
color = final_color;
|
|
// Wait for the paint with the final color
|
|
final_paint_count = paint_count + 1;
|
|
} else {
|
|
++color_count;
|
|
color = "FF00000" + color_count;
|
|
}
|
|
plugin.setColor(color);
|
|
}
|
|
setTimeout(wait_for_paints, 0);
|
|
}
|
|
|
|
wait_for_paints();
|
|
}
|
|
|
|
// MozReftestInvalidate is delivered after initial painting has settled.
|
|
document.addEventListener("MozReftestInvalidate", start, false);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<embed id="plugin" type="application/x-test"
|
|
drawmode="solid" color="FF000000" width="30" height="50">
|
|
</embed>
|
|
</body>
|
|
</html>
|