Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 465333004: Non-composited, fixed position should trigger main thread scrolling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 6f43339a2d51e1a8375cdc72e242075f8ac32c49..261bf1400ca5d4f8d6d708599c6e99754ce62489 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -886,13 +886,23 @@ bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame
return false;
for (FrameView::ViewportConstrainedObjectSet::const_iterator it = viewportConstrainedObjects->begin(), end = viewportConstrainedObjects->end(); it != end; ++it) {
- RenderObject* viewportConstrainedObject = *it;
- if (!viewportConstrainedObject->isBoxModelObject() || !viewportConstrainedObject->hasLayer())
- return true;
- RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->layer();
- // Composited layers that actually paint into their enclosing ancestor
- // must also force main thread scrolling.
- if (layer->compositingState() == HasOwnBackingButPaintsIntoAncestor)
+ RenderObject* renderer = *it;
+ ASSERT(renderer->isBoxModelObject() && renderer->hasLayer());
+ ASSERT(renderer->style()->position() == FixedPosition);
+ RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
+
+ // Whether the RenderLayer scrolls with the viewport is a tree-depenent
+ // property and our viewportConstrainedObjects collection is maintained
+ // with only RenderObject-level information.
+ if (!layer->scrollsWithViewport())
+ continue;
+
+ // We're only smart enough to scroll viewport-constrainted objects
+ // in the compositor if they have their own backing or they paint
+ // into a grouped back (which necessarily all have the same viewport
+ // constraints).
+ CompositingState compositingState = layer->compositingState();
+ if (compositingState != PaintsIntoOwnBacking && compositingState != PaintsIntoGroupedBacking)
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698