Skip to content

HTML parser: fix a regression with foster parenting in foreign content#6455

Merged
domenic merged 1 commit intomainfrom
bocoup/fragment-parsing-svg-p-foster-parenting
Jul 20, 2021
Merged

HTML parser: fix a regression with foster parenting in foreign content#6455
domenic merged 1 commit intomainfrom
bocoup/fragment-parsing-svg-p-foster-parenting

Conversation

@zcorpan
Copy link
Copy Markdown
Member

@zcorpan zcorpan commented Mar 5, 2021

The regression was introduced in f690ad9
(PR #6399)

For this case:

<table><math><p>foo

the <p> token would not have foster parenting enabled, thus inserting it
into the table.

Fixes #6439.

(See WHATWG Working Mode: Changes for more details.)


/parsing.html ( diff )

The regression was introduced in f690ad9
(PR #6399)

For this case:
```
<table><math><p>foo
```
the `<p>` token would not have foster parenting enabled, thus inserting it
into the table.

Fixes #6439.
@zcorpan zcorpan requested a review from hsivonen March 5, 2021 11:04
TRowbotham added a commit to TRowbotham/PHPDOM that referenced this pull request Apr 1, 2021
Fixes html tags being nested inside svg and math tags. Uses the proposed
spec changes from whatwg/html#6399 and whatwg/html#6455
@domenic
Copy link
Copy Markdown
Member

domenic commented Jul 16, 2021

@zcorpan am I correct that this is already implemented in Chrome and Safari? In that case we have implementer interest and should merge this.

@zcorpan
Copy link
Copy Markdown
Member Author

zcorpan commented Jul 20, 2021

Yes. It's implemented in Gecko as well, in that it will also foster parent the <p>.

@domenic domenic merged commit c619ded into main Jul 20, 2021
@domenic domenic deleted the bocoup/fragment-parsing-svg-p-foster-parenting branch July 20, 2021 17:21
stevecheckoway added a commit to sparklemotion/nokogiri that referenced this pull request Oct 13, 2021
The first comment is incorrect. The fragment case was changed to match
the nonfragment case in whatwg/html#6399.

This introduced a bug that was noted by the second comment indicating
that the parser diverged from the standard to fix the bug. The standard
was subsequently fixed in whatwg/html#6455,
obviating the comment.
fb55 added a commit to inikulin/parse5 that referenced this pull request Mar 13, 2022
The behaviour for parsing foreign content was updated in whatwg/html#6455 and whatwg/html#6736. This catches us up to the current specced behaviour.
txgk added a commit to gumbo-parser/gumbo-parser that referenced this pull request Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

HTML parser test failures after #6993

3 participants