Skip to content

Commit

Permalink
Bug 1935213 [wpt PR 49525] - Change parser behavior of <select><selec…
Browse files Browse the repository at this point in the history
…t>, a=testonly

Automatic update from web-platform-tests
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}

--

wpt-commits: c4c67222e7b0677f92f43280837db48473603f1e
wpt-pr: 49525
  • Loading branch information
josepharhar authored and moz-wptsync-bot committed Dec 10, 2024
1 parent 482853e commit 4cd7eba
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@
const outerSelect = document.getElementById('nested1');
const innerSelect = document.getElementById('expectafter1');
const nextDiv = document.getElementById('expectafter1b');
assert_true(!!outerSelect && !!innerSelect);
assert_equals(outerSelect.nextSibling, innerSelect,'Nested select should be pushed out as the next sibling');
assert_equals(innerSelect.nextElementSibling, nextDiv,'Subsequent content is there too');
assert_true(!!outerSelect);
assert_equals(innerSelect, null,'Nested select should be removed');
assert_equals(outerSelect.nextElementSibling, nextDiv,'Subsequent content is there too');
}, 'Nested selects should be retained 1');

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

0 comments on commit 4cd7eba

Please sign in to comment.