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

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

Issue 2725763002: Account for overlay scrollbars when computing scrollbar width/height. (Closed)
Patch Set: rebase 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.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/PaintLayerScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
index 216494bd2f8b0bf9b850bd7a310b20c746e8bf6a..2567e0ba6677a2ff442c5482a7eaf3cdc3c1887a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -10,6 +10,7 @@
#include "core/paint/PaintLayer.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/scroll/ScrollTypes.h"
+#include "platform/scroll/ScrollbarTheme.h"
#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -548,4 +549,22 @@ TEST_F(PaintLayerScrollableAreaTest, HideTooltipWhenScrollPositionChanges) {
.Times(0);
scrollableArea->setScrollOffset(ScrollOffset(2, 2), ProgrammaticScroll);
}
+
+TEST_F(PaintLayerScrollableAreaTest, IncludeOverlayScrollbarsInVisibleWidth) {
+ RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
+ setBodyInnerHTML(
+ "<style>"
+ "#scroller { overflow: overlay; height: 100px; width: 100px; }"
+ "#scrolled { width: 100px; height: 200px; }"
+ "</style>"
+ "<div id=\"scroller\"><div id=\"scrolled\"></div></div>");
+ document().view()->updateAllLifecyclePhases();
+ Element* scroller = document().getElementById("scroller");
+ ASSERT_TRUE(scroller);
+ PaintLayerScrollableArea* scrollableArea =
+ toLayoutBoxModelObject(scroller->layoutObject())->getScrollableArea();
+ ASSERT_TRUE(scrollableArea);
+ scrollableArea->setScrollOffset(ScrollOffset(100, 0), ClampingScroll);
+ EXPECT_EQ(scrollableArea->getScrollOffset().width(), 0);
+}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698