Skip to content

Ensure validateDOMNesting catches nested body elements - #6469

Merged
sophiebits merged 1 commit into
react:masterfrom
keyz:validate-foreignObject-children
Apr 15, 2016
Merged

sophiebits merged 1 commit into
react:masterfrom
keyz:validate-foreignObject-children

Conversation

@keyz

@keyz keyz commented Apr 9, 2016

Copy link
Copy Markdown
Contributor

This commit fixes #6280.

Instead of adding a new list of rules to handle foreignObject, I think the actual problem is that we don't have a clause that handles another body in "in body" parsing mode (e.g., pass this html snippet to the W3C validator to see the error message: "Start tag body seen but an element of the same type was already open").

Thanks for reviewing! I could be totally wrong so any feedback is greatly appreciated.

cc @spicyj @toddgeist

@keyz

keyz commented Apr 14, 2016

Copy link
Copy Markdown
Contributor Author

ping

@sophiebits

Copy link
Copy Markdown
Contributor

Yes, I think this seems reasonable. Thank you!

Can you move body to the top so it's still alphabetically sorted?

@jimfb

jimfb commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

Wait a second... I think this would break full-page rendering. While we generally recommend against FPR, it is a use case that people utilize. We should add a test that rendering <html><body><div /></body><html> won't emit a warning.

@sophiebits

Copy link
Copy Markdown
Contributor

@jimfb Line 187 should account for that.

@sophiebits

Copy link
Copy Markdown
Contributor

Also line 70 of the test.

@jimfb

jimfb commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

Oh, ok, I'm good with that.

@sophiebits

Copy link
Copy Markdown
Contributor

We do have a test.

@keyz
keyz force-pushed the validate-foreignObject-children branch from fa748de to 6cf77ef Compare April 15, 2016 00:15
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@keyanzhang updated the pull request.

@keyz

keyz commented Apr 15, 2016

Copy link
Copy Markdown
Contributor Author

Yep, I fixed the order. Thanks! @jimfb @spicyj

@sophiebits
sophiebits merged commit 4016e71 into react:master Apr 15, 2016
@keyz
keyz deleted the validate-foreignObject-children branch April 15, 2016 01:28
@sophiebits

Copy link
Copy Markdown
Contributor

Thanks @keyanzhang!

@zpao zpao modified the milestones: 15.0.x, 15.0.2 Apr 22, 2016
zpao pushed a commit that referenced this pull request Apr 28, 2016
Ensure validateDOMNesting catches nested body elements
(cherry picked from commit 4016e71)
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
…children

Ensure validateDOMNesting catches nested body elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server Rendering SVG foreignObject body tag w 15rc2 results in missing ID error

5 participants