Index: Source/WebCore/rendering/RenderLayerCompositor.cpp |
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp |
index b27fea85a626c964804447d14aff9d3925888857..bcb90dbfa7e8d819bc7cb231d084db11b0cae20c 100644 |
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp |
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp |
@@ -1931,7 +1931,26 @@ bool RenderLayerCompositor::requiresCompositingForPosition(RenderObject* rendere |
*viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForNonViewContainer; |
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. |
+ bool noScrollableAncestor = true; |
+ if (container == m_renderView && m_renderView->frameView() && (m_renderView->frameView()->isScrollable())) |
vangelis
2013/04/16 06:54:23
Because of the code right above, we're guaranteed
shawnsingh
2013/04/16 20:20:06
Oops - forgot to remove this based on your previou
|
+ noScrollableAncestor = false; |
vangelis
2013/04/16 06:54:23
Should you set the value of viewportConstrainedNot
shawnsingh
2013/04/16 20:20:06
Thanks for catching this - will do it.
|
+ |
+ RenderLayer* ancestor = layer->parent(); |
+ while (ancestor && noScrollableAncestor) { |
+ if (ancestor->hasHorizontalScrollbar() || ancestor->hasVerticalScrollbar()) |
vangelis
2013/04/16 06:54:23
Since you know you need to iterate until you get b
trchen
2013/04/16 19:36:21
I have the same concern. For historical reason we
shawnsingh
2013/04/16 20:20:06
I don't think we can eliminate those lines of code
|
+ noScrollableAncestor = false; |
+ if (ancestor->renderer() == container) |
+ break; |
+ ancestor = ancestor->parent(); |
+ } |
+ |
+ if (noScrollableAncestor) |
+ 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; |