LibWeb: Parse corner-*-shape physical shorthands

This commit is contained in:
Callum Law 2025-10-09 00:07:50 +13:00 committed by Sam Atkins
parent 814efa9809
commit 7305b3fa28
5 changed files with 150 additions and 83 deletions

View File

@ -1450,6 +1450,52 @@
"corner-shape"
]
},
"corner-bottom-shape": {
"initial": "round round",
"positional-value-list-shorthand": true,
"longhands": [
"corner-bottom-left-shape",
"corner-bottom-right-shape"
],
"valid-types": [
"corner-shape"
]
},
"corner-left-shape": {
"initial": "round round",
"positional-value-list-shorthand": true,
"longhands": [
"corner-top-left-shape",
"corner-bottom-left-shape"
],
"valid-types": [
"corner-shape"
]
},
"corner-right-shape": {
"initial": "round round",
"positional-value-list-shorthand": true,
"longhands": [
"corner-top-right-shape",
"corner-bottom-right-shape"
],
"valid-types": [
"corner-shape"
]
},
"corner-shape": {
"initial": "round round round round",
"positional-value-list-shorthand": true,
"longhands": [
"corner-top-left-shape",
"corner-top-right-shape",
"corner-bottom-right-shape",
"corner-bottom-left-shape"
],
"valid-types": [
"corner-shape"
]
},
"corner-top-left-shape": {
"animation-type": "by-computed-value",
"inherited": false,
@ -1466,6 +1512,17 @@
"corner-shape"
]
},
"corner-top-shape": {
"initial": "round round",
"positional-value-list-shorthand": true,
"longhands": [
"corner-top-left-shape",
"corner-top-right-shape"
],
"valid-types": [
"corner-shape"
]
},
"counter-increment": {
"animation-type": "by-computed-value",
"inherited": false,

View File

@ -371,10 +371,20 @@ All supported properties and their default values exposed from CSSStylePropertie
'corner-bottom-left-shape': 'round'
'cornerBottomRightShape': 'round'
'corner-bottom-right-shape': 'round'
'cornerBottomShape': 'round'
'corner-bottom-shape': 'round'
'cornerLeftShape': 'round'
'corner-left-shape': 'round'
'cornerRightShape': 'round'
'corner-right-shape': 'round'
'cornerShape': 'round'
'corner-shape': 'round'
'cornerTopLeftShape': 'round'
'corner-top-left-shape': 'round'
'cornerTopRightShape': 'round'
'corner-top-right-shape': 'round'
'cornerTopShape': 'round'
'corner-top-shape': 'round'
'counterIncrement': 'none'
'counter-increment': 'none'
'counterReset': 'none'

View File

@ -2,8 +2,8 @@ Harness status: OK
Found 38 tests
8 Pass
30 Fail
20 Pass
18 Fail
Pass Property corner-top-left-shape value 'round'
Pass Property corner-top-left-shape value 'scoop'
Pass Property corner-top-left-shape value 'superellipse(5)'
@ -18,24 +18,24 @@ Pass Property corner-top-right-shape value 'round'
Pass Property corner-top-right-shape value 'superellipse(5)'
Pass Property corner-bottom-right-shape value 'scoop'
Pass Property corner-bottom-left-shape value 'superellipse(5)'
Fail Property corner-shape value 'superellipse(5) round'
Fail Property corner-shape value 'round'
Fail Property corner-shape value 'bevel superellipse(0.1) round squircle'
Fail Property corner-shape value 'superellipse(-5) superellipse(3) superellipse(7) superellipse(-5.5)'
Fail Property corner-shape value 'round round round round'
Fail Property corner-shape value 'round scoop'
Fail Property corner-shape value 'round scoop round scoop'
Pass Property corner-shape value 'superellipse(5) round'
Pass Property corner-shape value 'round'
Pass Property corner-shape value 'bevel superellipse(0.1) round squircle'
Pass Property corner-shape value 'superellipse(-5) superellipse(3) superellipse(7) superellipse(-5.5)'
Pass Property corner-shape value 'round round round round'
Pass Property corner-shape value 'round scoop'
Pass Property corner-shape value 'round scoop round scoop'
Fail Property corner-shape value 'bevel superellipse(1)'
Fail Property corner-shape value 'superellipse(-1) superellipse(3) square'
Fail Property corner-shape value 'superellipse(-1) superellipse(3) superellipse(0)'
Fail Property corner-shape value 'bevel superellipse(1) squircle round'
Fail Property corner-shape value 'superellipse(-1) superellipse(3) superellipse(0) superellipse(infinity)'
Fail Property corner-left-shape value 'round scoop'
Fail Property corner-top-shape value 'round scoop'
Fail Property corner-top-shape value 'superellipse(4)'
Fail Property corner-right-shape value 'superellipse(-1.5) superellipse(3)'
Pass Property corner-left-shape value 'round scoop'
Pass Property corner-top-shape value 'round scoop'
Pass Property corner-top-shape value 'superellipse(4)'
Pass Property corner-right-shape value 'superellipse(-1.5) superellipse(3)'
Fail Property corner-right-shape value 'superellipse(-1) superellipse(2)'
Fail Property corner-bottom-shape value 'scoop scoop'
Pass Property corner-bottom-shape value 'scoop scoop'
Fail Property corner-inline-start-shape value 'round scoop'
Fail Property corner-block-start-shape value 'round scoop'
Fail Property corner-block-end-shape value 'superellipse(4)'

View File

@ -2,8 +2,8 @@ Harness status: OK
Found 448 tests
144 Pass
304 Fail
152 Pass
296 Fail
Fail CSS Transitions: property <corner-top-left-shape> from [round] to [bevel] at (-0.3) should be [superellipse(1.4)]
Fail CSS Transitions: property <corner-top-left-shape> from [round] to [bevel] at (0) should be [round]
Fail CSS Transitions: property <corner-top-left-shape> from [round] to [bevel] at (0.6) should be [superellipse(0.36)]
@ -191,12 +191,12 @@ Fail CSS Transitions with transition: all: property <corner-top-left-shape> from
Pass CSS Transitions with transition: all: property <corner-top-left-shape> from [inherit] to [squircle] at (1) should be [squircle]
Fail CSS Transitions with transition: all: property <corner-top-left-shape> from [inherit] to [squircle] at (1.5) should be [square]
Fail CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (-0.3) should be [superellipse(-0.45)]
Fail CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0) should be [bevel]
Pass CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0) should be [bevel]
Fail CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0.6) should be [superellipse(0.98)]
Pass CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (1) should be [squircle]
Fail CSS Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (1.5) should be [square]
Fail Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (-0.3) should be [superellipse(-0.45)]
Fail Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0) should be [bevel]
Pass Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0) should be [bevel]
Fail Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (0.6) should be [superellipse(0.98)]
Pass Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (1) should be [squircle]
Fail Web Animations: property <corner-top-left-shape> from [inherit] to [squircle] at (1.5) should be [square]
@ -211,12 +211,12 @@ Fail CSS Transitions with transition: all: property <corner-top-right-shape> fro
Pass CSS Transitions with transition: all: property <corner-top-right-shape> from [inherit] to [square] at (1) should be [square]
Pass CSS Transitions with transition: all: property <corner-top-right-shape> from [inherit] to [square] at (1.5) should be [square]
Fail CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (-0.3) should be [superellipse(-0.69)]
Fail CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (0) should be [bevel]
Pass CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (0) should be [bevel]
Fail CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (0.6) should be [superellipse(1.64)]
Pass CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (1) should be [square]
Pass CSS Animations: property <corner-top-right-shape> from [inherit] to [square] at (1.5) should be [square]
Fail Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (-0.3) should be [superellipse(-0.69)]
Fail Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (0) should be [bevel]
Pass Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (0) should be [bevel]
Fail Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (0.6) should be [superellipse(1.64)]
Pass Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (1) should be [square]
Pass Web Animations: property <corner-top-right-shape> from [inherit] to [square] at (1.5) should be [square]
@ -231,12 +231,12 @@ Fail CSS Transitions with transition: all: property <corner-bottom-right-shape>
Pass CSS Transitions with transition: all: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1) should be [scoop]
Fail CSS Transitions with transition: all: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1.5) should be [superellipse(-1.72)]
Fail CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (-0.3) should be [superellipse(0.27)]
Fail CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0) should be [bevel]
Pass CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0) should be [bevel]
Fail CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0.6) should be [superellipse(-0.56)]
Pass CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1) should be [scoop]
Fail CSS Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1.5) should be [superellipse(-1.72)]
Fail Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (-0.3) should be [superellipse(0.27)]
Fail Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0) should be [bevel]
Pass Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0) should be [bevel]
Fail Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (0.6) should be [superellipse(-0.56)]
Pass Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1) should be [scoop]
Fail Web Animations: property <corner-bottom-right-shape> from [inherit] to [scoop] at (1.5) should be [superellipse(-1.72)]
@ -251,12 +251,12 @@ Fail CSS Transitions with transition: all: property <corner-bottom-left-shape> f
Pass CSS Transitions with transition: all: property <corner-bottom-left-shape> from [inherit] to [notch] at (1) should be [notch]
Pass CSS Transitions with transition: all: property <corner-bottom-left-shape> from [inherit] to [notch] at (1.5) should be [notch]
Fail CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (-0.3) should be [superellipse(0.69)]
Fail CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0) should be [bevel]
Pass CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0) should be [bevel]
Fail CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0.6) should be [superellipse(-1.64)]
Pass CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (1) should be [notch]
Pass CSS Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (1.5) should be [notch]
Fail Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (-0.3) should be [superellipse(0.69)]
Fail Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0) should be [bevel]
Pass Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0) should be [bevel]
Fail Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (0.6) should be [superellipse(-1.64)]
Pass Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (1) should be [notch]
Pass Web Animations: property <corner-bottom-left-shape> from [inherit] to [notch] at (1.5) should be [notch]

