Skip to content

Commit 3299ea9

Browse files
tcl3AtkinsSJ
authored andcommitted
LibWeb: Treat word-wrap as an alias for overflow-wrap
1 parent a010557 commit 3299ea9

File tree

14 files changed

+125
-13
lines changed

14 files changed

+125
-13
lines changed

Libraries/LibWeb/CSS/Properties.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,6 +2805,16 @@
28052805
"mapping": "inline-xy"
28062806
}
28072807
},
2808+
"overflow-wrap": {
2809+
"animation-type": "discrete",
2810+
"inherited": true,
2811+
"initial": "normal",
2812+
"valid-identifiers": [
2813+
"anywhere",
2814+
"break-word",
2815+
"normal"
2816+
]
2817+
},
28082818
"overflow-x": {
28092819
"animation-type": "discrete",
28102820
"inherited": false,
@@ -3744,14 +3754,7 @@
37443754
]
37453755
},
37463756
"word-wrap": {
3747-
"animation-type": "discrete",
3748-
"inherited": true,
3749-
"initial": "normal",
3750-
"valid-identifiers": [
3751-
"anywhere",
3752-
"break-word",
3753-
"normal"
3754-
]
3757+
"legacy-alias-for": "overflow-wrap"
37553758
},
37563759
"writing-mode": {
37573760
"animation-type": "none",

Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPseudoElement.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ bool pseudo_element_supports_property(PseudoElement pseudo_element, PropertyID p
410410
append_property("letter-spacing"sv);
411411
// FIXME: line-break
412412
// FIXME: line-padding
413-
// FIXME: overflow-wrap
413+
append_property("overflow-wrap"sv);
414414
append_property("tab-size"sv);
415415
append_property("text-align"sv);
416416
// FIXME: text-align-all
@@ -431,7 +431,6 @@ bool pseudo_element_supports_property(PseudoElement pseudo_element, PropertyID p
431431
append_property("word-break"sv);
432432
// FIXME: word-space-transform
433433
append_property("word-spacing"sv);
434-
append_property("word-wrap"sv);
435434
// FIXME: wrap-after
436435
// FIXME: wrap-before
437436
// FIXME: wrap-inside

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ All properties associated with getComputedStyle(document.body):
4242
"math-shift",
4343
"math-style",
4444
"orphans",
45+
"overflow-wrap",
4546
"paint-order",
4647
"pointer-events",
4748
"quotes",
@@ -72,7 +73,6 @@ All properties associated with getComputedStyle(document.body):
7273
"widows",
7374
"word-break",
7475
"word-spacing",
75-
"word-wrap",
7676
"writing-mode",
7777
"align-content",
7878
"align-items",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ All supported properties and their default values exposed from CSSStylePropertie
594594
'overflow-block': 'visible'
595595
'overflowInline': 'visible'
596596
'overflow-inline': 'visible'
597+
'overflowWrap': 'normal'
598+
'overflow-wrap': 'normal'
597599
'overflowX': 'visible'
598600
'overflow-x': 'visible'
599601
'overflowY': 'visible'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ math-depth: 0
4040
math-shift: normal
4141
math-style: normal
4242
orphans: 2
43+
overflow-wrap: normal
4344
paint-order: normal
4445
pointer-events: auto
4546
quotes: auto
@@ -70,7 +71,6 @@ white-space-collapse: collapse
7071
widows: 2
7172
word-break: normal
7273
word-spacing: 0px
73-
word-wrap: normal
7474
writing-mode: horizontal-tb
7575
align-content: normal
7676
align-items: normal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Pass math-depth
4444
Pass math-shift
4545
Pass math-style
4646
Pass orphans
47+
Pass overflow-wrap
4748
Pass paint-order
4849
Pass pointer-events
4950
Pass quotes
@@ -74,7 +75,6 @@ Pass white-space-collapse
7475
Pass widows
7576
Pass word-break
7677
Pass word-spacing
77-
Pass word-wrap
7878
Pass writing-mode
7979
Pass align-items
8080
Pass align-self
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 word-wrap should be defined as an alias of overflow-wrap
7+
Pass word-wrap is a legacy name alias for overflow-wrap
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 overflow-wrap value 'normal'
7+
Pass Property overflow-wrap value 'break-word'
8+
Pass Property overflow-wrap value 'anywhere'
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 e.style['overflow-wrap'] = "auto" should not set the property value
7+
Pass e.style['overflow-wrap'] = "normal break-word" should not set the property value
8+
Pass e.style['overflow-wrap'] = "anywhere anywhere" should not set the property value
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 e.style['overflow-wrap'] = "normal" should set the property value
7+
Pass e.style['overflow-wrap'] = "break-word" should set the property value
8+
Pass e.style['overflow-wrap'] = "anywhere" should set the property value

0 commit comments

Comments
 (0)