OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="resources/composited-scroll.js"></script> |
2 <style> | 3 <style> |
3 #scroller { | 4 #scroller { |
4 overflow: scroll; | 5 overflow: scroll; |
5 height: 300px; | 6 height: 300px; |
6 width: 300px; | 7 width: 300px; |
7 background-color: red; | 8 background-color: red; |
8 } | 9 } |
9 | 10 |
10 #outer { | 11 #outer { |
11 height: 800px; | 12 height: 800px; |
(...skipping 16 matching lines...) Expand all Loading... |
28 left: 100px; | 29 left: 100px; |
29 } | 30 } |
30 </style> | 31 </style> |
31 <div id="outer"> | 32 <div id="outer"> |
32 <div id="scroller"> | 33 <div id="scroller"> |
33 <div id="scrolled"></div> | 34 <div id="scrolled"></div> |
34 <div id="fixed"></div> | 35 <div id="fixed"></div> |
35 </div> | 36 </div> |
36 </div> | 37 </div> |
37 <script> | 38 <script> |
38 function isUsingCompositedScrolling(layer) { | |
39 if (layer.bounds[1] == 1000) | |
40 return true; | |
41 if (layer.children) { | |
42 for (var i = 0; i < layer.children.length; i++) { | |
43 if (isUsingCompositedScrolling(layer.children[i])) | |
44 return true; | |
45 } | |
46 } | |
47 return false; | |
48 } | |
49 | |
50 if (window.internals) | 39 if (window.internals) |
51 window.internals.settings.setPreferCompositingToLCDTextEnabled(true); | 40 window.internals.settings.setPreferCompositingToLCDTextEnabled(true); |
52 | 41 |
53 if (window.testRunner) { | 42 if (window.testRunner) { |
54 window.testRunner.dumpAsText(); | 43 window.testRunner.dumpAsText(); |
55 window.testRunner.waitUntilDone(); | 44 window.testRunner.waitUntilDone(); |
56 } | 45 } |
57 | 46 |
58 var result = ""; | 47 var result = ""; |
59 | 48 |
60 onload = function() { | 49 onload = function() { |
61 if (window.internals) { | 50 if (window.internals) { |
62 result += "No clip path ancestor (should be using composited scrolling):
"; | 51 result += "No clip path ancestor (should be using composited scrolling):
"; |
63 if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsTe
xt(document)))) | 52 var layers = window.internals.layerTreeAsText(document, window.internals
.OUTPUT_CHILDREN_AS_LAYER_LIST); |
| 53 if (isUsingCompositedScrolling(JSON.parse(layers))) |
64 result += "Pass.\n"; | 54 result += "Pass.\n"; |
65 else | 55 else |
66 result += "Fail.\n" | 56 result += "Fail.\n" |
67 } | 57 } |
68 document.getElementById("outer").style.webkitClipPath = "polygon(40px 550px,
432px 302px,409px 237px,46px 156px)"; | 58 document.getElementById("outer").style.webkitClipPath = "polygon(40px 550px,
432px 302px,409px 237px,46px 156px)"; |
69 requestAnimationFrame(function() { | 59 requestAnimationFrame(function() { |
70 if (window.internals) { | 60 if (window.internals) { |
71 result += "Has clip path ancestor (should not be using composited sc
rolling): "; | 61 result += "Has clip path ancestor (should not be using composited sc
rolling): "; |
72 if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTre
eAsText(document)))) | 62 var layers = window.internals.layerTreeAsText(document, window.inter
nals.OUTPUT_CHILDREN_AS_LAYER_LIST); |
| 63 if (!isUsingCompositedScrolling(JSON.parse(layers))) |
73 result += "Pass.\n"; | 64 result += "Pass.\n"; |
74 else | 65 else |
75 result += "Fail.\n" | 66 result += "Fail.\n" |
76 } | 67 } |
77 if (window.testRunner) { | 68 if (window.testRunner) { |
78 window.testRunner.setCustomTextOutput(result); | 69 window.testRunner.setCustomTextOutput(result); |
79 window.testRunner.notifyDone(); | 70 window.testRunner.notifyDone(); |
80 } | 71 } |
81 }); | 72 }); |
82 }; | 73 }; |
83 </script> | 74 </script> |
OLD | NEW |