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); |