Commit d1cd1418 authored by abarth@chromium.org's avatar abarth@chromium.org

Use scrollContentsSlowPath when scrolling with background-attachment: fixed

This CL causes us to bail out of the fast scrolling path if we have slow
repainting objects (i.e., background-attachment: fixed). We've done this for a
long time, by my recent CL removed this behavior and we appear to lack test
coverage for it.

R=vollick@chromium.org
BUG=402747

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180223 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 18067e21
{
"bounds": [785, 5000],
"children": [
{
"bounds": [785, 5000],
"contentsOpaque": true,
"drawsContent": true,
"repaintRects": [
[0, 1000, 785, 600]
]
}
]
}
<!DOCTYPE html>
<style>
body {
background-image: linear-gradient(red, blue);
background-attachment: fixed;
margin: 0;
}
</style>
<script src="resources/text-based-repaint.js" type="text/javascript"></script>
<script>
if (window.testRunner)
window.internals.settings.setAcceleratedCompositingForFixedRootBackgroundEnabled(false);
function repaintTest() {
window.scrollTo(0, 1000);
}
window.onload = function() {
runRepaintTest();
};
</script>
<div style="height: 5000px">
Tests that scrolling a frame with background-attachment: fixed invalidates the entire viewport.
</div>
...@@ -1254,7 +1254,7 @@ void FrameView::scrollContentsIfNeeded() ...@@ -1254,7 +1254,7 @@ void FrameView::scrollContentsIfNeeded()
bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll) bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll)
{ {
if (!contentsInCompositedLayer()) if (!contentsInCompositedLayer() || hasSlowRepaintObjects())
return false; return false;
if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()) { if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()) {
......
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