Index: Source/core/rendering/RenderLayerCompositor.cpp |
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp |
index 397a5e8703c6d3b0c683f0d2c716caeb5eebb490..2ba3141a2de2890920e3ef4cc1e9dfb5cfc17dfc 100644 |
--- a/Source/core/rendering/RenderLayerCompositor.cpp |
+++ b/Source/core/rendering/RenderLayerCompositor.cpp |
@@ -1924,6 +1924,31 @@ bool RenderLayerCompositor::requiresCompositingForPosition(RenderObject* rendere |
return false; |
} |
+ // If the fixed-position element does not have any scrollable ancestor between it and |
+ // its container, then we do not need to spend compositor resources for it. Start by |
+ // assuming we can opt-out (i.e. no scrollable ancestor), and refine the answer below. |
+ bool noScrollableAncestor = true; |
enne (OOO)
2013/04/30 01:51:35
style nit: bools are always easier to understand w
|
+ |
+ // The FrameView has the scrollbars associated with the top level viewport, so we have to |
enne (OOO)
2013/04/30 01:51:35
I'm not sure what you mean by "top level" here. T
|
+ // check the FrameView in addition to the hierarchy of ancestors. |
+ if (m_renderView->frameView() && (m_renderView->frameView()->isScrollable())) |
+ noScrollableAncestor = false; |
enne (OOO)
2013/04/30 01:51:35
I don't quite understand how you can set this to f
shawnsingh
2013/04/30 20:53:51
Setting it to false means that we should still com
|
+ |
+ RenderLayer* ancestor = layer->parent(); |
Tom Hudson
2013/04/29 14:50:24
Naive question: this function assumes layer is non
shawnsingh
2013/04/29 15:57:13
It's a "reasonable assumption" that it will not be
|
+ while (ancestor && noScrollableAncestor) { |
+ if (ancestor->hasScrollbars()) |
Ian Vollick
2013/04/30 00:22:22
I believe the check is frameView->containsScrollab
|
+ noScrollableAncestor = false; |
+ if (ancestor->renderer() == container) |
enne (OOO)
2013/04/30 01:51:35
I think it would be clearer to call container m_re
|
+ break; |
+ ancestor = ancestor->parent(); |
+ } |
+ |
+ if (noScrollableAncestor) { |
+ if (viewportConstrainedNotCompositedReason) |
+ *viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForUnscrollableAncestors; |
+ return false; |
+ } |
+ |
// Subsequent tests depend on layout. If we can't tell now, just keep things the way they are until layout is done. |
if (!m_inPostLayoutUpdate) { |
m_reevaluateCompositingAfterLayout = true; |