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

Unified Diff: LayoutTests/fast/forms/select/select-with-display-none-options.html

Issue 189543012: Update <select> when any of its <option> children has "display: none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update Test Expectations Created 6 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
Index: LayoutTests/fast/forms/select/select-with-display-none-options.html
diff --git a/LayoutTests/fast/forms/select/select-with-display-none-options.html b/LayoutTests/fast/forms/select/select-with-display-none-options.html
new file mode 100644
index 0000000000000000000000000000000000000000..6876401e13d3e44f17f8aa1ce4180679c9dcac78
--- /dev/null
+++ b/LayoutTests/fast/forms/select/select-with-display-none-options.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/common.js"></script>
+</head>
+<body>
+
+<select id="select1" size=3>
+<option selected>a</option>
+<option style="display: none">b</option>
+<option>c</option>
+<option>d</option>
+</select>
+
+<select id="select2" size=3>
+<option selected>a</option>
+<option id="select2-b">b</option>
+<option>c</option>
+<option>d</option>
+</select>
+
+<select id="select3" size=3>
+<option selected>a</option>
+<option id='select3-b' style="display: none">b</option>
+<option>c</option>
+<option>d</option>
+</select>
+
+<select id="select4" size=3>
+<option selected>a</option>
+<option>b</option>
+<optgroup label="**cd**">
+ <option style="display: none">c</option>
+ <option>d</option>
+</optgroup>
+</select>
+
+<select id="select5" size=3>
+<option selected>a</option>
+<option>b</option>
+<optgroup label="**cd**" style="display: none">
+ <option>c</option>
+ <option>d</option>
+</optgroup>
+<option>e</option>
+</select>
+
+<script>
+document.getElementById('select2-b').style.display = 'none';
+document.getElementById('select3-b').style.display = 'block';
+
+description('Tests for select not showing option element with display: none');
+
+var select1 = document.getElementById('select1');
+select1.focus();
+shouldBeEqualToString('select1.value', 'a');
+eventSender.keyDown('downArrow');
+shouldBeEqualToString('select1.value', 'c');
+
+var select2 = document.getElementById('select2');
+select2.focus();
+shouldBeEqualToString('select2.value', 'a');
+eventSender.keyDown('downArrow');
+shouldBeEqualToString('select2.value', 'c');
+
+var select3 = document.getElementById('select3');
+select3.focus();
+shouldBeEqualToString('select3.value', 'a');
+eventSender.keyDown('downArrow');
+shouldBeEqualToString('select3.value', 'b');
+
+var select4 = document.getElementById('select4');
+select4.focus();
+shouldBeEqualToString('select4.value', 'a');
+eventSender.keyDown('downArrow');
+eventSender.keyDown('downArrow');
+shouldBeEqualToString('select4.value', 'd');
+
+var select5 = document.getElementById('select5');
+select5.focus();
+shouldBeEqualToString('select5.value', 'a');
+eventSender.keyDown('downArrow');
+eventSender.keyDown('downArrow');
+shouldBeEqualToString('select5.value', 'e');
+
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698