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

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

Issue 2318243002: Promote opaque fixed position elements. (Closed)
Patch Set: Use ScopedRuntimeEnabledFeatureForTest. Created 4 years, 3 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/CompositingReasonFinder.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp
index 51777eb381099c656b3338a2eac962f1aff9c8df..615151d5e9189c2b731cfc2ae2fea56edbbd70a2 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp
@@ -168,8 +168,15 @@ bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl
bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition(const PaintLayer* layer) const
{
- if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger))
+ if (layer->layoutObject()->style()->position() != FixedPosition
+ && layer->layoutObject()->style()->position() != StickyPosition)
return false;
+
+ if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)
+ && (!RuntimeEnabledFeatures::compositeOpaqueFixedPositionEnabled()
+ || !layer->backgroundIsKnownToBeOpaqueInRect(LayoutRect(layer->boundingBoxForCompositing())))) {
+ return false;
+ }
// Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
// They will stay fixed wrt the container rather than the enclosing frame.
if (layer->scrollsWithViewport())

Powered by Google App Engine
This is Rietveld 408576698