Skip to content

Commit c4c6722

Browse files
Change parser behavior of <select><select>
This patch makes the HTML parser convert nested <select> tags into </select> instead of </select><select> for backwards compatibility with the old parser. This behavior will apply to any nested selects, such as <select><div><select>. This was recommended here: whatwg/html#10557 (comment) This will be tested here: html5lib/html5lib-tests#178 (comment) Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6040687 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: David Baron <[email protected]> Cr-Commit-Position: refs/heads/main@{#1391787}
1 parent fa70881 commit c4c6722

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

html/semantics/forms/the-select-element/customizable-select/select-parsing.tentative.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@
104104
const outerSelect = document.getElementById('nested1');
105105
const innerSelect = document.getElementById('expectafter1');
106106
const nextDiv = document.getElementById('expectafter1b');
107-
assert_true(!!outerSelect && !!innerSelect);
108-
assert_equals(outerSelect.nextSibling, innerSelect,'Nested select should be pushed out as the next sibling');
109-
assert_equals(innerSelect.nextElementSibling, nextDiv,'Subsequent content is there too');
107+
assert_true(!!outerSelect);
108+
assert_equals(innerSelect, null,'Nested select should be removed');
109+
assert_equals(outerSelect.nextElementSibling, nextDiv,'Subsequent content is there too');
110110
}, 'Nested selects should be retained 1');
111111

112112
test(() => {
113113
const outerSelect = document.getElementById('nested2');
114114
const innerSelect = document.getElementById('expectafter2');
115-
assert_true(!!outerSelect && !!innerSelect);
116-
assert_equals(outerSelect.nextSibling, innerSelect,'Nested select should be pushed out as the next sibling');
115+
assert_true(!!outerSelect);
116+
assert_equals(innerSelect, null,'Nested select should be pushed out as the next sibling');
117117
}, 'Nested selects should be retained 2');
118118
</script>

0 commit comments

Comments
 (0)