Merge pull request #6469 from keyanzhang/validate-foreignObject-children

Ensure validateDOMNesting catches nested body elements
This commit is contained in:
Ben Alpert
2016-04-14 18:27:13 -07:00
2 changed files with 3 additions and 0 deletions
@@ -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);
});
});
@@ -208,6 +208,7 @@ if (__DEV__) {
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;
case 'body':
case 'caption':
case 'col':
case 'colgroup':