Repository navigation
Add HTML processing instruction tokenizer states - #130
Open
hjanuschka wants to merge 1 commit into
Open
hjanuschka wants to merge 1 commit into
hjanuschka wants to merge 1 commit into
Conversation
Implements the processing instruction states added to the HTML Standard by whatwg/html#11818 for the declarative partial updates proposal, behind a new Tokenizer.setProcessingInstructionsEnabled() switch that defaults to false so existing behavior is unchanged. When enabled, <? in the tag open state starts a processing instruction instead of a bogus comment. Valid targets produce a new TokenHandler processingInstruction() token with the target and data; invalid first characters, invalid target characters, and the disallowed "xml" and "xml-stylesheet" targets fall back to the bogus comment state with the legacy comment data. A processing instruction truncated by EOF emits nothing, per the spec. The TreeBuilder handles the token like a comment token for insertion purposes, and the DOM, SAX and XOM tree builders create the corresponding processing instruction nodes.
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.
implements the PI tokenizer states from whatwg/html#11818 (declarative partial updates / , mozilla bug 2053472) behind Tokenizer.setProcessingInstructionsEnabled(), default false so nothing changes for existing users.
invalid and disallowed targets fall back to the bogus comment state with the legacy comment data, EOF inside a PI emits nothing, and the spec's named parse errors are wired through ErrorReportingTokenizer. the DOM, SAX and XOM tree builders create the matching PI nodes.
the Gecko side re-translates from this and is staged behind dom.template_for.enabled (https://phabricator.services.mozilla.com/D331109), so naming or shape feedback here lands there automatically.