| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| .container { |
| height: 200px; |
| width: 300px; |
| border: 4px solid black; |
| overflow-y: scroll; |
| resize: both; |
| background-color: rgba(0,255,0,0.5); |
| } |
| |
| .box { |
| position: relative; |
| z-index: 1; |
| height: 100px; |
| width: 100px; |
| margin: 10px; |
| background-color: rgba(0,0,255,0.5); |
| } |
| |
| |
| #fixed { |
| position: fixed; |
| z-index: 0; |
| background-color: green; |
| left: 50px; |
| top: 200px; |
| height: 200px; |
| width: 200px; |
| } |
| |
| .red { |
| background-color: rgba(255,0,0,0.5); |
| } |
| |
| .clip { |
| width: 80px; |
| height: 80px; |
| overflow: hidden; |
| } |
| |
| </style> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| if (window.internals) { |
| window.internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| } |
| |
| function runTest() { |
| var pre = document.createElement('pre'); |
| if (!window.internals) { |
| var description = "This test ensures that amongst the graphics " |
| + "layers corresponding to a single Layer, only one may " |
| + "have a scroll parent."; |
| pre.innerHTML = description; |
| } else { |
| document.body.offsetTop; |
| var clip = document.getElementById('clip'); |
| clip.className = "clip"; |
| document.body.offsetTop; |
| pre.innerHTML = internals.layerTreeAsText(document, |
| internals.LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS); |
| } |
| document.body.appendChild(pre); |
| } |
| window.onload = runTest; |
| </script> |
| </head> |
| <body> |
| <div class="container"> |
| <div id="fixed"></div> |
| <div id='clip'> |
| <div class="box red"></div> |
| </div> |
| <div class="box"></div> |
| <div class="box"></div> |
| <div class="box"></div> |
| <div class="box"></div> |
| </div> |
| </body> |
| </html> |