Skip to content

Clarify that foreign content is not an insertion mode#12700

Open
annevk wants to merge 1 commit into
whatwg:mainfrom
annevk:foreign-content-not-insertion-mode
Open

Clarify that foreign content is not an insertion mode#12700
annevk wants to merge 1 commit into
whatwg:mainfrom
annevk:foreign-content-not-insertion-mode

Conversation

@annevk

@annevk annevk commented Jul 17, 2026

Copy link
Copy Markdown
Member

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 )

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 sirreal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

"in foreign content" is missing from list of insertion modes

2 participants