Skip to content

Commit 4016e71

Browse files
committed
Merge pull request #6469 from keyanzhang/validate-foreignObject-children
Ensure validateDOMNesting catches nested body elements
2 parents 6a93137 + 6cf77ef commit 4016e71

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/renderers/dom/client/__tests__/validateDOMNesting-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@ describe('ReactContextValidator', function() {
8383
expect(isTagStackValid(['table', 'tr'])).toBe(false);
8484
expect(isTagStackValid(['div', 'ul', 'li', 'div', 'li'])).toBe(false);
8585
expect(isTagStackValid(['div', 'html'])).toBe(false);
86+
expect(isTagStackValid(['body', 'body'])).toBe(false);
87+
expect(isTagStackValid(['svg', 'foreignObject', 'body', 'p'])).toBe(false);
8688
});
8789
});

src/renderers/dom/client/validateDOMNesting.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ if (__DEV__) {
208208
case 'rt':
209209
return impliedEndTags.indexOf(parentTag) === -1;
210210

211+
case 'body':
211212
case 'caption':
212213
case 'col':
213214
case 'colgroup':

0 commit comments

Comments
 (0)