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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1643663002: Conditionally create PaintLayer's scrollable area object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintLayerClipper
Patch Set: Created 4 years, 10 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
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 6c78b422c86724b702e558041cfb10d4b95d86a3..33e674215531cc887b2f5cfbf53a8f33d16fd27d 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1449,9 +1449,14 @@ void PaintLayer::updateStackingNode()
void PaintLayer::updateScrollableArea()
{
- ASSERT(!m_scrollableArea);
- if (requiresScrollableArea())
- m_scrollableArea = PaintLayerScrollableArea::create(*this);
+ if (requiresScrollableArea()) {
+ if (!m_scrollableArea)
+ m_scrollableArea = PaintLayerScrollableArea::create(*this);
+ } else if (m_scrollableArea) {
+ if (m_scrollableArea)
+ m_scrollableArea->dispose();
+ m_scrollableArea.clear();
+ }
}
bool PaintLayer::hasOverflowControls() const
@@ -2549,6 +2554,7 @@ void PaintLayer::styleChanged(StyleDifference diff, const ComputedStyle* oldStyl
m_stackingNode->updateIsTreatedAsStackingContext();
m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle);
+ updateScrollableArea();
if (m_scrollableArea)
m_scrollableArea->updateAfterStyleChange(oldStyle);

Powered by Google App Engine
This is Rietveld 408576698