View File

@ -2,8 +2,8 @@ Harness status: OK
Found 241 tests
68 Pass
173 Fail
125 Pass
116 Fail
Pass e.style['corner-top-left-shape'] = "round" should set the property value
Pass e.style['corner-top-left-shape'] = "scoop" should set the property value
Pass e.style['corner-top-left-shape'] = "notch" should set the property value
@ -140,63 +140,63 @@ Fail e.style['corner-end-end-shape'] = "superellipse(-infinity)" should set the
Fail e.style['corner-end-end-shape'] = "superellipse(-0.5)" should set the property value
Fail e.style['corner-end-end-shape'] = "superellipse(-4)" should set the property value
Fail e.style['corner-end-end-shape'] = "superellipse(calc(0.5 * 4))" should set the property value
Fail e.style['corner-shape'] = "round round round round" should set the property value
Fail e.style['corner-shape'] = "round scoop" should set the property value
Fail e.style['corner-shape'] = "round scoop round scoop" should set the property value
Fail e.style['corner-shape'] = "bevel superellipse(2)" should set the property value
Fail e.style['corner-shape'] = "superellipse(0.5) superellipse(3) square" should set the property value
Fail e.style['corner-shape'] = "superellipse(-0.5) superellipse(3) square superellipse(-30)" should set the property value
Fail e.style['corner-shape'] = "superellipse(0.5) superellipse(3) superellipse(1)" should set the property value
Fail e.style['corner-shape'] = "bevel superellipse(2) squircle round" should set the property value
Fail e.style['corner-shape'] = "superellipse(0.5) superellipse(3) superellipse(1) superellipse(infinity)" should set the property value
Fail e.style['corner-top-shape'] = "scoop" should set corner-top-left-shape
Fail e.style['corner-top-shape'] = "scoop" should set corner-top-right-shape
Fail e.style['corner-top-shape'] = "scoop" should not set unrelated longhands
Fail e.style['corner-top-shape'] = "bevel notch" should set corner-top-left-shape
Fail e.style['corner-top-shape'] = "bevel notch" should set corner-top-right-shape
Fail e.style['corner-top-shape'] = "bevel notch" should not set unrelated longhands
Fail e.style['corner-top-shape'] = "superellipse(-2) squircle" should set corner-top-left-shape
Fail e.style['corner-top-shape'] = "superellipse(-2) squircle" should set corner-top-right-shape
Fail e.style['corner-top-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Fail e.style['corner-top-shape'] = "superellipse(3)" should set corner-top-left-shape
Fail e.style['corner-top-shape'] = "superellipse(3)" should set corner-top-right-shape
Fail e.style['corner-top-shape'] = "superellipse(3)" should not set unrelated longhands
Fail e.style['corner-right-shape'] = "scoop" should set corner-bottom-right-shape
Fail e.style['corner-right-shape'] = "scoop" should set corner-top-right-shape
Fail e.style['corner-right-shape'] = "scoop" should not set unrelated longhands
Fail e.style['corner-right-shape'] = "bevel notch" should set corner-bottom-right-shape
Fail e.style['corner-right-shape'] = "bevel notch" should set corner-top-right-shape
Fail e.style['corner-right-shape'] = "bevel notch" should not set unrelated longhands
Fail e.style['corner-right-shape'] = "superellipse(-2) squircle" should set corner-bottom-right-shape
Fail e.style['corner-right-shape'] = "superellipse(-2) squircle" should set corner-top-right-shape
Fail e.style['corner-right-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Fail e.style['corner-right-shape'] = "superellipse(3)" should set corner-bottom-right-shape
Fail e.style['corner-right-shape'] = "superellipse(3)" should set corner-top-right-shape
Fail e.style['corner-right-shape'] = "superellipse(3)" should not set unrelated longhands
Fail e.style['corner-bottom-shape'] = "scoop" should set corner-bottom-left-shape
Fail e.style['corner-bottom-shape'] = "scoop" should set corner-bottom-right-shape
Fail e.style['corner-bottom-shape'] = "scoop" should not set unrelated longhands
Fail e.style['corner-bottom-shape'] = "bevel notch" should set corner-bottom-left-shape
Fail e.style['corner-bottom-shape'] = "bevel notch" should set corner-bottom-right-shape
Fail e.style['corner-bottom-shape'] = "bevel notch" should not set unrelated longhands
Fail e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should set corner-bottom-left-shape
Fail e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should set corner-bottom-right-shape
Fail e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Fail e.style['corner-bottom-shape'] = "superellipse(3)" should set corner-bottom-left-shape
Fail e.style['corner-bottom-shape'] = "superellipse(3)" should set corner-bottom-right-shape
Fail e.style['corner-bottom-shape'] = "superellipse(3)" should not set unrelated longhands
Fail e.style['corner-left-shape'] = "scoop" should set corner-bottom-left-shape
Fail e.style['corner-left-shape'] = "scoop" should set corner-top-left-shape
Fail e.style['corner-left-shape'] = "scoop" should not set unrelated longhands
Fail e.style['corner-left-shape'] = "bevel notch" should set corner-bottom-left-shape
Fail e.style['corner-left-shape'] = "bevel notch" should set corner-top-left-shape
Fail e.style['corner-left-shape'] = "bevel notch" should not set unrelated longhands
Fail e.style['corner-left-shape'] = "superellipse(-2) squircle" should set corner-bottom-left-shape
Fail e.style['corner-left-shape'] = "superellipse(-2) squircle" should set corner-top-left-shape
Fail e.style['corner-left-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Fail e.style['corner-left-shape'] = "superellipse(3)" should set corner-bottom-left-shape
Fail e.style['corner-left-shape'] = "superellipse(3)" should set corner-top-left-shape
Fail e.style['corner-left-shape'] = "superellipse(3)" should not set unrelated longhands
Pass e.style['corner-shape'] = "round round round round" should set the property value
Pass e.style['corner-shape'] = "round scoop" should set the property value
Pass e.style['corner-shape'] = "round scoop round scoop" should set the property value
Pass e.style['corner-shape'] = "bevel superellipse(2)" should set the property value
Pass e.style['corner-shape'] = "superellipse(0.5) superellipse(3) square" should set the property value
Pass e.style['corner-shape'] = "superellipse(-0.5) superellipse(3) square superellipse(-30)" should set the property value
Pass e.style['corner-shape'] = "superellipse(0.5) superellipse(3) superellipse(1)" should set the property value
Pass e.style['corner-shape'] = "bevel superellipse(2) squircle round" should set the property value
Pass e.style['corner-shape'] = "superellipse(0.5) superellipse(3) superellipse(1) superellipse(infinity)" should set the property value
Pass e.style['corner-top-shape'] = "scoop" should set corner-top-left-shape
Pass e.style['corner-top-shape'] = "scoop" should set corner-top-right-shape
Pass e.style['corner-top-shape'] = "scoop" should not set unrelated longhands
Pass e.style['corner-top-shape'] = "bevel notch" should set corner-top-left-shape
Pass e.style['corner-top-shape'] = "bevel notch" should set corner-top-right-shape
Pass e.style['corner-top-shape'] = "bevel notch" should not set unrelated longhands
Pass e.style['corner-top-shape'] = "superellipse(-2) squircle" should set corner-top-left-shape
Pass e.style['corner-top-shape'] = "superellipse(-2) squircle" should set corner-top-right-shape
Pass e.style['corner-top-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Pass e.style['corner-top-shape'] = "superellipse(3)" should set corner-top-left-shape
Pass e.style['corner-top-shape'] = "superellipse(3)" should set corner-top-right-shape
Pass e.style['corner-top-shape'] = "superellipse(3)" should not set unrelated longhands
Pass e.style['corner-right-shape'] = "scoop" should set corner-bottom-right-shape
Pass e.style['corner-right-shape'] = "scoop" should set corner-top-right-shape
Pass e.style['corner-right-shape'] = "scoop" should not set unrelated longhands
Pass e.style['corner-right-shape'] = "bevel notch" should set corner-bottom-right-shape
Pass e.style['corner-right-shape'] = "bevel notch" should set corner-top-right-shape
Pass e.style['corner-right-shape'] = "bevel notch" should not set unrelated longhands
Pass e.style['corner-right-shape'] = "superellipse(-2) squircle" should set corner-bottom-right-shape
Pass e.style['corner-right-shape'] = "superellipse(-2) squircle" should set corner-top-right-shape
Pass e.style['corner-right-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Pass e.style['corner-right-shape'] = "superellipse(3)" should set corner-bottom-right-shape
Pass e.style['corner-right-shape'] = "superellipse(3)" should set corner-top-right-shape
Pass e.style['corner-right-shape'] = "superellipse(3)" should not set unrelated longhands
Pass e.style['corner-bottom-shape'] = "scoop" should set corner-bottom-left-shape
Pass e.style['corner-bottom-shape'] = "scoop" should set corner-bottom-right-shape
Pass e.style['corner-bottom-shape'] = "scoop" should not set unrelated longhands
Pass e.style['corner-bottom-shape'] = "bevel notch" should set corner-bottom-left-shape
Pass e.style['corner-bottom-shape'] = "bevel notch" should set corner-bottom-right-shape
Pass e.style['corner-bottom-shape'] = "bevel notch" should not set unrelated longhands
Pass e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should set corner-bottom-left-shape
Pass e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should set corner-bottom-right-shape
Pass e.style['corner-bottom-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Pass e.style['corner-bottom-shape'] = "superellipse(3)" should set corner-bottom-left-shape
Pass e.style['corner-bottom-shape'] = "superellipse(3)" should set corner-bottom-right-shape
Pass e.style['corner-bottom-shape'] = "superellipse(3)" should not set unrelated longhands
Pass e.style['corner-left-shape'] = "scoop" should set corner-bottom-left-shape
Pass e.style['corner-left-shape'] = "scoop" should set corner-top-left-shape
Pass e.style['corner-left-shape'] = "scoop" should not set unrelated longhands
Pass e.style['corner-left-shape'] = "bevel notch" should set corner-bottom-left-shape
Pass e.style['corner-left-shape'] = "bevel notch" should set corner-top-left-shape
Pass e.style['corner-left-shape'] = "bevel notch" should not set unrelated longhands
Pass e.style['corner-left-shape'] = "superellipse(-2) squircle" should set corner-bottom-left-shape
Pass e.style['corner-left-shape'] = "superellipse(-2) squircle" should set corner-top-left-shape
Pass e.style['corner-left-shape'] = "superellipse(-2) squircle" should not set unrelated longhands
Pass e.style['corner-left-shape'] = "superellipse(3)" should set corner-bottom-left-shape
Pass e.style['corner-left-shape'] = "superellipse(3)" should set corner-top-left-shape
Pass e.style['corner-left-shape'] = "superellipse(3)" should not set unrelated longhands
Fail e.style['corner-inline-start-shape'] = "scoop" should set corner-end-start-shape
Fail e.style['corner-inline-start-shape'] = "scoop" should set corner-start-start-shape
Fail e.style['corner-inline-start-shape'] = "scoop" should not set unrelated longhands