Fix <input><option> test case#195
Open
rolandshoemaker wants to merge 1 commit intohtml5lib:masterfrom
Open
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>.
6 tasks
Contributor
|
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 |
Contributor
|
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. |
josepharhar
approved these changes
May 5, 2026
txgk
added a commit
to gumbo-parser/gumbo-parser
that referenced
this pull request
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.