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> |