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 87dd24a0fc8f655055b21fc360ebbc36a5a4dcf9..843ced35694e7bb2c25b9425be2407ebccf13e07 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -1016,7 +1016,19 @@ bool PaintLayerScrollableArea::needsScrollbarReconstruction() const |
bool shouldUseCustom = actualLayoutObject.isBox() && actualLayoutObject.styleRef().hasPseudoStyle(SCROLLBAR); |
bool hasAnyScrollbar = hasScrollbar(); |
bool hasCustom = (hasHorizontalScrollbar() && horizontalScrollbar()->isCustomScrollbar()) || (hasVerticalScrollbar() && verticalScrollbar()->isCustomScrollbar()); |
- return hasAnyScrollbar && (shouldUseCustom != hasCustom); |
+ bool didCustomScrollbarOwnerChanged = false; |
+ |
+ if (hasHorizontalScrollbar() && horizontalScrollbar()->isCustomScrollbar()) { |
+ if (actualLayoutObject != toLayoutScrollbar(horizontalScrollbar())->owningLayoutObject()) |
+ didCustomScrollbarOwnerChanged = true; |
+ } |
+ |
+ if (hasVerticalScrollbar() && verticalScrollbar()->isCustomScrollbar()) { |
+ if (actualLayoutObject != toLayoutScrollbar(verticalScrollbar())->owningLayoutObject()) |
+ didCustomScrollbarOwnerChanged = true; |
+ } |
+ |
+ return hasAnyScrollbar && ((shouldUseCustom != hasCustom) || (shouldUseCustom && didCustomScrollbarOwnerChanged)); |
} |
void PaintLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar) |