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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-outside-viewport.html

Issue 1959583002: Do not open SELECT popup if the SELECT element is not in the viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: popup-menu-key-operations.html needs rebaseline Created 4 years, 7 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/LayoutTests/fast/forms/select/menulist-popup-outside-viewport.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-outside-viewport.html b/third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-outside-viewport.html
new file mode 100644
index 0000000000000000000000000000000000000000..5e7247b0cabc25ebfa203a05a92b56d3ad2a8d57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-outside-viewport.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<body>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+iframe {
+ margin-top: 200px;
+ margin-left: 400px;
+}
+</style>
+<div id="log"></div>
+<iframe srcdoc="<div style='height:400px;'></div><select><option>Option 1</option></select>"></iframe>
+<script>
+window.onload = function() {
+ test(function() {
+ var select = document.querySelector('iframe').contentDocument.querySelector('select');
+ select.focus();
+ // Scroll out the |select|.
+ select.ownerDocument.scrollingElement.scrollTop = 0;
+ // Try to open a popup.
+ eventSender.keyDown(' ');
+ assert_false(internals.isSelectPopupVisible(select));
+ }, 'SELECT element should not open a popup menu if it\'s not in the viewport.');
+};
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698