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

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

Issue 2394163002: Fix performance regression and bug with hide_scrollbars setting. (Closed)
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | 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 1196067e9c6eb6914d57bbe11334d570bd5d9d6b..61f8dc43cdd717225dc6e5f145a83518d1726f71 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -691,14 +691,20 @@ void PaintLayerScrollableArea::updateAfterLayout() {
// We need to layout again if scrollbars are added or removed by
// overflow:auto, or by changing between native and custom.
+ DCHECK(box().frame()->settings());
bool horizontalScrollbarShouldChange =
- (box().hasAutoHorizontalScrollbar() &&
- (hasHorizontalScrollbar() != shouldHaveAutoHorizontalScrollbar)) ||
- (box().style()->overflowX() == OverflowScroll && !horizontalScrollbar());
+ ((box().hasAutoHorizontalScrollbar() &&
+ (hasHorizontalScrollbar() != shouldHaveAutoHorizontalScrollbar)) ||
+ (box().style()->overflowX() == OverflowScroll &&
+ !horizontalScrollbar())) &&
+ (!box().frame()->settings()->hideScrollbars() ||
+ hasHorizontalScrollbar());
bool verticalScrollbarShouldChange =
- (box().hasAutoVerticalScrollbar() &&
- (hasVerticalScrollbar() != shouldHaveAutoVerticalScrollbar)) ||
- (box().style()->overflowY() == OverflowScroll && !verticalScrollbar());
+ ((box().hasAutoVerticalScrollbar() &&
+ (hasVerticalScrollbar() != shouldHaveAutoVerticalScrollbar)) ||
+ (box().style()->overflowY() == OverflowScroll &&
+ !verticalScrollbar())) &&
+ (!box().frame()->settings()->hideScrollbars() || hasVerticalScrollbar());
bool scrollbarsWillChange =
!scrollbarsAreFrozen && !visualViewportSuppliesScrollbars() &&
(horizontalScrollbarShouldChange || verticalScrollbarShouldChange);
@@ -938,15 +944,13 @@ void PaintLayerScrollableArea::updateAfterStyleChange(
// 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).
- if (needsHorizontalScrollbar && oldStyle &&
+ if (hasHorizontalScrollbar() && oldStyle &&
oldStyle->overflowX() == OverflowScroll && overflowX != OverflowScroll) {
- ASSERT(hasHorizontalScrollbar());
horizontalScrollbar()->setEnabled(true);
}
- if (needsVerticalScrollbar && oldStyle &&
+ if (hasVerticalScrollbar() && oldStyle &&
oldStyle->overflowY() == OverflowScroll && overflowY != OverflowScroll) {
- ASSERT(hasVerticalScrollbar());
verticalScrollbar()->setEnabled(true);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698