File tree Expand file tree Collapse file tree
css/css-typed-om/the-stylepropertymap Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414test ( t => {
1515 const styleMap = createComputedStyleMap ( t , '--foo: auto' ) ;
16- assert_equals ( styleMap . get ( '--Foo' ) , null ) ;
17- } , 'Getting a custom property not in the computed style returns null ' ) ;
16+ assert_equals ( styleMap . get ( '--Foo' ) , undefined ) ;
17+ } , 'Getting a custom property not in the computed style returns undefined ' ) ;
1818
1919test ( t => {
2020 const styleMap = createComputedStyleMap ( t , 'width: 10px; height: 20px' ) ;
Original file line number Diff line number Diff line change 2121 let styleMap = createInlineStyleMap ( t , '--foo: auto; width: 10px; transition-duration: 1s, 2s' ) ;
2222
2323 styleMap . clear ( ) ;
24- assert_equals ( styleMap . get ( '--foo' ) , null ,
24+ assert_equals ( styleMap . get ( '--foo' ) , undefined ,
2525 'Custom properties should be cleared' ) ;
26- assert_equals ( styleMap . get ( 'width' ) , null ,
26+ assert_equals ( styleMap . get ( 'width' ) , undefined ,
2727 'CSS properties should be cleared' ) ;
28- assert_equals ( styleMap . get ( 'transition-duration' ) , null ,
28+ assert_equals ( styleMap . get ( 'transition-duration' ) , undefined ,
2929 'List-valued properties should be cleared' ) ;
3030 assert_array_equals ( [ ...styleMap ] , [ ] ) ;
3131} , 'Can clear a CSS rule containing properties' ) ;
Original file line number Diff line number Diff line change 4040} , 'Declared StylePropertyMap contains CSS property declarations in style rules' ) ;
4141
4242test ( ( ) => {
43- assert_equals ( styleMap . get ( 'top' ) , null ) ;
44- assert_equals ( styleMap . get ( '--bar' ) , null ) ;
43+ assert_equals ( styleMap . get ( 'top' ) , undefined ) ;
44+ assert_equals ( styleMap . get ( '--bar' ) , undefined ) ;
4545} , 'Declared StylePropertyMap does not contain inline styles' ) ;
4646
4747test ( ( ) => {
4848 assert_style_value_equals ( styleMap . get ( '--foo' ) , new CSSUnparsedValue ( [ 'auto' ] ) ) ;
4949} , 'Declared StylePropertyMap contains custom property declarations' ) ;
5050
5151test ( ( ) => {
52- assert_equals ( styleMap . get ( 'color' ) , null ) ;
52+ assert_equals ( styleMap . get ( 'color' ) , undefined ) ;
5353} , 'Declared StylePropertyMap does not contain properties with invalid values' ) ;
5454
5555test ( ( ) => {
Original file line number Diff line number Diff line change 1313test ( t => {
1414 const styleMap = createDeclaredStyleMap ( t , 'margin: 1px 2px 3px 4px' ) ;
1515 const result = styleMap . get ( 'margin' ) ;
16- assert_not_equals ( result , null , 'Shorthand value must not be null ' ) ;
16+ assert_not_equals ( result , undefined , 'Shorthand value must not be undefined ' ) ;
1717 assert_class_string ( result , 'CSSStyleValue' ,
1818 'Shorthand value must be a base CSSStyleValue' ) ;
1919} , 'Getting a shorthand property set explicitly in css rule returns ' +
2222test ( t => {
2323 const styleMap = createDeclaredStyleMap ( t , 'margin-top: 1px' ) ;
2424 const result = styleMap . get ( 'margin' ) ;
25- assert_equals ( result , null ,
26- 'Shorthand value must be null as it is not explicitly set' ) ;
25+ assert_equals ( result , undefined ,
26+ 'Shorthand value must be undefined as it is not explicitly set' ) ;
2727} , 'Getting a shorthand property that is partially set in css rule ' +
28- 'returns null ' ) ;
28+ 'returns undefined ' ) ;
2929
3030</ script >
Original file line number Diff line number Diff line change 1313
1414test ( t => {
1515 const styleMap = createDeclaredStyleMap ( t , '--foo: auto' ) ;
16- assert_equals ( styleMap . get ( '--Foo' ) , null ) ;
17- } , 'Getting a custom property not in the CSS rule returns null ' ) ;
16+ assert_equals ( styleMap . get ( '--Foo' ) , undefined ) ;
17+ } , 'Getting a custom property not in the CSS rule returns undefined ' ) ;
1818
1919test ( t => {
2020 const styleMap = createDeclaredStyleMap ( t , '' ) ;
21- assert_equals ( styleMap . get ( 'width' ) , null ) ;
22- } , 'Getting a valid property not in the CSS rule returns null ' ) ;
21+ assert_equals ( styleMap . get ( 'width' ) , undefined ) ;
22+ } , 'Getting a valid property not in the CSS rule returns undefined ' ) ;
2323
2424test ( t => {
2525 const styleMap = createDeclaredStyleMap ( t , 'width: 10px; height: 20px' ) ;
Original file line number Diff line number Diff line change 2121 let styleMap = createInlineStyleMap ( t , '--foo: auto; width: 10px; transition-duration: 1s, 2s' ) ;
2222
2323 styleMap . clear ( ) ;
24- assert_equals ( styleMap . get ( '--foo' ) , null ,
24+ assert_equals ( styleMap . get ( '--foo' ) , undefined ,
2525 'Custom properties should be cleared' ) ;
26- assert_equals ( styleMap . get ( 'width' ) , null ,
26+ assert_equals ( styleMap . get ( 'width' ) , undefined ,
2727 'CSS properties should be cleared' ) ;
28- assert_equals ( styleMap . get ( 'transition-duration' ) , null ,
28+ assert_equals ( styleMap . get ( 'transition-duration' ) , undefined ,
2929 'List-valued properties should be cleared' ) ;
3030 assert_array_equals ( [ ...styleMap ] , [ ] ) ;
3131} , 'Can clear an inline style containing properties' ) ;
Original file line number Diff line number Diff line change 2222test ( t => {
2323 const styleMap = createInlineStyleMap ( t , 'margin-top: 1px' ) ;
2424 const result = styleMap . get ( 'margin' ) ;
25- assert_equals ( result , null ,
26- 'Shorthand value must be null as it is not explicitly set' ) ;
25+ assert_equals ( result , undefined ,
26+ 'Shorthand value must be undefined as it is not explicitly set' ) ;
2727} , 'Getting a shorthand property that is partially set in inline style ' +
2828 'returns null' ) ;
2929
3030test ( t => {
3131 const styleMap = createDivWithoutStyle ( t ) . attributeStyleMap ;
32- assert_equals ( styleMap . get ( 'margin' ) , null ,
33- 'Shorthand value must be null for element without style' ) ;
32+ assert_equals ( styleMap . get ( 'margin' ) , undefined ,
33+ 'Shorthand value must be undefined for element without style' ) ;
3434} , 'Getting an attributeStyleMap shorthand property from an element without ' +
3535 'a style attribute' ) ;
3636</ script >
Original file line number Diff line number Diff line change 1313
1414test ( t => {
1515 const styleMap = createInlineStyleMap ( t , '--foo: auto' ) ;
16- assert_equals ( styleMap . get ( '--Foo' ) , null ) ;
17- } , 'Getting a custom property not in the inline style returns null ' ) ;
16+ assert_equals ( styleMap . get ( '--Foo' ) , undefined ) ;
17+ } , 'Getting a custom property not in the inline style returns undefined ' ) ;
1818
1919test ( t => {
2020 const styleMap = createInlineStyleMap ( t , '' ) ;
21- assert_equals ( styleMap . get ( 'width' ) , null ) ;
22- } , 'Getting a valid property not in the inline style returns null ' ) ;
21+ assert_equals ( styleMap . get ( 'width' ) , undefined ) ;
22+ } , 'Getting a valid property not in the inline style returns undefined ' ) ;
2323
2424test ( t => {
2525 const styleMap = createInlineStyleMap ( t , 'width: 10px; height: 20px' ) ;
You can’t perform that action at this time.
0 commit comments