Skip to content

Commit

Permalink
Merge pull request #6469 from keyanzhang/validate-foreignObject-children
Browse files Browse the repository at this point in the history
Ensure validateDOMNesting catches nested body elements
(cherry picked from commit 4016e71)
  • Loading branch information
sophiebits authored and zpao committed Apr 28, 2016
1 parent d2b947c commit afba0f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/renderers/dom/client/__tests__/validateDOMNesting-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ describe('ReactContextValidator', function() {
expect(isTagStackValid(['table', 'tr'])).toBe(false);
expect(isTagStackValid(['div', 'ul', 'li', 'div', 'li'])).toBe(false);
expect(isTagStackValid(['div', 'html'])).toBe(false);
expect(isTagStackValid(['body', 'body'])).toBe(false);
expect(isTagStackValid(['svg', 'foreignObject', 'body', 'p'])).toBe(false);
});
});
1 change: 1 addition & 0 deletions src/renderers/dom/client/validateDOMNesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ if (__DEV__) {
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;

case 'body':
case 'caption':
case 'col':
case 'colgroup':
Expand Down

0 comments on commit afba0f3

Please sign in to comment.