Clarify that foreign content is not an insertion mode#12700
Open
annevk wants to merge 1 commit into
Open
Conversation
The rules for parsing tokens in foreign content are selected per token by the tree construction dispatcher and leave the insertion mode unchanged. Follow-up to whatwg#12658. Fixes whatwg#4015.
sirreal
reviewed
Jul 17, 2026
sirreal
left a comment
Contributor
There was a problem hiding this comment.
The added note seems accurate and adds a useful clarification. I think some details could be omitted, the important point is that "foreign content" is not an insertion mode and functions independently.
It seems most useful around the section that describes the insertion mode.
I just spotted a related line that needs to be changed, refers to foreign content as an insertion mode (13.2.5.69 CDATA section state):
U+0000 NULL characters are handled in the tree construction stage, as part of the in foreign content insertion mode, which is the only place where CDATA sections can appear.
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.
The rules for parsing tokens in foreign content are selected per token by the tree construction dispatcher based on the adjusted current node, and leave the insertion mode unchanged; they are not themselves an insertion mode. This was implied by the heading structure and the insertion mode enumeration but never stated.
Follow-up to #12658. Fixes #4015.
/parsing.html ( diff )