Skip to content

Commit c4d6deb

Browse files
Calme1709AtkinsSJ
authored andcommitted
LibWeb: Parse widows CSS property
1 parent 3d85532 commit c4d6deb

File tree

14 files changed

+416
-8
lines changed

14 files changed

+416
-8
lines changed

Libraries/LibWeb/CSS/Properties.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,6 +3660,15 @@
36603660
"discard-inner"
36613661
]
36623662
},
3663+
"widows": {
3664+
"animation-type": "by-computed-value",
3665+
"inherited": true,
3666+
"initial": "2",
3667+
"valid-types": [
3668+
"integer [1,∞]"
3669+
],
3670+
"__comment": "FIXME: We don't implement this property any further than compute time"
3671+
},
36633672
"width": {
36643673
"animation-type": "by-computed-value",
36653674
"inherited": false,

Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ All properties associated with getComputedStyle(document.body):
6969
"text-wrap-style",
7070
"visibility",
7171
"white-space-collapse",
72+
"widows",
7273
"word-break",
7374
"word-spacing",
7475
"word-wrap",

Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ All supported properties and their default values exposed from CSSStylePropertie
741741
'white-space-collapse': 'collapse'
742742
'whiteSpaceTrim': 'none'
743743
'white-space-trim': 'none'
744+
'widows': '2'
744745
'width': '284px'
745746
'willChange': 'auto'
746747
'will-change': 'auto'

Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ text-wrap-mode: wrap
6767
text-wrap-style: auto
6868
visibility: visible
6969
white-space-collapse: collapse
70+
widows: 2
7071
word-break: normal
7172
word-spacing: 0px
7273
word-wrap: normal
@@ -96,7 +97,7 @@ background-position-x: 0%
9697
background-position-y: 0%
9798
background-repeat: repeat
9899
background-size: auto
99-
block-size: 1470px
100+
block-size: 1485px
100101
border-block-end-color: rgb(0, 0, 0)
101102
border-block-end-style: none
102103
border-block-end-width: 0px
@@ -173,7 +174,7 @@ grid-row-start: auto
173174
grid-template-areas: none
174175
grid-template-columns: none
175176
grid-template-rows: none
176-
height: 2625px
177+
height: 2640px
177178
inline-size: 784px
178179
inset-block-end: auto
179180
inset-block-start: auto

Tests/LibWeb/Text/expected/wpt-import/css/css-break/animation/widows-interpolation.txt

Lines changed: 197 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Harness status: OK
2+
3+
Found 3 tests
4+
5+
3 Pass
6+
Pass Property widows value '1'
7+
Pass Property widows value '234'
8+
Pass Property widows value 'calc(1 + 234)'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Harness status: OK
2+
3+
Found 5 tests
4+
5+
5 Pass
6+
Pass e.style['widows'] = "auto" should not set the property value
7+
Pass e.style['widows'] = "1 234" should not set the property value
8+
Pass e.style['widows'] = "-234" should not set the property value
9+
Pass e.style['widows'] = "-1" should not set the property value
10+
Pass e.style['widows'] = "0" should not set the property value
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Harness status: OK
2+
3+
Found 2 tests
4+
5+
2 Pass
6+
Pass e.style['widows'] = "1" should set the property value
7+
Pass e.style['widows'] = "234" should set the property value

Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Harness status: OK
22

3-
Found 264 tests
3+
Found 265 tests
44

5-
258 Pass
5+
259 Pass
66
6 Fail
77
Pass accent-color
88
Pass border-collapse
@@ -71,6 +71,7 @@ Pass text-wrap-mode
7171
Pass text-wrap-style
7272
Pass visibility
7373
Pass white-space-collapse
74+
Pass widows
7475
Pass word-break
7576
Pass word-spacing
7677
Pass word-wrap

Tests/LibWeb/Text/expected/wpt-import/css/cssom/serialize-values.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Harness status: OK
22

33
Found 687 tests
44

5-
663 Pass
6-
24 Fail
5+
665 Pass
6+
22 Fail
77
Pass background-attachment: scroll
88
Pass background-attachment: fixed
99
Pass background-attachment: inherit
@@ -672,8 +672,8 @@ Pass white-space: nowrap
672672
Pass white-space: pre-wrap
673673
Pass white-space: pre-line
674674
Pass white-space: inherit
675-
Fail widows: 101
676-
Fail widows: inherit
675+
Pass widows: 101
676+
Pass widows: inherit
677677
Pass width: 0px
678678
Pass width: 1px
679679
Pass width: .1em

0 commit comments

Comments
 (0)