OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 |
| 4 <head> |
| 5 <style> |
| 6 |
| 7 .fixedContainer { |
| 8 position: fixed; |
| 9 overflow:hidden; |
| 10 background-color: #a0a0a0; |
| 11 bottom: 0px; |
| 12 left: 0px; |
| 13 width:400px; |
| 14 height: 100px; |
| 15 } |
| 16 |
| 17 #foo { |
| 18 width:200px; |
| 19 height: 100px; |
| 20 background-color: #00a0a0; |
| 21 -webkit-transform:translateZ(0); |
| 22 } |
| 23 </style> |
| 24 |
| 25 <script> |
| 26 if (window.testRunner) |
| 27 testRunner.dumpAsText(); |
| 28 |
| 29 if (window.internals) { |
| 30 /* Note carefully, compositing for fixed position is _disabled_ here */ |
| 31 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(fals
e); |
| 32 internals.settings.setFixedPositionCreatesStackingContext(true); |
| 33 } |
| 34 |
| 35 function test() |
| 36 { |
| 37 document.body.offsetHeight; |
| 38 if (window.internals) |
| 39 window.internals.startTrackingRepaints(document); |
| 40 |
| 41 window.scrollTo(0, 100); |
| 42 |
| 43 if (window.internals) |
| 44 document.getElementById('layers').textContent = window.internals.lay
erTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
| 45 } |
| 46 </script> |
| 47 </head> |
| 48 |
| 49 <body style="height:4000px;" onload="test()"> |
| 50 <!-- |
| 51 Among other duplicate bugs: https://code.google.com/p/chromium/issues/det
ail?id=151734 |
| 52 |
| 53 In the current code, a layer may actually be composited, but not have its
own backing. |
| 54 In these cases, the layer paints into its composited ancestor with a back
ing. |
| 55 For fixed-position elements, however, this goes wrong because no other co
de |
| 56 realizes that there is a software-painted fixed-position element. As a r
esult, |
| 57 the composited parent does not receive repaint invalidations, and the fix
ed-position |
| 58 element incorrectly appears to be fixed to the composited element rather
than the viewport. |
| 59 |
| 60 The scenario that reproduces this: A fixed position element that has an
overflow-clip with |
| 61 a composited child. In this case, the fixed-position element needs to be
composited. |
| 62 However, this is one of the few reasons that does not require that the co
mposited layer needs |
| 63 its own backing. |
| 64 --> |
| 65 |
| 66 <!-- Scrolling should not cause either div to move around on the viewport. --> |
| 67 <div class="fixedContainer"> |
| 68 <div id="foo"></div> |
| 69 </div> |
| 70 |
| 71 <pre id="layers"></pre> |
| 72 </body> |
| 73 |
| 74 </html> |
OLD | NEW |