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/overflow/resources/automatically-opt-into-composited-scrolling.js

Issue 14863002: Only update composited-scrolling state once after layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updating expectations. Created 7 years, 6 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 var debugMode = false; 1 var debugMode = false;
2 2
3 if (window.testRunner) 3 if (window.testRunner)
4 testRunner.dumpAsText(); 4 testRunner.dumpAsText();
5 5
6 function write(str) 6 function write(str)
7 { 7 {
8 var pre = document.getElementById('console'); 8 var pre = document.getElementById('console');
9 var text = document.createTextNode(str + '\n'); 9 var text = document.createTextNode(str + '\n');
10 pre.appendChild(text); 10 pre.appendChild(text);
11 } 11 }
12 12
13 function didOptIn(element) 13 function didOptIn(element)
14 { 14 {
15 // Force a synchronous style recalc and layout. 15 // Force a synchronous style recalc and layout.
16 document.body.style.overflow = 'scroll';
17 document.body.offsetTop;
18 document.body.style.overflow = '';
16 document.body.offsetTop; 19 document.body.offsetTop;
17 20
18 var nonFastScrollableRects = window.internals.nonFastScrollableRects(document) ; 21 var nonFastScrollableRects = window.internals.nonFastScrollableRects(document) ;
19 var elementBoundingBox = window.internals.boundingBox(element); 22 var elementBoundingBox = window.internals.boundingBox(element);
20 23
21 for (var i = 0; i < nonFastScrollableRects.length; ++i) { 24 for (var i = 0; i < nonFastScrollableRects.length; ++i) {
22 var rect = nonFastScrollableRects[i]; 25 var rect = nonFastScrollableRects[i];
23 26
24 if (rect.top === elementBoundingBox.top && rect.left === elementBoundingBox. left && 27 if (rect.top === elementBoundingBox.top && rect.left === elementBoundingBox. left &&
25 rect.bottom === elementBoundingBox.bottom && rect.right === elementBound ingBox.right) 28 rect.bottom === elementBoundingBox.bottom && rect.right === elementBound ingBox.right)
26 return false; 29 return false;
27 } 30 }
28 31
29 return true; 32 return true;
30 } 33 }
31 34
32 function getStackingOrder(element) 35 function getStackingOrder(element)
33 { 36 {
34 var divElements = []; 37 var divElements = [];
35 // Force a synchronous style recalc and layout. 38 // Force a synchronous style recalc and layout.
39 document.body.style.overflow = 'scroll';
40 document.body.offsetTop;
41 document.body.style.overflow = '';
36 document.body.offsetTop; 42 document.body.offsetTop;
37 43
38 var stackingOrder = window.internals.nodesFromRect(document, 100, 75, 200, 200 , 200, 200, false, false, false); 44 var stackingOrder = window.internals.nodesFromRect(document, 100, 75, 200, 200 , 200, 200, false, false, false);
39 45
40 for (var i = 0; i < stackingOrder.length; ++i) 46 for (var i = 0; i < stackingOrder.length; ++i)
41 if (stackingOrder[i].nodeName === "DIV") 47 if (stackingOrder[i].nodeName === "DIV")
42 divElements.push(stackingOrder[i]); 48 divElements.push(stackingOrder[i]);
43 49
44 return divElements; 50 return divElements;
45 } 51 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 containerIndices.splice(containerSubindex, 1); 189 containerIndices.splice(containerSubindex, 1);
184 var firstChildIndex = containerIndices[0]; 190 var firstChildIndex = containerIndices[0];
185 var secondChildIndex = containerIndices[1]; 191 var secondChildIndex = containerIndices[1];
186 192
187 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 1); 193 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 1);
188 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 2); 194 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 2);
189 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 3); 195 permuteWithFixedOrdering(testPermutation, siblingIndex, containerIndex, fi rstChildIndex, secondChildIndex, 3);
190 } 196 }
191 } 197 }
192 } // function doTest 198 } // function doTest
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698