Skip to content

Commit 14be510

Browse files
tcl3AtkinsSJ
authored andcommitted
LibWeb: Add missing SVG presentation attributes
1 parent 0cae8dd commit 14be510

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

Libraries/LibWeb/SVG/SVGElement.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct NamedPropertyID {
4848

4949
static ReadonlySpan<NamedPropertyID> attribute_style_properties()
5050
{
51+
// https://svgwg.org/svg2-draft/styling.html#PresentationAttributes
5152
static Array const properties = {
5253
// FIXME: The `fill` attribute and CSS `fill` property are not the same! But our support is limited enough that they are equivalent for now.
5354
NamedPropertyID(CSS::PropertyID::Fill),
@@ -69,6 +70,7 @@ static ReadonlySpan<NamedPropertyID> attribute_style_properties()
6970
NamedPropertyID(CSS::PropertyID::FontFamily),
7071
NamedPropertyID(CSS::PropertyID::FontSize),
7172
NamedPropertyID(CSS::PropertyID::FontStyle),
73+
NamedPropertyID(CSS::PropertyID::FontVariant),
7274
NamedPropertyID(CSS::PropertyID::FontWeight),
7375
NamedPropertyID(CSS::PropertyID::Height, { SVG::TagNames::foreignObject, SVG::TagNames::image, SVG::TagNames::rect, SVG::TagNames::svg, SVG::TagNames::symbol, SVG::TagNames::use }),
7476
NamedPropertyID(CSS::PropertyID::ImageRendering),
@@ -94,6 +96,7 @@ static ReadonlySpan<NamedPropertyID> attribute_style_properties()
9496
NamedPropertyID(CSS::PropertyID::StrokeOpacity),
9597
NamedPropertyID(CSS::PropertyID::StrokeWidth),
9698
NamedPropertyID(CSS::PropertyID::TextAnchor),
99+
NamedPropertyID(CSS::PropertyID::TextDecoration),
97100
NamedPropertyID(CSS::PropertyID::TextRendering),
98101
NamedPropertyID(CSS::PropertyID::TextOverflow),
99102
NamedPropertyID(CSS::PropertyID::TransformOrigin),

Tests/LibWeb/Text/expected/wpt-import/svg/styling/presentation-attributes-irrelevant.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 48 tests
44

5-
45 Pass
6-
3 Fail
5+
47 Pass
6+
1 Fail
77
Pass clip-path presentation attribute supported on an irrelevant element
88
Pass clip-rule presentation attribute supported on an irrelevant element
99
Pass color presentation attribute supported on an irrelevant element
@@ -21,7 +21,7 @@ Pass font-family presentation attribute supported on an irrelevant element
2121
Pass font-size presentation attribute supported on an irrelevant element
2222
Fail font-stretch presentation attribute supported on an irrelevant element
2323
Pass font-style presentation attribute supported on an irrelevant element
24-
Fail font-variant presentation attribute supported on an irrelevant element
24+
Pass font-variant presentation attribute supported on an irrelevant element
2525
Pass font-weight presentation attribute supported on an irrelevant element
2626
Pass image-rendering presentation attribute supported on an irrelevant element
2727
Pass letter-spacing presentation attribute supported on an irrelevant element
@@ -43,7 +43,7 @@ Pass stroke-miterlimit presentation attribute supported on an irrelevant element
4343
Pass stroke-opacity presentation attribute supported on an irrelevant element
4444
Pass stroke-width presentation attribute supported on an irrelevant element
4545
Pass text-anchor presentation attribute supported on an irrelevant element
46-
Fail text-decoration presentation attribute supported on an irrelevant element
46+
Pass text-decoration presentation attribute supported on an irrelevant element
4747
Pass text-overflow presentation attribute supported on an irrelevant element
4848
Pass text-rendering presentation attribute supported on an irrelevant element
4949
Pass transform-origin presentation attribute supported on an irrelevant element

Tests/LibWeb/Text/expected/wpt-import/svg/styling/presentation-attributes-relevant.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 58 tests
44

5-
54 Pass
6-
4 Fail
5+
56 Pass
6+
2 Fail
77
Pass clip-path presentation attribute supported on a relevant element
88
Pass clip-rule presentation attribute supported on a relevant element
99
Pass color presentation attribute supported on a relevant element
@@ -23,7 +23,7 @@ Pass font-family presentation attribute supported on a relevant element
2323
Pass font-size presentation attribute supported on a relevant element
2424
Fail font-stretch presentation attribute supported on a relevant element
2525
Pass font-style presentation attribute supported on a relevant element
26-
Fail font-variant presentation attribute supported on a relevant element
26+
Pass font-variant presentation attribute supported on a relevant element
2727
Pass font-weight presentation attribute supported on a relevant element
2828
Pass height presentation attribute supported on a relevant element
2929
Pass image-rendering presentation attribute supported on a relevant element
@@ -49,7 +49,7 @@ Pass stroke-miterlimit presentation attribute supported on a relevant element
4949
Pass stroke-opacity presentation attribute supported on a relevant element
5050
Pass stroke-width presentation attribute supported on a relevant element
5151
Pass text-anchor presentation attribute supported on a relevant element
52-
Fail text-decoration presentation attribute supported on a relevant element
52+
Pass text-decoration presentation attribute supported on a relevant element
5353
Pass text-overflow presentation attribute supported on a relevant element
5454
Pass text-rendering presentation attribute supported on a relevant element
5555
Pass transform-origin presentation attribute supported on a relevant element

Tests/LibWeb/Text/expected/wpt-import/svg/styling/presentation-attributes-unknown.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 48 tests
44

5-
45 Pass
6-
3 Fail
5+
47 Pass
6+
1 Fail
77
Pass clip-path presentation attribute supported on an unknown SVG element
88
Pass clip-rule presentation attribute supported on an unknown SVG element
99
Pass color presentation attribute supported on an unknown SVG element
@@ -21,7 +21,7 @@ Pass font-family presentation attribute supported on an unknown SVG element
2121
Pass font-size presentation attribute supported on an unknown SVG element
2222
Fail font-stretch presentation attribute supported on an unknown SVG element
2323
Pass font-style presentation attribute supported on an unknown SVG element
24-
Fail font-variant presentation attribute supported on an unknown SVG element
24+
Pass font-variant presentation attribute supported on an unknown SVG element
2525
Pass font-weight presentation attribute supported on an unknown SVG element
2626
Pass image-rendering presentation attribute supported on an unknown SVG element
2727
Pass letter-spacing presentation attribute supported on an unknown SVG element
@@ -43,7 +43,7 @@ Pass stroke-miterlimit presentation attribute supported on an unknown SVG elemen
4343
Pass stroke-opacity presentation attribute supported on an unknown SVG element
4444
Pass stroke-width presentation attribute supported on an unknown SVG element
4545
Pass text-anchor presentation attribute supported on an unknown SVG element
46-
Fail text-decoration presentation attribute supported on an unknown SVG element
46+
Pass text-decoration presentation attribute supported on an unknown SVG element
4747
Pass text-overflow presentation attribute supported on an unknown SVG element
4848
Pass text-rendering presentation attribute supported on an unknown SVG element
4949
Pass transform-origin presentation attribute supported on an unknown SVG element

0 commit comments

Comments
 (0)