| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| index 219d0f355aac039fbf5846da229643835c6f3ec9..398848c1a1577e5bd6d8f624762f6bfad7f0c1de 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -1772,10 +1772,17 @@ bool CompositedLayerMapping::updateOverflowControlsLayers(
|
| }
|
|
|
| // If the subtree is invisible, we don't actually need scrollbar layers.
|
| - bool invisible = m_owningLayer.subtreeIsInvisible();
|
| - needsHorizontalScrollbarLayer &= !invisible;
|
| - needsVerticalScrollbarLayer &= !invisible;
|
| - needsScrollCornerLayer &= !invisible;
|
| + // Only do this check if at least one of the bits is currently true.
|
| + // This is important because this method is called during the destructor
|
| + // of CompositedLayerMapping, which may happen during style recalc,
|
| + // and therefore visible content status may be invalid.
|
| + if (needsHorizontalScrollbarLayer || needsVerticalScrollbarLayer ||
|
| + needsScrollCornerLayer) {
|
| + bool invisible = m_owningLayer.subtreeIsInvisible();
|
| + needsHorizontalScrollbarLayer &= !invisible;
|
| + needsVerticalScrollbarLayer &= !invisible;
|
| + needsScrollCornerLayer &= !invisible;
|
| + }
|
|
|
| bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(
|
| m_layerForHorizontalScrollbar, needsHorizontalScrollbarLayer,
|
|
|