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

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

Issue 2759213002: Add auto scrollbars if content would be visible without them. (Closed)
Patch Set: test Created 3 years, 9 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 2567e0ba6677a2ff442c5482a7eaf3cdc3c1887a..b0f796cc3b4d8b7b6ee4a481e9f57a65d7158d69 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -567,4 +567,33 @@ TEST_F(PaintLayerScrollableAreaTest, IncludeOverlayScrollbarsInVisibleWidth) {
scrollableArea->setScrollOffset(ScrollOffset(100, 0), ClampingScroll);
EXPECT_EQ(scrollableArea->getScrollOffset().width(), 0);
}
+
+TEST_F(PaintLayerScrollableAreaTest, ShowAutoScrollbarsForVisibleContent) {
+ RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
+ setBodyInnerHTML(
+ "<style>"
+ "#outerDiv {"
+ " width: 15px;"
+ " height: 100px;"
+ " overflow-y: auto;"
+ " overflow-x: hidden;"
+ "}"
+ "#innerDiv {"
+ " height:300px;"
+ " width: 1px;"
+ "}"
+ "</style>"
+ "<div id='outerDiv'>"
+ " <div id='innerDiv'></div>"
+ "</div>");
+ document().view()->updateAllLifecyclePhases();
+ Element* outerDiv = document().getElementById("outerDiv");
+ ASSERT_TRUE(outerDiv);
+ outerDiv->layoutObject()->setNeedsLayout("test");
+ document().view()->updateAllLifecyclePhases();
+ PaintLayerScrollableArea* scrollableArea =
+ toLayoutBoxModelObject(outerDiv->layoutObject())->getScrollableArea();
+ ASSERT_TRUE(scrollableArea);
+ EXPECT_TRUE(scrollableArea->hasVerticalScrollbar());
+}
}
« 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