| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 1 <!DOCTYPE HTML> |
| 2 <script src="resources/composited-scroll.js"></script> | 2 <script src="resources/composited-scroll.js"></script> |
| 3 <style> | 3 <style> |
| 4 #scroller { | 4 #scroller { |
| 5 overflow: scroll; | 5 overflow: scroll; |
| 6 height: 300px; | 6 height: 300px; |
| 7 width: 300px; | 7 width: 300px; |
| 8 background-color: red; | 8 background-color: red; |
| 9 } | 9 } |
| 10 | 10 |
| 11 #scrolled { | 11 #scrolled { |
| 12 height: 1000px; | 12 height: 1000px; |
| 13 width: 250px; | 13 width: 250px; |
| 14 background-color: green; | 14 background-color: green; |
| 15 } | 15 } |
| 16 | 16 |
| 17 #fixed { | 17 #fixed { |
| 18 position: fixed; | 18 position: fixed; |
| 19 height: 100px; | 19 height: 100px; |
| 20 width: 100px; | 20 width: 100px; |
| 21 background-color: green; | 21 background-color: green; |
| 22 top: 400px; | 22 top: 400px; |
| 23 left: 100px; | 23 left: 100px; |
| 24 } | 24 } |
| 25 </style> | 25 </style> |
| 26 <div id="scroller"> | 26 <div id="scroller"> |
| 27 <div id="scrolled"></div> | 27 <div id="scrolled"></div> |
| 28 <div id="fixed"></div> | 28 <div id="fixed"></div> |
| 29 </div> | 29 </div> |
| 30 <script> | 30 <script> |
| 31 if (window.internals) | 31 if (window.internals) |
| 32 window.internals.settings.setPreferCompositingToLCDTextEnabled(true); | 32 window.internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| 33 | 33 |
| 34 if (window.testRunner) { | 34 if (window.testRunner) { |
| 35 window.testRunner.dumpAsText(); | 35 window.testRunner.dumpAsText(); |
| 36 window.testRunner.waitUntilDone(); | 36 window.testRunner.waitUntilDone(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 var result = ""; | 39 var result = ""; |
| 40 | 40 |
| 41 onload = function() { | 41 onload = function() { |
| 42 if (window.internals) { |
| 43 result += "No border radius (should be using composited scrolling): "; |
| 44 if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(d
ocument)))) |
| 45 result += "Pass.\n"; |
| 46 else |
| 47 result += "Fail.\n" |
| 48 } |
| 49 document.getElementById("scroller").style.borderRadius = '5px'; |
| 50 requestAnimationFrame(function() { |
| 42 if (window.internals) { | 51 if (window.internals) { |
| 43 result += "No border radius (should be using composited scrolling): "; | 52 result += "Has border radius (should not be using composited scrolling): "
; |
| 44 if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsTe
xt(document)))) | 53 if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText
(document)))) |
| 45 result += "Pass.\n"; | 54 result += "Pass.\n"; |
| 46 else | 55 else |
| 47 result += "Fail.\n" | 56 result += "Fail.\n" |
| 48 } | 57 } |
| 49 document.getElementById("scroller").style.borderRadius = '5px'; | |
| 50 requestAnimationFrame(function() { | |
| 51 if (window.internals) { | |
| 52 result += "Has border radius (should not be using composited scrolli
ng): "; | |
| 53 if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTre
eAsText(document)))) | |
| 54 result += "Pass.\n"; | |
| 55 else | |
| 56 result += "Fail.\n" | |
| 57 } | |
| 58 | 58 |
| 59 if (window.testRunner) { | 59 if (window.testRunner) { |
| 60 window.testRunner.setCustomTextOutput(result); | 60 window.testRunner.setCustomTextOutput(result); |
| 61 window.testRunner.notifyDone(); | 61 window.testRunner.notifyDone(); |
| 62 } | 62 } |
| 63 }); | 63 }); |
| 64 }; | 64 }; |
| 65 </script> | 65 </script> |
| OLD | NEW |