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

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

Issue 2787203002: Fix GraphicsLayerUpdater::UpdateContext::compositingContainer() for corner cases (Closed)
Patch Set: Fix 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp
index 206a380497331df2363912b582c1899ed2320b04..875bc6b70ea0bd53d0300df8309c840a113f13ce 100644
--- a/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp
@@ -54,17 +54,25 @@ class GraphicsLayerUpdater::UpdateContext {
}
const PaintLayer* compositingContainer(const PaintLayer& layer) const {
- if (layer.stackingNode()->isStacked())
- return m_compositingStackingContext;
-
- // TODO(wangxianzhu, chrishtr): This is incorrect if m_compositingAncestor
- // is inline and there is any non-layer floating object between layer and
- // m_compositingAncestor. Should use the logic in PaintLayer::
- // containingLayer().
- if (layer.layoutObject().isFloatingWithNonContainingBlockParent())
- return layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf);
+ const PaintLayer* compositingContainer;
+ if (layer.stackingNode()->isStacked()) {
+ compositingContainer = m_compositingStackingContext;
+ } else if ((layer.parent() &&
+ !layer.parent()->layoutObject().isLayoutBlock()) ||
+ layer.layoutObject().isColumnSpanAll()) {
+ // In these cases, compositingContainer may escape the normal layer
+ // hierarchy. Use the slow path to ensure correct result.
+ // See PaintLayer::containingLayer() for details.
+ compositingContainer =
+ layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf);
+ } else {
+ compositingContainer = m_compositingAncestor;
+ }
- return m_compositingAncestor;
+ // We should always get the same result as the slow path.
+ DCHECK_EQ(compositingContainer,
+ layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf));
+ return compositingContainer;
}
const PaintLayer* compositingStackingContext() const {
@@ -98,15 +106,9 @@ void GraphicsLayerUpdater::updateRecursive(
CompositedLayerMapping* mapping = layer.compositedLayerMapping();
if (updateType == ForceUpdate || mapping->needsGraphicsLayerUpdate()) {
- const PaintLayer* compositingContainer =
- context.compositingContainer(layer);
- DCHECK_EQ(compositingContainer,
- layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf));
-
if (mapping->updateGraphicsLayerConfiguration())
m_needsRebuildTree = true;
-
- mapping->updateGraphicsLayerGeometry(compositingContainer,
+ mapping->updateGraphicsLayerGeometry(context.compositingContainer(layer),
context.compositingStackingContext(),
layersNeedingPaintInvalidation);
if (PaintLayerScrollableArea* scrollableArea = layer.getScrollableArea())
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698