🐛 fix: pop open select for a keygen start tag in select mode#154
Merged
Conversation
The "in select" insertion mode pops an open select for an input, keygen, or textarea start tag (ignoring it in a select-context fragment). turbohtml implemented this for input but let keygen fall through to a normal insert, nesting it inside the select. Handle keygen alongside input. html5lib's library and the WHATWG algorithm pop the select; the pinned html5lib-tests .dat predates the keygen rule and still nests it, so the two affected cases are pinned to the spec-correct trees through the existing override table.
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.
parse("<select><keygen>z")nested thekeygeninside the open<select>instead of popping the select and placingkeygenas a sibling after it. The WHATWG "in select" insertion mode handlesinput,keygen, andtextareathe same way — pop until the select is popped, then reprocess (and ignore the token in a select-context fragment that has no select in scope). turbohtml implemented this forinputbut letkeygenfall through to a plain insert. Closes #93.keygennow goes through the same handler asinput. I verified the direction against the reference: html5lib's library pops the select (keygen becomes a sibling) for a document and ignores keygen in aselectfragment, matching the algorithm. The pinned html5lib-tests.datpredates the keygen rule and still nests it, so the two affected cases (tests7.dat<select><keygen>,tests_innerHTML_1.dat<keygen><option>inselect) are pinned to the spec-correct trees through the existing_SPEC_OVERRIDEStable — the same mechanism already used for the stale foreign</p>/</br>cases (#32/#63).No benchmark: the change adds
keygento an existing start-tag branch, off any hot path.