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

Side by Side Diff: LayoutTests/compositing/squashing/squash-above-fixed-1.html

Issue 191693002: Delay scrollContents until the next paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix nit Created 6 years, 9 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 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/run-after-display.js"></script>
4 <style> 5 <style>
5 .composited { 6 .composited {
6 -webkit-transform: translatez(0); 7 -webkit-transform: translatez(0);
7 } 8 }
8 9
9 .background { 10 .background {
10 position: fixed; 11 position: fixed;
11 background-color: lightgray; 12 background-color: lightgray;
12 width: 300px; 13 width: 300px;
13 height: 300px; 14 height: 300px;
(...skipping 26 matching lines...) Expand all
40 #testResults { 41 #testResults {
41 display: none; 42 display: none;
42 } 43 }
43 44
44 body { 45 body {
45 margin: 0px; 46 margin: 0px;
46 } 47 }
47 </style> 48 </style>
48 49
49 <script> 50 <script>
50 if (window.testRunner) 51 if (window.testRunner) {
52 testRunner.waitUntilDone();
51 testRunner.dumpAsText(); 53 testRunner.dumpAsText();
54 }
52 55
53 if (window.internals) { 56 if (window.internals) {
54 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true ); 57 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true );
55 internals.settings.setLayerSquashingEnabled(true); 58 internals.settings.setLayerSquashingEnabled(true);
56 } 59 }
57 60
58 function runTest() 61 function runTest()
59 { 62 {
60 if (!window.internals) 63 if (!window.internals)
61 return; 64 return;
62 65
63 // Case 1 66 (function() {
64 document.getElementById('Case1').textContent = window.internals.layerTre eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
65 67
66 // Case 2 68 return new Promise(function(resolve) {
67 window.internals.startTrackingRepaints(document); 69 // Case 1
68 window.scrollTo(0, 80); 70 document.getElementById('Case1').textContent = window.internals.la yerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
69 document.getElementById('Case2').textContent = window.internals.layerTre eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
70 window.internals.stopTrackingRepaints(document);
71 71
72 // Case 3 72 resolve();
73 window.internals.startTrackingRepaints(document); 73 });
74 window.scrollTo(0, 120);
75 document.getElementById('Case3').textContent = window.internals.layerTre eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
76 window.internals.stopTrackingRepaints(document);
77 74
78 // Case 4 75 })().then(function() {
79 window.internals.startTrackingRepaints(document);
80 window.scrollTo(0, 170);
81 document.getElementById('Case4').textContent = window.internals.layerTre eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
82 window.internals.stopTrackingRepaints(document);
83 76
84 // Display the test results only after test is done so that it does not affect repaint rect results. 77 return new Promise(function(resolve) {
85 document.getElementById('testResults').style.display = "block"; 78
79 // Case 2
80 window.internals.startTrackingRepaints(document);
81 window.scrollTo(0, 80);
82 runAfterDisplay(function() {
83 document.getElementById('Case2').textContent = window.intern als.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
84 window.internals.stopTrackingRepaints(document);
85
86 resolve();
87 });
88
89 });
90
91 }).then(function() {
92
93 return new Promise(function(resolve) {
94
95 // Case 3
96 window.internals.startTrackingRepaints(document);
97 window.scrollTo(0, 120);
98 runAfterDisplay(function() {
99 document.getElementById('Case3').textContent = window.intern als.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
100 window.internals.stopTrackingRepaints(document);
101
102 resolve();
103 });
104
105 });
106
107 }).then(function() {
108
109 return new Promise(function(resolve) {
110
111 // Case 4
112 window.internals.startTrackingRepaints(document);
113 window.scrollTo(0, 170);
114 runAfterDisplay(function() {
115 document.getElementById('Case4').textContent = window.intern als.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
116 window.internals.stopTrackingRepaints(document);
117
118 resolve();
119 });
120
121 });
122
123 }).then(function() {
124
125 // Display the test results only after test is done so that it does no t affect repaint rect results.
126 document.getElementById('testResults').style.display = "block";
127
128 if (window.testRunner)
129 testRunner.notifyDone();
130
131 }).catch(function(e) {
132
133 console.error(e);
134
135 });
86 } 136 }
87 </script> 137 </script>
88 </head> 138 </head>
89 139
90 <body onload="runTest()"> 140 <body onload="runTest()">
91 141
92 <div id="description"> 142 <div id="description">
93 <p>The gray div is a composited fixed-position element, and the cyan/lime 143 <p>The gray div is a composited fixed-position element, and the cyan/lime
94 elements should be squashed together on top. When scrolling, paragraphs may 144 elements should be squashed together on top. When scrolling, paragraphs may
95 pop in-and-out of the squashing layer when they change overlapping status 145 pop in-and-out of the squashing layer when they change overlapping status
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 CASE 3, scrolling y to 120, no repaints expected: 178 CASE 3, scrolling y to 120, no repaints expected:
129 <pre id="Case3"></pre> 179 <pre id="Case3"></pre>
130 180
131 CASE 4, scrolling y to 170 new layers will be squashed, so things repaint: 181 CASE 4, scrolling y to 170 new layers will be squashed, so things repaint:
132 <pre id="Case4"></pre> 182 <pre id="Case4"></pre>
133 </div> 183 </div>
134 184
135 </body> 185 </body>
136 186
137 </html> 187 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698