Uh oh!
There was an error while loading. Please reload this page.
Fix <input><option> test case - #195
Conversation
When the changes were made to <select>, the test suite was updated (html5lib#178). As part of this an <input> was added to the serialization of the <input><option> case. This doesn't match the spec though. In particular in 'A start tag whose tag name is "input"' in 13.2.6.4.7 says that "If the parser was created as part of the HTML fragment parsing algorithm (fragment case) and the context element passed to that algorithm is a select element" then the token should be ignored. Since the context for the <input><option> case is "select", the input token should be ignored, resulting in a tree that contains just <option>.
josepharhar
commented
May 5, 2026
Thanks for finding this! I created an HTML spec PR which removes this special case for input tags in order to match the current test without this PR: whatwg/html#12420 |
josepharhar
commented
May 5, 2026
After doing some more digging, I found a reason that this case was added to the spec: whatwg/html#10557 (comment) I must have just forgotten to implement it in chromium. In order to support the filtering use case I'd like to support parsing input inside select in certain cases, but I suppose that we can try to make the fragment parsing in select case match the regular parsing case. With this in mind, I approve of this PR. |
EmilStenstrom
commented
May 12, 2026
@josepharhar What's the process to merge? Are you doing one reviewer and a separate merger? |
josepharhar
commented
May 12, 2026
I don't have permissions to merge this but I think @annevk does |
Uh oh!
There was an error while loading. Please reload this page.
When the changes were made to
<select>, the test suite was updated (#178). As part of this an<input>was added to the serialization of the<input><option>case.This doesn't match the spec though. In particular in 'A start tag whose tag name is "input"' in 13.2.6.4.7 says that "If the parser was created as part of the HTML fragment parsing algorithm (fragment case) and the context element passed to that algorithm is a select element" then the token should be ignored.
Since the context for the
<input><option>case is "select", the input token should be ignored, resulting in a tree that contains just<option>.Firefox and Safari seem to agree here: https://wpt.fyi/results/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html?label=experimental&label=master&aligned.
cc @josepharhar who wrote the spec change and updated the test suite.