Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: LayoutTests/compositing/overflow/scrolling-without-painting.html

Issue 408843004: Convert more tests into text-based-repaint tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <!-- 3 <!--
4 This test checks that accelerated scrolling layers can be scrolled without 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. 5 repainting their contents. See https://bugs.webkit.org/show_bug.cgi?id=96087.
6 --> 6 -->
7 7
8 <html> 8 <html>
9 <head> 9 <head>
10 <style type="text/css"> 10 <style type="text/css">
11 #scroller { 11 #scroller {
12 overflow: scroll; 12 overflow: scroll;
13 -webkit-overflow-scrolling: touch; 13 -webkit-overflow-scrolling: touch;
14 width: 200px; 14 width: 200px;
15 height: 200px; 15 height: 200px;
16 border: solid thin blue; 16 border: solid thin blue;
17 } 17 }
18 18
19 #content { 19 #content {
20 height: 1000px; 20 height: 1000px;
21 margin-top: 25px; 21 margin-top: 25px;
22 } 22 }
23 </style> 23 </style>
24 <script src="../../fast/repaint/resources/text-based-repaint.js"></script>
24 <script type="text/javascript"> 25 <script type="text/javascript">
25 if (window.internals) 26 if (window.internals)
26 window.internals.settings.setAcceleratedCompositingForOverflowScrollEn abled(true); 27 window.internals.settings.setAcceleratedCompositingForOverflowScrollEn abled(true);
27 28
28 window.addEventListener('load', function() { 29 function repaintTest() {
29 if (!window.testRunner || !window.internals) {
30 alert('This test requires testRunner to run!');
31 return;
32 }
33 testRunner.dumpAsText();
34
35 // First paint the entire view including the scrolling element.
36 var scroller = document.getElementById('scroller');
37 scroller.offsetTop;
38
39 // Scroll down. This should not cause any more repaints to the 30 // Scroll down. This should not cause any more repaints to the
40 // scrolling contents. 31 // scrolling contents.
41 window.internals.startTrackingRepaints(document); 32 document.getElementById('scroller').scrollTop = 25;
42 scroller.scrollTop = 25; 33 }
43 34
44 var layerTree = document.getElementById('layerTree'); 35 runRepaintTest();
45 layerTree.innerText =
46 window.internals.layerTreeAsText(document, internals.LAYER_TREE_IN CLUDES_REPAINT_RECTS);
47 window.internals.stopTrackingRepaints(document);
48 });
49 </script> 36 </script>
50 </head> 37 </head>
51 <body> 38 <body>
52 <div id="scroller"> 39 <div id="scroller">
53 <div id="content"></div> 40 <div id="content"></div>
54 </div> 41 </div>
55 <pre id="layerTree">This text will be replaced with the layer tree.</pre>
56 </body> 42 </body>
57 </html> 43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698