Index: LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html |
diff --git a/LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html b/LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..89eccbcab806b75c9e4616b67584e930174f1942 |
--- /dev/null |
+++ b/LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html |
@@ -0,0 +1,74 @@ |
+<!DOCTYPE html> |
+<html> |
+ |
+<head> |
+<style> |
+ |
+.fixedContainer { |
+ position: fixed; |
+ overflow:hidden; |
+ background-color: #a0a0a0; |
+ bottom: 0px; |
+ left: 0px; |
+ width:400px; |
+ height: 100px; |
+} |
+ |
+#foo { |
+ width:200px; |
+ height: 100px; |
+ background-color: #00a0a0; |
+ -webkit-transform:translateZ(0); |
+} |
+</style> |
+ |
+<script> |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ if (window.internals) { |
+ /* Note carefully, compositing for fixed position is _disabled_ here */ |
+ internals.settings.setAcceleratedCompositingForFixedPositionEnabled(false); |
+ internals.settings.setFixedPositionCreatesStackingContext(true); |
+ } |
+ |
+ function test() |
+ { |
+ document.body.offsetHeight; |
+ if (window.internals) |
+ window.internals.startTrackingRepaints(document); |
+ |
+ window.scrollTo(0, 100); |
+ |
+ if (window.internals) |
+ document.getElementById('layers').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
+ } |
+</script> |
+</head> |
+ |
+<body style="height:4000px;" onload="test()"> |
+ <!-- |
+ Among other duplicate bugs: https://code.google.com/p/chromium/issues/detail?id=151734 |
+ |
+ In the current code, a layer may actually be composited, but not have its own backing. |
+ In these cases, the layer paints into its composited ancestor with a backing. |
+ For fixed-position elements, however, this goes wrong because no other code |
+ realizes that there is a software-painted fixed-position element. As a result, |
+ the composited parent does not receive repaint invalidations, and the fixed-position |
+ element incorrectly appears to be fixed to the composited element rather than the viewport. |
+ |
+ The scenario that reproduces this: A fixed position element that has an overflow-clip with |
+ a composited child. In this case, the fixed-position element needs to be composited. |
+ However, this is one of the few reasons that does not require that the composited layer needs |
+ its own backing. |
+ --> |
+ |
+ <!-- Scrolling should not cause either div to move around on the viewport. --> |
+ <div class="fixedContainer"> |
+ <div id="foo"></div> |
+ </div> |
+ |
+ <pre id="layers"></pre> |
+</body> |
+ |
+</html> |