Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| index e50d441318e02d9e712f2b5845123466b39657b5..3cf4f29dc640cdc3922d67474f070deaf6383a25 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -107,7 +107,8 @@ PaintLayerScrollableArea::PaintLayerScrollableArea(PaintLayer& layer) |
| m_scrollbarManager(*this), |
| m_scrollCorner(nullptr), |
| m_resizer(nullptr), |
| - m_scrollAnchor(this) |
| + m_scrollAnchor(this), |
| + m_reasons(0) |
| #if DCHECK_IS_ON() |
| , |
| m_hasBeenDisposed(false) |
| @@ -147,8 +148,18 @@ void PaintLayerScrollableArea::dispose() { |
| if (box().frame() && box().frame()->page()) { |
| if (ScrollingCoordinator* scrollingCoordinator = |
| - box().frame()->page()->scrollingCoordinator()) |
| + box().frame()->page()->scrollingCoordinator()) { |
| + // Decrese the number of layer that has any main thread |
| + // scrolling reasons stored in ScrollingCoordinator |
| + for (uint32_t i = 0; |
| + i < MainThreadScrollingReason::kMainThreadScrollingReasonCount; |
| + ++i) { |
| + if (hasMainThreadScrollingReason(1 << i)) { |
| + scrollingCoordinator->adjustMainThreadReasonsFromStyle(1 << i, false); |
| + } |
| + } |
| scrollingCoordinator->willDestroyScrollableArea(this); |
|
bokan
2016/12/14 13:28:59
Actually, since we already have this willDestroySc
yigu
2016/12/14 21:17:33
Done.
|
| + } |
| } |
| if (!box().documentBeingDestroyed()) { |