Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1307173007: Reconstruct customscrollbars if owningLayoutObject changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698