LibWeb/CSS: Parse border-block-* properties

This doesn't currently honor `writing-mode`, `direction` and
`text-orientation`.
This commit is contained in:
Tim Ledbetter 2025-03-10 23:16:50 +00:00 committed by Sam Atkins
commit e011ddd368
Notes: github-actions[bot] 2025-03-14 16:10:08 +00:00
18 changed files with 511 additions and 144 deletions

View file

@ -0,0 +1,20 @@
Harness status: OK
Found 15 tests
15 Pass
Pass e.style['border-block-start-color'] = "#12" should not set the property value
Pass e.style['border-block-start-color'] = "auto" should not set the property value
Pass e.style['border-block-start-color'] = "red green" should not set the property value
Pass e.style['border-block-start-color'] = "rgb" should not set the property value
Pass e.style['border-block-start-color'] = "rgb(1,2,3,4,5)" should not set the property value
Pass e.style['border-block-start-color'] = "rgb(10%, 20, 30%)" should not set the property value
Pass e.style['border-block-end-color'] = "#123456789" should not set the property value
Pass e.style['border-block-end-color'] = "123" should not set the property value
Pass e.style['border-block-end-color'] = "hsla(1,2,3,4,5)" should not set the property value
Pass e.style['border-block-end-color'] = "red, green" should not set the property value
Pass e.style['border-block-end-color'] = "rgb(1)" should not set the property value
Pass e.style['border-block-end-color'] = "rgba(-2, 300, 400%, -0.5)" should not set the property value
Pass e.style['border-block-color'] = "auto" should not set the property value
Pass e.style['border-block-color'] = "lime, transparent" should not set the property value
Pass e.style['border-block-color'] = "red green blue" should not set the property value

View file

@ -0,0 +1,13 @@
Harness status: OK
Found 7 tests
4 Pass
3 Fail
Pass e.style['border-block-start-color'] = "currentcolor" should set the property value
Pass e.style['border-block-start-color'] = "rgb(2, 3, 4)" should set the property value
Pass e.style['border-block-end-color'] = "#234" should set the property value
Pass e.style['border-block-end-color'] = "transparent" should set the property value
Fail e.style['border-block-color'] = "#234" should set the property value
Fail e.style['border-block-color'] = "transparent rgb(2, 3, 4)" should set the property value
Fail e.style['border-block-color'] = "rgb(2, 3, 4) rgb(2, 3, 4)" should set the property value

View file

@ -0,0 +1,11 @@
Harness status: OK
Found 6 tests
6 Pass
Pass e.style['border-block-start-style'] = "auto" should not set the property value
Pass e.style['border-block-start-style'] = "hidden, outset" should not set the property value
Pass e.style['border-block-end-style'] = "solid double" should not set the property value
Pass e.style['border-block-style'] = "auto" should not set the property value
Pass e.style['border-block-style'] = "groove, ridge" should not set the property value
Pass e.style['border-block-style'] = "hidden inset dashed" should not set the property value

View file

@ -0,0 +1,19 @@
Harness status: OK
Found 13 tests
10 Pass
3 Fail
Pass e.style['border-block-start-style'] = "dotted" should set the property value
Pass e.style['border-block-start-style'] = "groove" should set the property value
Pass e.style['border-block-start-style'] = "inset" should set the property value
Pass e.style['border-block-start-style'] = "none" should set the property value
Pass e.style['border-block-start-style'] = "solid" should set the property value
Pass e.style['border-block-end-style'] = "dashed" should set the property value
Pass e.style['border-block-end-style'] = "double" should set the property value
Pass e.style['border-block-end-style'] = "hidden" should set the property value
Pass e.style['border-block-end-style'] = "outset" should set the property value
Pass e.style['border-block-end-style'] = "ridge" should set the property value
Fail e.style['border-block-style'] = "dotted" should set the property value
Fail e.style['border-block-style'] = "double groove" should set the property value
Fail e.style['border-block-style'] = "hidden hidden" should set the property value

View file

@ -0,0 +1,12 @@
Harness status: OK
Found 7 tests
7 Pass
Pass e.style['border-block-start-width'] = "-20px" should not set the property value
Pass e.style['border-block-start-width'] = "auto" should not set the property value
Pass e.style['border-block-start-width'] = "medium 40px" should not set the property value
Pass e.style['border-block-end-width'] = "10" should not set the property value
Pass e.style['border-block-end-width'] = "30%" should not set the property value
Pass e.style['border-block-width'] = "thick, thin" should not set the property value
Pass e.style['border-block-width'] = "10px 20px 30px" should not set the property value

View file

@ -0,0 +1,16 @@
Harness status: OK
Found 10 tests
7 Pass
3 Fail
Pass e.style['border-block-start-width'] = "10px" should set the property value
Pass e.style['border-block-start-width'] = "calc(10px + 0.5em)" should set the property value
Pass e.style['border-block-start-width'] = "thick" should set the property value
Pass e.style['border-block-start-width'] = "thin" should set the property value
Pass e.style['border-block-end-width'] = "0" should set the property value
Pass e.style['border-block-end-width'] = "calc(10px - 0.5em)" should set the property value
Pass e.style['border-block-end-width'] = "medium" should set the property value
Fail e.style['border-block-width'] = "10px" should set the property value
Fail e.style['border-block-width'] = "medium calc(10px + 0.5em)" should set the property value
Fail e.style['border-block-width'] = "10px 10px" should set the property value