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

Unified Diff: Source/WebKit/chromium/tests/WebFrameTest.cpp

Issue 14874002: Allow frames with overflow:hidden scroll in slow scrolling path when scaled up (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unnecessary changes Created 7 years, 8 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 | Source/core/page/FrameView.h » ('j') | Source/core/page/FrameView.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/WebFrameTest.cpp
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
index 0e1b4de722a4b1ca59effa82db42f592d35211f5..c1a8d9e72ad9add67b81ed3891022bd8bb5bc3c4 100644
--- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
@@ -2999,5 +2999,41 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollShortPage)
m_webView = 0;
}
+TEST_F(WebFrameTest, OverflowHiddenScrollable)
+{
+ WebCore::Settings::setMockScrollbarsEnabled(true);
+ WebCore::Settings::setUsesOverlayScrollbars(true);
+ EXPECT_TRUE(WebCore::ScrollbarTheme::theme()->usesOverlayScrollbars());
+
+ registerMockedHttpURLLoad("clipped-body.html");
+
+ FixedLayoutTestWebViewClient client;
+ client.m_screenInfo.deviceScaleFactor = 1;
+ int fixedLayoutWidth = 500; // Smaller than the full content width 1000. "overflow-x: hidden" will clip in this direction.
+ int fixedLayoutHeight = 3000; // Bigger than the full content height 1000 which won't be clipped.
+
+ m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "clipped-body.html", true, 0, &client);
+ m_webView->enableFixedLayoutMode(true);
+ m_webView->settings()->setViewportEnabled(true);
+ m_webView->resize(WebSize(fixedLayoutWidth, fixedLayoutHeight));
+ m_webView->layout();
+
+ WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
+ WebCore::FrameView* frameView = webViewImpl->mainFrameImpl()->frameView();
+ m_webView->setFixedLayoutSize(WebSize(fixedLayoutWidth, fixedLayoutHeight));
+ m_webView->layout();
+
+ EXPECT_EQ(fixedLayoutWidth, frameView->contentsWidth());
+ EXPECT_EQ(fixedLayoutWidth, frameView->visibleWidth());
+ EXPECT_FALSE(frameView->isScrollable());
+
+ m_webView->setPageScaleFactorPreservingScrollOffset(2);
+ m_webView->layout();
+
+ EXPECT_EQ(fixedLayoutWidth / 2, frameView->visibleWidth());
+ EXPECT_EQ(fixedLayoutWidth, frameView->contentsWidth());
+ EXPECT_TRUE(frameView->isScrollable());
+ EXPECT_EQ(fixedLayoutWidth / 2, frameView->maximumScrollPosition().x());
+}
} // namespace
« no previous file with comments | « no previous file | Source/core/page/FrameView.h » ('j') | Source/core/page/FrameView.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698