Chromium Code Reviews| Index: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp |
| diff --git a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp |
| index 75b2999646e092109c931114f7a27add34ba4c50..cb96550357f76c0ff46d4b17c0e2a2b989927d16 100644 |
| --- a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp |
| +++ b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp |
| @@ -646,6 +646,16 @@ void DeprecatedPaintLayerScrollableArea::updateAfterLayout() |
| { |
| ASSERT(box().hasOverflowClip()); |
| + bool isScrollbarReconstructionRequired = needsScrollbarReconstruction(); |
| + if (m_hBar && !m_hBar->isCustomScrollbar() && isScrollbarReconstructionRequired) { |
| + destroyScrollbar(HorizontalScrollbar); |
|
MuVen
2015/08/13 19:36:32
!m_hBar->isCustomScrollbar() This condition wont t
skobes
2015/08/13 19:53:43
Yes, to make it easier to follow, needsScrollbarRe
|
| + setHasHorizontalScrollbar(true); |
| + } |
| + if (m_vBar && !m_vBar->isCustomScrollbar() && isScrollbarReconstructionRequired) { |
| + destroyScrollbar(VerticalScrollbar); |
| + setHasVerticalScrollbar(true); |
| + } |
| + |
| DoubleSize originalScrollOffset = adjustedScrollOffset(); |
| computeScrollDimensions(); |
| @@ -958,6 +968,12 @@ static inline LayoutObject* layoutObjectForScrollbar(LayoutObject& layoutObject) |
| return &layoutObject; |
| } |
| +bool DeprecatedPaintLayerScrollableArea::needsScrollbarReconstruction() const |
| +{ |
| + LayoutObject* actualLayoutObject = layoutObjectForScrollbar(box()); |
| + return actualLayoutObject->isBox() && actualLayoutObject->style()->hasPseudoStyle(SCROLLBAR); |
|
skobes
2015/08/13 18:12:40
This will reconstruct custom scrollbars after ever
|
| +} |
| + |
| PassRefPtrWillBeRawPtr<Scrollbar> DeprecatedPaintLayerScrollableArea::createScrollbar(ScrollbarOrientation orientation) |
| { |
| RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; |