Chromium Code Reviews| 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 ccec84d0159bc2911b6e9e14816ae9aff9a11378..0f6a32830c79abea2716b4809dc486ada39a8e73 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/GraphicsLayerUpdater.cpp |
| @@ -28,6 +28,7 @@ |
| #include "core/html/HTMLMediaElement.h" |
| #include "core/inspector/InspectorTraceEvents.h" |
| +#include "core/layout/LayoutBlock.h" |
| #include "core/layout/compositing/CompositedLayerMapping.h" |
| #include "core/layout/compositing/PaintLayerCompositor.h" |
| #include "core/paint/PaintLayer.h" |
| @@ -53,6 +54,10 @@ class GraphicsLayerUpdater::UpdateContext { |
| } |
| const PaintLayer* compositingContainer(const PaintLayer& layer) const { |
| + // TODO(chrishtr) this is not very performant for floats, but they should |
| + // be uncommon enough, and SPv2 will remove this code. |
| + if (layer.layoutObject()->isFloating()) |
| + return layer.layoutObject()->containingBlock()->enclosingLayer(); |
|
Xianzhu
2017/01/09 20:04:14
Two comments:
1. For performance we can use
if
chrishtr
2017/01/09 23:28:33
Done.
|
| return layer.stackingNode()->isStacked() ? m_compositingStackingContext |
| : m_compositingAncestor; |
| } |