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 39afec388f4d7474c38c75129680c3a7ad0b2719..a2c0a5463f74cfc3c8c2cda56c0f111ab6041846 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -926,8 +926,15 @@ void PaintLayerScrollableArea::updateAfterStyleChange( |
| if (!hasScrollbar() && !needsHorizontalScrollbar && !needsVerticalScrollbar) |
| return; |
| - setHasHorizontalScrollbar(needsHorizontalScrollbar); |
| - setHasVerticalScrollbar(needsVerticalScrollbar); |
| + bool horizontalScrollbarChanged = |
| + setHasHorizontalScrollbar(needsHorizontalScrollbar); |
| + bool verticalScrollbarChanged = |
| + setHasVerticalScrollbar(needsVerticalScrollbar); |
| + |
| + if (horizontalScrollbarChanged || verticalScrollbarChanged) { |
| + toLayoutBlock(box()).scrollbarsChanged(horizontalScrollbarChanged, |
|
atotic
2016/11/21 22:09:06
box() can return null. Looking at existing code, i
skobes
2016/11/21 22:18:51
It returns a reference, so it cannot be null.
|
| + verticalScrollbarChanged); |
| + } |
| // With overflow: scroll, scrollbars are always visible but may be disabled. |
| // When switching to another value, we need to re-enable them (see bug 11985). |
| @@ -1174,12 +1181,12 @@ void PaintLayerScrollableArea::computeScrollbarExistence( |
| } |
| } |
| -void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) { |
| +bool PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) { |
| if (FreezeScrollbarsScope::scrollbarsAreFrozen()) |
| - return; |
| + return false; |
| if (hasScrollbar == hasHorizontalScrollbar()) |
| - return; |
| + return false; |
| setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
| @@ -1199,14 +1206,15 @@ void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) { |
| // Force an update since we know the scrollbars have changed things. |
| if (box().document().hasAnnotatedRegions()) |
| box().document().setAnnotatedRegionsDirty(true); |
| + return true; |
| } |
| -void PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) { |
| +bool PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) { |
| if (FreezeScrollbarsScope::scrollbarsAreFrozen()) |
| - return; |
| + return false; |
| if (hasScrollbar == hasVerticalScrollbar()) |
| - return; |
| + return false; |
| setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
| @@ -1226,6 +1234,7 @@ void PaintLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar) { |
| // Force an update since we know the scrollbars have changed things. |
| if (box().document().hasAnnotatedRegions()) |
| box().document().setAnnotatedRegionsDirty(true); |
| + return true; |
| } |
| int PaintLayerScrollableArea::verticalScrollbarWidth( |