@@ -27,6 +27,31 @@ describe('validate html nesting', () => {
27
27
} )
28
28
expect ( err ) . toBeUndefined ( )
29
29
} )
30
+
31
+ // #13608 - Chrome 134+ HTML5 spec updates
32
+ it ( 'should not warn with select > button' , ( ) => {
33
+ let err : CompilerError | undefined
34
+ compile ( `<select><button>Click me</button></select>` , {
35
+ onWarn : e => ( err = e ) ,
36
+ } )
37
+ expect ( err ) . toBeUndefined ( )
38
+ } )
39
+
40
+ it ( 'should not warn with option > span' , ( ) => {
41
+ let err : CompilerError | undefined
42
+ compile ( `<select><option><span>Styled text</span></option></select>` , {
43
+ onWarn : e => ( err = e ) ,
44
+ } )
45
+ expect ( err ) . toBeUndefined ( )
46
+ } )
47
+
48
+ it ( 'should not warn with option > b' , ( ) => {
49
+ let err : CompilerError | undefined
50
+ compile ( `<select><option><b>Bold text</b></option></select>` , {
51
+ onWarn : e => ( err = e ) ,
52
+ } )
53
+ expect ( err ) . toBeUndefined ( )
54
+ } )
30
55
} )
31
56
32
57
/**
@@ -148,6 +173,29 @@ describe('isValidHTMLNesting', () => {
148
173
expect ( isValidHTMLNesting ( 'h1' , 'div' ) ) . toBe ( true )
149
174
} )
150
175
176
+ test ( 'select - Chrome 134+ allows button as child' , ( ) => {
177
+ // These should be valid according to new HTML5 spec (Chrome 134+)
178
+ expect ( isValidHTMLNesting ( 'select' , 'button' ) ) . toBe ( true )
179
+
180
+ // Traditional valid children should still work
181
+ expect ( isValidHTMLNesting ( 'select' , 'option' ) ) . toBe ( true )
182
+ expect ( isValidHTMLNesting ( 'select' , 'optgroup' ) ) . toBe ( true )
183
+ expect ( isValidHTMLNesting ( 'select' , 'hr' ) ) . toBe ( true )
184
+ } )
185
+
186
+ test ( 'option - Chrome 134+ allows styled content' , ( ) => {
187
+ // These should be valid according to new HTML5 spec (Chrome 134+)
188
+ expect ( isValidHTMLNesting ( 'option' , 'span' ) ) . toBe ( true )
189
+ expect ( isValidHTMLNesting ( 'option' , 'b' ) ) . toBe ( true )
190
+ expect ( isValidHTMLNesting ( 'option' , 'i' ) ) . toBe ( true )
191
+ expect ( isValidHTMLNesting ( 'option' , 'strong' ) ) . toBe ( true )
192
+ expect ( isValidHTMLNesting ( 'option' , 'em' ) ) . toBe ( true )
193
+
194
+ // Block-level elements might still be invalid
195
+ expect ( isValidHTMLNesting ( 'option' , 'div' ) ) . toBe ( false )
196
+ expect ( isValidHTMLNesting ( 'option' , 'p' ) ) . toBe ( false )
197
+ } )
198
+
151
199
describe ( 'SVG' , ( ) => {
152
200
test ( 'svg' , ( ) => {
153
201
// invalid non-svg tags as children
0 commit comments