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

Unified Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 643933002: Remove Overlay Scrollbar if not scrollable along the axis (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased to TOT Created 6 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
Index: Source/core/rendering/RenderLayerScrollableArea.cpp
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index 69884479df62801e90c339d3544f19e4d144ce19..5a085bee6c4e903d6a0a7a4a3f99ffa8e8c29a1f 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -611,12 +611,17 @@ void RenderLayerScrollableArea::updateAfterLayout()
DisableCompositingQueryAsserts disabler;
// overflow:scroll should just enable/disable.
- if (box().style()->overflowX() == OSCROLL)
+ if (box().style()->overflowX() == OSCROLL && horizontalScrollbar())
MuVen 2014/10/13 15:45:01 This checks fixes webkit_unit_tests crashes on and
horizontalScrollbar()->setEnabled(hasHorizontalOverflow);
- if (box().style()->overflowY() == OSCROLL)
+ if (box().style()->overflowY() == OSCROLL && verticalScrollbar())
verticalScrollbar()->setEnabled(hasVerticalOverflow);
}
-
+ if (hasOverlayScrollbars()) {
+ if (!scrollSize(HorizontalScrollbar))
+ setHasHorizontalScrollbar(false);
+ if (!scrollSize(VerticalScrollbar))
+ setHasVerticalScrollbar(false);
+ }
// overflow:auto may need to lay out again if scrollbars got added/removed.
bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);

Powered by Google App Engine
This is Rietveld 408576698