Skip to content

Commit 2331464

Browse files
Calme1709AtkinsSJ
authored andcommitted
LibWeb: Don't collapse serialized comma separated StyleValueLists
1 parent 68d0735 commit 2331464

21 files changed

+66
-80
lines changed

Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ String StyleValueList::to_string(SerializationMode mode) const
6161
}
6262

6363
auto first_value = m_properties.values.first();
64-
if (all_of(m_properties.values, [&](auto const& property) { return property == first_value; }))
64+
if (all_of(m_properties.values, [&](auto const& property) { return property == first_value; }) && m_properties.separator != Separator::Comma)
6565
return first_value->to_string(mode);
6666

6767
StringBuilder builder;

Tests/LibWeb/Text/expected/wpt-import/css/css-anchor-position/parsing/position-try-fallbacks-parsing.txt

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

33
Found 43 tests
44

5-
42 Pass
6-
1 Fail
5+
43 Pass
76
Pass e.style['position-try-fallbacks'] = "initial" should set the property value
87
Pass e.style['position-try-fallbacks'] = "inherit" should set the property value
98
Pass e.style['position-try-fallbacks'] = "unset" should set the property value
@@ -13,7 +12,7 @@ Pass e.style['position-try-fallbacks'] = "flip-block" should set the property va
1312
Pass e.style['position-try-fallbacks'] = "flip-block " should set the property value
1413
Pass e.style['position-try-fallbacks'] = "flip-start, flip-block" should set the property value
1514
Pass e.style['position-try-fallbacks'] = "flip-start flip-inline, flip-block" should set the property value
16-
Fail e.style['position-try-fallbacks'] = "flip-start, flip-start" should set the property value
15+
Pass e.style['position-try-fallbacks'] = "flip-start, flip-start" should set the property value
1716
Pass e.style['position-try-fallbacks'] = "flip-start flip-inline flip-block" should set the property value
1817
Pass e.style['position-try-fallbacks'] = "flip-block, --foo" should set the property value
1918
Pass e.style['position-try-fallbacks'] = "--bar, flip-block flip-start" should set the property value

Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/animation-duration-computed.txt

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

33
Found 15 tests
44

5-
13 Pass
6-
2 Fail
5+
14 Pass
6+
1 Fail
77
Pass Property animation-duration value '500ms'
88
Pass Property animation-duration value 'calc(2 * 3s)'
99
Fail Property animation-duration value 'calc(10s + (sign(2cqw - 10px) * 5s))'
1010
Pass Property animation-duration value '20s, 10s'
1111
Pass Property animation-duration value 'auto'
12-
Fail Property animation-duration value 'auto, auto'
12+
Pass Property animation-duration value 'auto, auto'
1313
Pass Resolved value of animation-duration:auto with animation-timeline:auto
1414
Pass Resolved value of animation-duration:auto with animation-timeline:auto, auto
1515
Pass Resolved value of animation-duration:auto with animation-timeline:--t

Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/background-computed.txt

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

33
Found 35 tests
44

