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

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

Issue 2543913002: Generalize visible descendant dirty bits to prepare for more properties. (Closed)
Patch Set: none Created 4 years 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
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,
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698