| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style type="text/css"> |
| 5 .container { |
| 6 width: 60px; |
| 7 height: 60px; |
| 8 margin: 5px; |
| 9 } |
| 10 canvas { |
| 11 background-color: green; |
| 12 } |
| 13 #canvas-simple {} |
| 14 #canvas-padding { padding: 5px; } |
| 15 #canvas-border { border: 5px solid; } |
| 16 #canvas-image { background-image: url("../resources/simple_image.png"); } |
| 17 </style> |
| 18 <script> |
| 19 if (window.testRunner) |
| 20 testRunner.dumpAsText(); |
| 21 |
| 22 function drawCanvas(canvasID) { |
| 23 var canvas = document.getElementById(canvasID); |
| 24 var context = canvas.getContext("2d"); |
| 25 context.clearRect(0, 0, canvas.width, canvas.height); |
| 26 }; |
| 27 |
| 28 function doTest() { |
| 29 // Simple background can be direct-composited with content-layer. |
| 30 // The container GraphicsLayer does not paint anything. |
| 31 drawCanvas('canvas-simple'); |
| 32 |
| 33 // Padding makes the background-box bigger than content-box. |
| 34 // The container GraphicsLayer needs to paint background. |
| 35 drawCanvas('canvas-padding'); |
| 36 |
| 37 // Content layer cannot direct-composite any kind of box decoration. |
| 38 // The container GraphicsLayer needs to paint box decorations. |
| 39 drawCanvas('canvas-border'); |
| 40 |
| 41 // Content layer cannot direct-composite background image. |
| 42 // The container GraphicsLayer needs to paint background image. |
| 43 drawCanvas('canvas-image'); |
| 44 |
| 45 if (window.testRunner && window.internals) |
| 46 document.getElementById('layer-tree').innerText = window.interna
ls.layerTreeAsText(document); |
| 47 }; |
| 48 window.addEventListener('load', doTest, false); |
| 49 </script> |
| 50 </head> |
| 51 |
| 52 <body> |
| 53 <div class="container"> |
| 54 <canvas id="canvas-simple" width="50" height="50"></canvas> |
| 55 </div> |
| 56 <div class="container"> |
| 57 <canvas id="canvas-padding" width="50" height="50"></canvas> |
| 58 </div> |
| 59 <div class="container"> |
| 60 <canvas id="canvas-border" width="50" height="50"></canvas> |
| 61 </div> |
| 62 <div class="container"> |
| 63 <canvas id="canvas-image" width="50" height="50"></canvas> |
| 64 </div> |
| 65 <pre id="layer-tree"></pre> |
| 66 </body> |
| 67 </html> |
| OLD | NEW |