Ensure validateDOMNesting catches nested body elements

This commit is contained in:
Keyan Zhang 2016-04-09 15:49:56 -04:00
parent 6c11bb65e1
commit 6cf77ef55e
2 changed files with 3 additions and 0 deletions

View File

@ -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);
});
});

View File

@ -208,6 +208,7 @@ if (__DEV__) {
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;
case 'body':
case 'caption':
case 'col':
case 'colgroup':