Repository navigation
Add HTML processing instruction tokenizer states - #130
hjanuschka wants to merge 1 commit into
Conversation
|
I think we should allow most of the review to happen in https://phabricator.services.mozilla.com/D331109, and then re-sync once bits land in mozilla-central. |
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.
ae5b885 to
f09725c
Compare
|
Phabricator link for reference: https://phabricator.services.mozilla.com/D334017 |
|
CI wants more overrides of |
hsivonen
left a comment
There was a problem hiding this comment.
Thank you and sorry about the delay. LGTM except the CI failures.
So overrides for the new method are still neeeded in more places.
hsivonen
left a comment
There was a problem hiding this comment.
(Marking request changes for clarity so as to not rely just on the CI indicator for the need for changes.)
|
I have been doing the procedural work of syncing Gecko's revisions back into this repo, and this work landed in 67d4c9b - so we can close this one down now. Good work nonetheless! |
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.