5-
25 Pass
6-
10 Fail
7-
Fail Property background-attachment value 'local'
5+
30 Pass
6+
5 Fail
7+
Pass Property background-attachment value 'local'
88
Pass Property background-attachment value 'scroll, fixed'
99
Pass Property background-attachment value 'local, fixed, scroll'
1010
Pass Property background-attachment value 'local, fixed, scroll, fixed'
11-
Fail Property background-clip value 'border-box'
11+
Pass Property background-clip value 'border-box'
1212
Pass Property background-clip value 'content-box, border-box'
1313
Pass Property background-clip value 'border-box, padding-box, content-box'
1414
Pass Property background-clip value 'content-box, border-box, padding-box, content-box'
1515
Pass Property background-clip value 'content-box, border-box, padding-box'
1616
Fail Property background-clip value 'content-box, border-box, border-area'
1717
Pass Property background-color value 'rgb(255, 0, 0)'
18-
Fail Property background-origin value 'border-box'
18+
Pass Property background-origin value 'border-box'
1919
Pass Property background-origin value 'content-box, border-box'
2020
Pass Property background-origin value 'border-box, padding-box, content-box'
2121
Pass Property background-origin value 'content-box, border-box, padding-box, content-box'
@@ -31,11 +31,11 @@ Fail Property background-position-y value '0.5em'
3131
Pass Property background-position-y value '-20%, 10px'
3232
Pass Property background-position-y value 'center, top, bottom'
3333
Fail Property background-position-y value 'calc(10px - 0.5em), -20%, bottom, 15%'
34-
Fail Property background-repeat value 'round'
34+
Pass Property background-repeat value 'round'
3535
Pass Property background-repeat value 'repeat-x, repeat'
3636
Pass Property background-repeat value 'repeat space, round no-repeat, repeat-x'
3737
Pass Property background-repeat value 'repeat-y, round no-repeat, repeat-x, repeat'
38-
Fail Property background-size value 'contain'
38+
Pass Property background-size value 'contain'
3939
Pass Property background-size value 'auto 1px, 2% 3%'
4040
Pass Property background-size value 'auto 1px, 2% 3%, contain'
4141
Pass Property background-size value 'auto 1px, 2% 3%, contain, 7px 8px'

Tests/LibWeb/Text/expected/wpt-import/css/css-masking/parsing/mask-valid.sub.txt

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

33
Found 55 tests
44

5-
40 Pass
6-
15 Fail
5+
45 Pass
6+
10 Fail
77
Pass e.style['mask'] = "none" should set the property value
88
Pass e.style['mask'] = "linear-gradient(to left bottom, red, blue)" should set the property value
99
Pass e.style['mask'] = "linear-gradient(to left bottom, red, blue) luminance" should set the property value
@@ -51,11 +51,11 @@ Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding
5151
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-border-source
5252
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-border-width
5353
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-clip
54-
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-composite
54+
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-composite
5555
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-image
56-
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-mode
56+
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-mode
5757
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-origin
58-
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-position
59-
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-repeat
60-
Fail e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-size
58+
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-position
59+
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-repeat
60+
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should set mask-size
6161
Pass e.style['mask'] = "none, linear-gradient(to left bottom, red, blue) padding-box" should not set unrelated longhands

Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-shorthand.txt

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

33
Found 18 tests
44

5-
16 Pass
6-
2 Fail
5+
18 Pass
76
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should set transition-behavior
87
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should set transition-delay
98
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should set transition-duration
109
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should set transition-property
1110
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should set transition-timing-function
1211
Pass e.style['transition'] = "1s -3s cubic-bezier(0, -2, 1, 3) top" should not set unrelated longhands
13-
Fail e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-behavior
12+
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-behavior
1413
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-delay
1514
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-duration
1615
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-property
1716
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should set transition-timing-function
1817
Pass e.style['transition'] = "1s -3s, cubic-bezier(0, -2, 1, 3) top" should not set unrelated longhands
19-
Fail e.style['transition'] = "cubic-bezier(0, -2, 1, 3) top, 1s -3s" should set transition-behavior
18+
Pass e.style['transition'] = "cubic-bezier(0, -2, 1, 3) top, 1s -3s" should set transition-behavior
2019
Pass e.style['transition'] = "cubic-bezier(0, -2, 1, 3) top, 1s -3s" should set transition-delay
2120
Pass e.style['transition'] = "cubic-bezier(0, -2, 1, 3) top, 1s -3s" should set transition-duration
2221
Pass e.style['transition'] = "cubic-bezier(0, -2, 1, 3) top, 1s -3s" should set transition-property

Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-shorthand.txt

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

33
Found 27 tests
44

