2012-08-17 03:40:11 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
|
2016-04-01 06:55:06 +03:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
|
2012-08-17 03:40:11 +04:00
|
|
|
</head>
|
|
|
|
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
|
|
|
|
<body onload="setTimeout(startTest,0)" style="background:white;">
|
2016-04-18 21:18:44 +03:00
|
|
|
<iframe id="t" style="-moz-transform: scale(0.48979); -moz-transform-origin:top left; width:500px; height:600px;"
|
2017-08-01 11:59:22 +03:00
|
|
|
src="transformed_scrolling_repaints_3_window_frame.html">
|
|
|
|
</iframe>
|
2012-08-17 03:40:11 +04:00
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
2016-04-01 06:55:06 +03:00
|
|
|
var SimpleTest = window.opener.SimpleTest;
|
|
|
|
var SpecialPowers = window.opener.SpecialPowers;
|
|
|
|
var is = window.opener.is;
|
2015-03-03 16:46:35 +03:00
|
|
|
var t, e, utils, iterations;
|
2012-08-17 03:40:11 +04:00
|
|
|
var smoothScrollPref = "general.smoothScroll";
|
|
|
|
|
|
|
|
function startTest() {
|
2015-03-03 16:46:35 +03:00
|
|
|
SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, runTest);
|
|
|
|
}
|
|
|
|
function runTest() {
|
|
|
|
t = document.getElementById("t");
|
|
|
|
e = t.contentDocument.getElementById("e");
|
|
|
|
t.contentWindow.scrollTo(0,0);
|
2016-04-01 06:55:06 +03:00
|
|
|
utils = SpecialPowers.getDOMWindowUtils(window);
|
2015-03-03 16:46:35 +03:00
|
|
|
iterations = 0;
|
2012-08-17 03:40:11 +04:00
|
|
|
|
|
|
|
// Do a couple of scrolls to ensure we've triggered activity heuristics.
|
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
t.contentWindow.scrollByLines(1);
|
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
t.contentWindow.scrollByLines(1);
|
2015-03-03 16:46:35 +03:00
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
// Clear paint state now and scroll again.
|
|
|
|
utils.checkAndClearPaintedState(e);
|
|
|
|
t.contentWindow.scrollByLines(1);
|
|
|
|
waitForAllPaintsFlushed(nextIteration);
|
|
|
|
});
|
2012-08-17 03:40:11 +04:00
|
|
|
});
|
|
|
|
});
|
2015-03-03 16:46:35 +03:00
|
|
|
}
|
|
|
|
function nextIteration() {
|
|
|
|
var painted = utils.checkAndClearPaintedState(e);
|
|
|
|
is(painted, false, "Fully-visible scrolled element should not have been painted");
|
|
|
|
if (++iterations == 10) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
window.close();
|
|
|
|
} else {
|
|
|
|
t.contentWindow.scrollByLines(1);
|
|
|
|
waitForAllPaintsFlushed(nextIteration);
|
|
|
|
}
|
2012-08-17 03:40:11 +04:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|