Index: Source/core/layout/compositing/CompositingReasonFinder.cpp |
diff --git a/Source/core/layout/compositing/CompositingReasonFinder.cpp b/Source/core/layout/compositing/CompositingReasonFinder.cpp |
index b67ab287deb037fe0cfac35373bbdb880c2382a1..262d5ac52e53208de5a5f4d4195d1c5092360080 100644 |
--- a/Source/core/layout/compositing/CompositingReasonFinder.cpp |
+++ b/Source/core/layout/compositing/CompositingReasonFinder.cpp |
@@ -179,11 +179,24 @@ bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl |
bool CompositingReasonFinder::requiresCompositingForPositionFixed(const DeprecatedPaintLayer* layer) const |
{ |
- if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
- 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. |
- return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollable(); |
+ if (!layer->scrollsWithViewport() || !m_layoutView.frameView()->isScrollable()) |
+ return false; |
+ |
+ if (m_compositingTriggers & ViewportConstrainedPositionedTrigger) |
+ return true; |
+ |
+ // If the layer is opaque we can still promote it since we will not lose LCD text |
+ LayoutRect bounds = layer->physicalBoundingBox(layer); |
+ const DeprecatedPaintLayer* currentChild = layer->firstChild(); |
+ // Include any possible overflow from children |
+ for (; currentChild; currentChild = currentChild->nextSibling()) { |
+ LayoutRect childBounds = currentChild->physicalBoundingBox(layer); |
+ bounds.unite(childBounds); |
+ } |
trchen
2015/09/17 21:40:33
A few problem here:
1. This only adds the overflow
Ian Vollick
2015/09/18 02:09:50
Yes, this is indeed too slow. If you look at Depre
davidfox
2015/09/18 02:55:40
Sorry for the "double" post. Initially replied to
|
+ |
+ return layer->backgroundIsKnownToBeOpaqueInRect(bounds); |
} |
} |