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

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

Issue 1308173005: Lookout for the scrollbarModes when force style change occurs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased to latest Created 5 years, 3 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/DeprecatedPaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
index 7f23aa54fe791c3f63dc5aa6d0b9e115c2104ec2..0e4126522dbc5d98ee2da231907a0036d4c5df2c 100644
--- a/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
@@ -844,6 +844,24 @@ void DeprecatedPaintLayerScrollableArea::updateAfterStyleChange(const ComputedSt
// To avoid doing a relayout in updateScrollbarsAfterLayout, we try to keep any automatic scrollbar that was already present.
bool needsHorizontalScrollbar = (hasHorizontalScrollbar() && overflowDefinesAutomaticScrollbar(overflowX)) || overflowRequiresScrollbar(overflowX);
bool needsVerticalScrollbar = (hasVerticalScrollbar() && overflowDefinesAutomaticScrollbar(overflowY)) || overflowRequiresScrollbar(overflowY);
+
+ // Look for the scrollbarModes and reset the needs Horizontal & vertical Scrollbar values based on scrollbarModes, as during force style change
+ // StyleResolver::styleForDocument returns documentStyle with no overflow values, due to which we are destorying the scrollbars that was
+ // already present.
+ if (box().isLayoutView()) {
+ if (LocalFrame* frame = box().frame()) {
+ if (FrameView* frameView = frame->view()) {
+ ScrollbarMode hMode;
+ ScrollbarMode vMode;
+ frameView->calculateScrollbarModes(hMode, vMode);
+ if (hMode == ScrollbarAlwaysOn && !needsHorizontalScrollbar)
+ needsHorizontalScrollbar = true;
+ if (vMode == ScrollbarAlwaysOn && !needsVerticalScrollbar)
+ needsVerticalScrollbar = true;
+ }
+ }
+ }
+
setHasHorizontalScrollbar(needsHorizontalScrollbar);
setHasVerticalScrollbar(needsVerticalScrollbar);
« 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