|
Line 0
a/LayoutTests/compositing/overflow/scrolling-without-painting.html_sec1
|
|
|
1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
<!-- |
| 4 |
This test checks that accelerated scrolling layers can be scrolled without |
| 5 |
repainting their contents. See https://bugs.webkit.org/show_bug.cgi?id=96087. |
| 6 |
--> |
| 7 |
|
| 8 |
<html> |
| 9 |
<head> |
| 10 |
<style type="text/css"> |
| 11 |
#scroller { |
| 12 |
overflow: scroll; |
| 13 |
-webkit-overflow-scrolling: touch; |
| 14 |
width: 200px; |
| 15 |
height: 200px; |
| 16 |
border: solid thin blue; |
| 17 |
} |
| 18 |
|
| 19 |
#content { |
| 20 |
height: 1000px; |
| 21 |
margin-top: 25px; |
| 22 |
} |
| 23 |
</style> |
| 24 |
<script type="text/javascript"> |
| 25 |
window.addEventListener('load', function() { |
| 26 |
if (!window.testRunner || !window.internals) { |
| 27 |
alert('This test requires testRunner to run!'); |
| 28 |
return; |
| 29 |
} |
| 30 |
testRunner.dumpAsText(false); |
| 31 |
|
| 32 |
// First paint the entire view including the scrolling element. |
| 33 |
var scroller = document.getElementById('scroller'); |
| 34 |
scroller.offsetTop; |
| 35 |
|
| 36 |
// Scroll down. This should not cause any more repaints to the |
| 37 |
// scrolling contents. |
| 38 |
window.internals.startTrackingRepaints(document); |
| 39 |
scroller.scrollTop = 25; |
| 40 |
|
| 41 |
var layerTree = document.getElementById('layerTree'); |
| 42 |
layerTree.innerText = |
| 43 |
window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
| 44 |
window.internals.stopTrackingRepaints(document); |
| 45 |
}); |
| 46 |
</script> |
| 47 |
</head> |
| 48 |
<body> |
| 49 |
<div id="scroller"> |
| 50 |
<div id="content"></div> |
| 51 |
</div> |
| 52 |
<pre id="layerTree">This text will be replaced with the layer tree.</pre> |
| 53 |
</body> |
| 54 |
</html> |