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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2754983002: Composite sticky-positioned elements when they have composited descendants (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
index aca28342b55b0d8d63095c2406bf06611a14e85a..ea03f368d524ff13961665f3d404bc172ad41e3a 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
@@ -190,8 +190,12 @@ static CompositingReasons subtreeReasonsForCompositing(
if (layer->layoutObject().hasClipRelatedProperty())
subtreeReasons |= CompositingReasonClipsCompositingDescendants;
- if (layer->layoutObject().style()->position() == EPosition::kFixed)
- subtreeReasons |= CompositingReasonPositionFixedWithCompositedDescendants;
+ // TODO(smcgruer): Use hasStickyConstrainedPosition() from flackr's patch
+ if (layer->layoutObject().style()->position() == EPosition::kFixed ||
+ layer->layoutObject().style()->position() == EPosition::kSticky) {
+ subtreeReasons |=
+ CompositingReasonPositionFixedOrStickyWithCompositedDescendants;
flackr 2017/03/23 17:30:58 Will this cause the scroller to be composited too?
smcgruer 2017/03/24 18:28:28 It will not (based on testing http://output.jsbin.
flackr 2017/04/03 17:27:59 No I think just having the layout test is fine.
+ }
}
// A layer with preserve-3d or perspective only needs to be composited if

Powered by Google App Engine
This is Rietveld 408576698