5-
14 Pass
6-
13 Fail
5+
21 Pass
6+
6 Fail
77
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim" should set the property value
88
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim initial" should not set the property value
99
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim 2000" should not set the property value
1010
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim scroll()" should not set the property value
1111
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim view()" should not set the property value
1212
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim --timeline" should not set the property value
1313
Pass Property animation value '1s linear 1s 2 reverse forwards paused anim'
14-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-delay
15-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-direction
16-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-duration
17-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-fill-mode
18-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-iteration-count
14+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-delay
15+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-direction
16+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-duration
17+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-fill-mode
18+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-iteration-count
1919
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-name
20-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-play-state
20+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-play-state
2121
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-end
2222
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-range-start
2323
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-timeline
24-
Fail e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-timing-function
24+
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should set animation-timing-function
2525
Pass e.style['animation'] = "1s linear 1s 2 reverse forwards paused anim1,\n 1s linear 1s 2 reverse forwards paused anim2,\n 1s linear 1s 2 reverse forwards paused anim3" should not set unrelated longhands
2626
Pass Animation shorthand can not represent non-initial timelines (specified)
2727
Pass Animation shorthand can not represent non-initial timelines (computed)

Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-timeline-computed.txt

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

33
Found 44 tests
44

5-
42 Pass
6-
2 Fail
5+
44 Pass
76
Pass Property animation-timeline value 'initial'
87
Pass Property animation-timeline value 'inherit'
98
Pass Property animation-timeline value 'unset'
109
Pass Property animation-timeline value 'revert'
1110
Pass Property animation-timeline value 'auto'
1211
Pass Property animation-timeline value 'none'
13-
Fail Property animation-timeline value 'auto, auto'
14-
Fail Property animation-timeline value 'none, none'
12+
Pass Property animation-timeline value 'auto, auto'
13+
Pass Property animation-timeline value 'none, none'
1514
Pass Property animation-timeline value 'auto, none'
1615
Pass Property animation-timeline value 'none, auto'
1716
Pass Property animation-timeline value '--test'

Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/animation-timeline-parsing.txt

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

33
Found 69 tests
44

5-
67 Pass
6-
2 Fail
5+
69 Pass
76
Pass e.style['animation-timeline'] = "initial" should set the property value
87
Pass e.style['animation-timeline'] = "inherit" should set the property value
98
Pass e.style['animation-timeline'] = "unset" should set the property value
109
Pass e.style['animation-timeline'] = "revert" should set the property value
1110
Pass e.style['animation-timeline'] = "auto" should set the property value
1211
Pass e.style['animation-timeline'] = "none" should set the property value
13-
Fail e.style['animation-timeline'] = "auto, auto" should set the property value
14-
Fail e.style['animation-timeline'] = "none, none" should set the property value
12+
Pass e.style['animation-timeline'] = "auto, auto" should set the property value
13+
Pass e.style['animation-timeline'] = "none, none" should set the property value
1514
Pass e.style['animation-timeline'] = "auto, none" should set the property value
1615
Pass e.style['animation-timeline'] = "none, auto" should set the property value
1716
Pass e.style['animation-timeline'] = "--test" should set the property value

Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.txt

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

33
Found 14 tests
44

5-
13 Pass
6-
1 Fail
5+
14 Pass
76
Pass Property scroll-timeline-axis value 'initial'
87
Pass Property scroll-timeline-axis value 'inherit'
98
Pass Property scroll-timeline-axis value 'unset'
@@ -15,6 +14,6 @@ Pass Property scroll-timeline-axis value 'x'
1514
Pass Property scroll-timeline-axis value 'block, inline'
1615
Pass Property scroll-timeline-axis value 'inline, block'
1716
Pass Property scroll-timeline-axis value 'block, y, x, inline'
18-
Fail Property scroll-timeline-axis value 'inline, inline, inline, inline'
17+
Pass Property scroll-timeline-axis value 'inline, inline, inline, inline'
1918
Pass The scroll-timeline-axis property shows up in CSSStyleDeclaration enumeration
2019
Pass The scroll-timeline-axis property shows up in CSSStyleDeclaration.cssText

0 commit comments

Comments
 (0)