Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

zcorpan
Copy link
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
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
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.
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