| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| .container { |
| border: 1px solid black; |
| } |
| .box { |
| width: 200px; |
| height: 200px; |
| background-color: red; |
| } |
| |
| .child { |
| background-color: green; |
| width: 100%; |
| height: 100%; |
| } |
| |
| .composited { |
| -webkit-transform: translateZ(0); |
| } |
| |
| #negative { |
| position: absolute; |
| top: 100px; |
| height: 50px; |
| width: 50px; |
| background-color: orange; |
| z-index: 0; |
| } |
| |
| #negative.behind { |
| z-index: -1; |
| } |
| </style> |
| <script> |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| function doTest() |
| { |
| window.setTimeout(function() { |
| document.getElementById('negative').classList.remove('behind'); |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }, 0) |
| } |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| <body> |
| <div class="container composited box"> |
| <div class="child"></div> |
| <div id="negative" class="composited behind box"></div> |
| </div> |
| </body> |
| </html> |