Skip to content

Commit 22876fe

Browse files
committed
fix(compiler-dom): update HTML nesting validation for Chrome 134+
Allow new HTML5 nesting patterns: - button as child of select - inline elements (span, b, i, strong, em) as children of option This aligns with the latest HTML specifications supported in Chrome 134+ while maintaining validation for invalid block-level elements. close #13608
1 parent 76af4c2 commit 22876fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/compiler-dom/src/htmlNesting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const onlyValidChildren: Record<string, Set<string>> = {
6363
'template',
6464
]),
6565
optgroup: new Set(['option']),
66-
select: new Set(['optgroup', 'option', 'hr']),
66+
select: new Set(['optgroup', 'option', 'hr', 'button']),
6767
// table
6868
table: new Set(['caption', 'colgroup', 'tbody', 'tfoot', 'thead']),
6969
tr: new Set(['td', 'th']),
@@ -74,7 +74,6 @@ const onlyValidChildren: Record<string, Set<string>> = {
7474
// these elements can not have any children elements
7575
script: emptySet,
7676
iframe: emptySet,
77-
option: emptySet,
7877
textarea: emptySet,
7978
style: emptySet,
8079
title: emptySet,
@@ -108,6 +107,7 @@ const onlyValidParents: Record<string, Set<string>> = {
108107

109108
/** maps element to set of elements that can not be it's children, others can */
110109
const knownInvalidChildren: Record<string, Set<string>> = {
110+
option: new Set(['div', 'p']),
111111
p: new Set([
112112
'address',
113113
'article',

0 commit comments

Comments
 (0)