-
Notifications
You must be signed in to change notification settings - Fork 27
Implement <select> parser "relaxation" — for "customizable" <select> #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Conversation
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
@sideshowbarker
sideshowbarker
force-pushed
the
sideshowbarker/relaxed-select-parsing
branch
from
December 30, 2025 03:01
7a83606 to
cdf2934
Compare
This change make our test harness skip 13 tests for foreign-content fragment parsing that have been failing from some time now. They’re not regressions — or not recent regressions at least — so, we can essentially treat them as "known to fail" for the time being.
This change, in order to support the "customizable" <select> element: - "relaxes" parsing rules in <select> (to allow more elements as children) - adds the <selectedcontent> element for cloning selected <option> content ElementName.java ---------------- - Add <selectedcontent> element with TreeBuilder.SELECTEDCONTENT group TreeBuilder.java ---------------- - Add SELECTEDCONTENT group constant and IN_SELECT_IN_CONTENT mode - Track selectedContentPointer and activeOptionStackPos for cloning - Allow <div>, <span>, and other elements in <select> in "relaxed" mode - Deep clone <option> content to <selectedcontent> when <option> closes - Handle <selectedcontent> special-casing (store pointer, no stack push) SAXTreeBuilder.java ------------------- - Implement clearSelectedContentChildren() for clearing before clone - Implement deepCloneChildren() and deepCloneNode() for <option> cloning ParentNode.java --------------- - Add clearChildren() method, to support clearing <selectedcontent> html5lib-tests submodule ------------------------ - Updated to pull in corresponding tests for "relaxed" <select> parsing
@sideshowbarker
sideshowbarker
force-pushed
the
sideshowbarker/relaxed-select-parsing
branch
from
December 30, 2025 08:00
cdf2934 to
a1d8a3d
Compare
Member
hsivonen
commented
Jan 12, 2026
Sorry I missed this over the holidays.
Member
Author
sideshowbarker
commented
Jan 12, 2026
Sorry I missed this over the holidays.
No worries — there's no real rush on it
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.
Uh oh!
There was an error while loading. Please reload this page.
This change, in order to support the "customizable"
selectelement:select(to allow more elements as children)selectedcontentelement for cloning selectedoptioncontentElementName.javaselectedcontentelement withTreeBuilder.SELECTEDCONTENTgroupTreeBuilder.javaSELECTEDCONTENTgroup constant andIN_SELECT_IN_CONTENTmodeselectedContentPointerandactiveOptionStackPosfor cloningdiv,span, and other elements inselectin "relaxed" modeoptioncontent toselectedcontentwhenoptionclosesselectedcontentspecial-casing (store pointer, no stack push)SAXTreeBuilder.javaclearSelectedContentChildren()for clearing before clonedeepCloneChildren()anddeepCloneNode()foroptioncloningParentNode.javaclearChildren()method, to support clearingselectedcontenthtml5lib-tests(submodule)selectparsing