@@ -412,6 +412,7 @@ describe('arbitrary substitution', () => {
412412 [ '--custom(--custom(!))' ] ,
413413 [ 'attr(name, attr())' ] ,
414414 [ 'env(name, env())' ] ,
415+ [ 'if(if())' , 'if(if())' ] ,
415416 [ 'inherit(--custom, inherit())' ] ,
416417 [ 'random-item(--key, random-item())' ] ,
417418 [ 'var(--custom, var())' ] ,
@@ -421,6 +422,7 @@ describe('arbitrary substitution', () => {
421422 [ ' /**/ @1/**/1e0 --CUSTOM( /**/ 1e0 /**/ ' , '@1 1 --CUSTOM(1)' ] ,
422423 [ ' /**/ @1/**/1e0 ATTR( name, /**/ 1e0 /**/ ' , '@1 1 attr(name, 1)' ] ,
423424 [ ' /**/ @1/**/1e0 ENV( name, /**/ 1e0 /**/ ' , '@1 1 env(name, 1)' ] ,
425+ [ ' /**/ @1/**/1e0 IF( if(): /**/ 1e0 /**/ ' , '@1 1 if(if(): 1)' ] ,
424426 [ ' /**/ @1/**/1e0 RANDOM-ITEM( --key, /**/ 1e0 /**/ ' , '@1 1 random-item(--key, 1)' ] ,
425427 [ ' /**/ @1/**/1e0 VAR( --custom, /**/ 1e0 /**/ ' , '@1 1 var(--custom, 1)' ] ,
426428 ]
@@ -4712,6 +4714,10 @@ describe('CSSFontFaceDescriptors', () => {
47124714 style . sizeAdjust = 'env(name, attr(name))'
47134715 expect ( style . fontWeight ) . toBe ( 'env(name, attr(name))' )
47144716 expect ( style . sizeAdjust ) . toBe ( 'env(name, attr(name))' )
4717+ style . fontWeight = 'if(media(width): 1)'
4718+ style . sizeAdjust = 'if(media(width): 1%)'
4719+ expect ( style . fontWeight ) . toBe ( 'if(media(width): 1)' )
4720+ expect ( style . sizeAdjust ) . toBe ( 'if(media(width): 1%)' )
47154721 style . fontWeight = 'first-valid(1)'
47164722 style . sizeAdjust = 'first-valid(1%)'
47174723 expect ( style . fontWeight ) . toBe ( '1' )
@@ -4786,6 +4792,8 @@ describe('CSSKeyframeProperties', () => {
47864792 // Dependency-free substitution
47874793 style . fontWeight = 'env(name)'
47884794 expect ( style . fontWeight ) . toBe ( 'env(name)' )
4795+ style . fontWeight = 'if(media(width): 1)'
4796+ expect ( style . fontWeight ) . toBe ( 'if(media(width): 1)' )
47894797 style . fontWeight = 'first-valid(1)'
47904798 expect ( style . fontWeight ) . toBe ( '1' )
47914799 style . fontWeight = 'calc(progress(1, 0, 1))'
@@ -4846,6 +4854,8 @@ describe('CSSMarginDescriptors', () => {
48464854 // Dependency-free substitution
48474855 style . fontWeight = 'env(name)'
48484856 expect ( style . fontWeight ) . toBe ( 'env(name)' )
4857+ style . fontWeight = 'if(media(width): 1)'
4858+ expect ( style . fontWeight ) . toBe ( 'if(media(width): 1)' )
48494859 style . fontWeight = 'first-valid(1)'
48504860 expect ( style . fontWeight ) . toBe ( '1' )
48514861 style . fontWeight = 'calc(progress(1, 0, 1))'
@@ -4908,6 +4918,10 @@ describe('CSSPageDescriptors', () => {
49084918 style . size = 'env(name, attr(name))'
49094919 expect ( style . fontWeight ) . toBe ( 'env(name, attr(name))' )
49104920 expect ( style . size ) . toBe ( 'env(name, attr(name))' )
4921+ style . fontWeight = 'if(media(width): 1)'
4922+ style . size = 'if(media(width): 1px)'
4923+ expect ( style . fontWeight ) . toBe ( 'if(media(width): 1)' )
4924+ expect ( style . size ) . toBe ( 'if(media(width): 1px)' )
49114925 style . fontWeight = 'first-valid(1)'
49124926 style . size = 'first-valid(1px)'
49134927 expect ( style . fontWeight ) . toBe ( '1' )
@@ -4997,6 +5011,8 @@ describe('CSSPositionTryDescriptors', () => {
49975011 // Dependency-free substitution
49985012 style . top = 'env(name)'
49995013 expect ( style . top ) . toBe ( 'env(name)' )
5014+ style . top = 'if(media(width): 1px)'
5015+ expect ( style . top ) . toBe ( 'if(media(width): 1px)' )
50005016 style . top = 'first-valid(1px)'
50015017 expect ( style . top ) . toBe ( '1px' )
50025018 style . top = 'calc(1px * progress(1, 0, 1))'
0 commit comments