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

Unified Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2215333002: Fix element visibility check for validation bubbles and SELECT popups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename to visibleBoundsInVisualViewport(), etc. Created 4 years, 4 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/web/tests/VisualViewportTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
index ad5fef436ebe017e872a5a8057abe5741111ea79..cf47dc68ac6357b3affa54b9c037503cf2bde662 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -1544,6 +1544,22 @@ TEST_P(ParameterizedVisualViewportTest, ElementBoundsInViewportSpaceAccountsForV
EXPECT_SIZE_EQ(expectedBounds.size(), boundsInViewport.size());
}
+TEST_P(ParameterizedVisualViewportTest, ElementVisibleBoundsInVisualViewport)
+{
+ initializeWithAndroidSettings();
+ webViewImpl()->resize(IntSize(640, 1080));
+ registerMockedHttpURLLoad("viewport-select.html");
+ navigateTo(m_baseURL + "viewport-select.html");
+
+ ASSERT_EQ(2.0f, webViewImpl()->pageScaleFactor());
+ webViewImpl()->setInitialFocus(false);
+ Element* element = webViewImpl()->focusedElement();
+ EXPECT_FALSE(element->visibleBoundsInVisualViewport().isEmpty());
+
+ webViewImpl()->setPageScaleFactor(4.0);
+ EXPECT_TRUE(element->visibleBoundsInVisualViewport().isEmpty());
+}
+
// Test that the various window.scroll and document.body.scroll properties and
// methods work unchanged from the pre-virtual viewport mode.
TEST_P(ParameterizedVisualViewportTest, bodyAndWindowScrollPropertiesAccountForViewport)

Powered by Google App Engine
This is Rietveld 408576698