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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2695493003: Ensure FrameView scrollbars are updated when changing device emulation modes (Closed)
Patch Set: address comments Created 3 years, 10 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: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 9ae55ed20665f955d7a518ac1f96944bb4a3a4e1..bf1d8a74e50bcb166dee3b34bfc15cc64bc43abd 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -2800,6 +2800,12 @@ void FrameView::didChangeGlobalRootScroller() {
return;
// Avoid drawing two sets of scrollbars when visual viewport is enabled.
+ visualViewportScrollbarsChanged();
+}
+
+// TODO(pdr): This logic is similar to adjustScrollbarExistence and the common
+// logic should be factored into a helper.
+void FrameView::visualViewportScrollbarsChanged() {
bool hasHorizontalScrollbar = horizontalScrollbar();
bool hasVerticalScrollbar = verticalScrollbar();
bool shouldHaveHorizontalScrollbar = false;
@@ -2810,8 +2816,12 @@ void FrameView::didChangeGlobalRootScroller() {
m_scrollbarManager.setHasVerticalScrollbar(shouldHaveVerticalScrollbar);
if (hasHorizontalScrollbar != shouldHaveHorizontalScrollbar ||
- hasVerticalScrollbar != shouldHaveVerticalScrollbar)
+ hasVerticalScrollbar != shouldHaveVerticalScrollbar) {
scrollbarExistenceDidChange();
+
+ if (!visualViewportSuppliesScrollbars())
+ updateScrollbarGeometry();
+ }
}
void FrameView::updateWidgetGeometriesIfNeeded() {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/VisualViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698