Backout 61fd66629c4f, 7c8121f8d3af & 2a2e9cf8fd41 (bug 539356), e31a5e6545d3 (bug 761884), 85fa80bd9792, a284ccb25b83, 2865904db9fc, 34e07b09c426, e9b3d41e0360, cef00ebcd6c8, f943b729ac14 & 783f298401b6 (bug 539356), 330a086f1570 (bug 741682), d80219c8842c (bug 739671), e8c96b4fd4da, 313af486e68d, 0adc41ff56dc, 0cd288a38085, f1d43208825c, 4859876972f3, eec8ef3ebe48, f7f29fcd1845, 6079b229d306, f23c3a7e7ce0, 9824458a41e2 & 6748b5496059 (bug 539356) for mochitest-4 orange & talos regressions on multiple platforms
2012-06-11 02:08:32 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
|
|
|
|
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="paint_listener.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
|
|
|
|
<body onload="setTimeout(startTest,0)">
|
|
|
|
<div id="t" style="-moz-transform: scale(1.2, 1.2); -moz-transform-origin:top left; width:200px; height:100px; background:yellow; overflow:hidden">
|
|
|
|
<div style="height:40px;">Hello</div>
|
|
|
|
<div id="e" style="height:30px; background:lime">Kitty</div>
|
|
|
|
<div style="height:300px; background:yellow">Kitty</div>
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
var t = document.getElementById("t");
|
|
|
|
var e = document.getElementById("e");
|
|
|
|
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
|
|
|
getInterface(Components.interfaces.nsIDOMWindowUtils);
|
|
|
|
|
|
|
|
function startTest() {
|
|
|
|
// Do a couple of scrolls to ensure we've triggered activity heuristics.
|
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
t.scrollTop = 5;
|
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
t.scrollTop = 10;
|
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
// Clear paint state now and scroll again.
|
|
|
|
utils.checkAndClearPaintedState(e);
|
2012-07-03 17:21:03 -07:00
|
|
|
t.scrollTop = 33;
|
Backout 61fd66629c4f, 7c8121f8d3af & 2a2e9cf8fd41 (bug 539356), e31a5e6545d3 (bug 761884), 85fa80bd9792, a284ccb25b83, 2865904db9fc, 34e07b09c426, e9b3d41e0360, cef00ebcd6c8, f943b729ac14 & 783f298401b6 (bug 539356), 330a086f1570 (bug 741682), d80219c8842c (bug 739671), e8c96b4fd4da, 313af486e68d, 0adc41ff56dc, 0cd288a38085, f1d43208825c, 4859876972f3, eec8ef3ebe48, f7f29fcd1845, 6079b229d306, f23c3a7e7ce0, 9824458a41e2 & 6748b5496059 (bug 539356) for mochitest-4 orange & talos regressions on multiple platforms
2012-06-11 02:08:32 -07:00
|
|
|
waitForAllPaintsFlushed(function () {
|
|
|
|
var painted = utils.checkAndClearPaintedState(e);
|
|
|
|
is(painted, false, "Fully-visible scrolled element should not have been painted");
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|