Commit 5ca46aef authored by ykyyip@chromium.org's avatar ykyyip@chromium.org

Fix scrolling fixed objects containing abs pos objects

Need to recalculate the repaint rects for children inside fixed objects when we
find the repaint rects for fixed objects after scrolling so we invalidate the fixed
objects with the correct scroll position.

BUG=358550

Review URL: https://codereview.chromium.org/222473004

git-svn-id: svn://svn.chromium.org/blink/trunk@170700 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7f7879bc
Hi!
(repaint rects
(rect 0 0 785 600)
(rect 0 -500 785 600)
(rect 0 -500 785 4021)
(rect 425 -20 360 90)
)
(GraphicsLayer
(bounds 785.00 4021.00)
(children 1
(GraphicsLayer
(bounds 785.00 4021.00)
(contentsOpaque 1)
(drawsContent 1)
(repaint rects
(rect 425.00 480.00 360.00 590.00)
(rect 425.00 480.00 360.00 590.00)
)
)
)
)
<!doctype html>
<html>
<head>
<script src="../../resources/run-after-display.js"></script>
<style>
#fixed {
position: fixed;
bottom: 30px;
right: 0px;
}
#abs {
position: absolute;
bottom: 0px;
right: 0px;
height: 90px;
width: 360px;
background: yellow;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals) {
window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(false);
window.internals.settings.setForceCompositingMode(true);
}
window.onload = function() {
if (window.internals)
window.internals.startTrackingRepaints(document);
window.scrollTo(0, 500);
runAfterDisplay(function() {
window.scrollTo(0, 0);
runAfterDisplay(function() {
if (window.internals)
document.getElementById('layers').textContent =
window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
if (window.testRunner)
testRunner.notifyDone();
});
});
}
</script>
</head>
<body style="height: 4000px;">
<div id="fixed">
<div id="abs">
Hi!
</div>
</div>
<pre id="layers"></pre>
</body>
</html>
\ No newline at end of file
...@@ -1748,7 +1748,7 @@ void FrameView::updateFixedElementRepaintRectsAfterScroll() ...@@ -1748,7 +1748,7 @@ void FrameView::updateFixedElementRepaintRectsAfterScroll()
|| layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotCompositedForNoVisibleContent) || layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotCompositedForNoVisibleContent)
continue; continue;
layer->repainter().computeRepaintRects(renderer->containerForRepaint()); layer->repainter().computeRepaintRectsIncludingDescendants();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment