Skip to content

Commit b19840b

Browse files
saschanazsandersn
authored andcommitted
Add SVG Paint Servers types (#759)
1 parent 67a8eaa commit b19840b

File tree

6 files changed

+98
-13
lines changed

6 files changed

+98
-13
lines changed

baselines/dom.generated.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,8 +3048,8 @@ interface CSSStyleDeclaration {
30483048
scale: string;
30493049
scrollBehavior: string;
30503050
shapeRendering: string;
3051-
stopColor: string | null;
3052-
stopOpacity: string | null;
3051+
stopColor: string;
3052+
stopOpacity: string;
30533053
stroke: string;
30543054
strokeDasharray: string;
30553055
strokeDashoffset: string;
@@ -14372,7 +14372,7 @@ declare var SVGPathSegMovetoRel: {
1437214372
};
1437314373

1437414374
/** Corresponds to the <pattern> element. */
14375-
interface SVGPatternElement extends SVGElement, SVGFitToViewBox, SVGTests, SVGURIReference {
14375+
interface SVGPatternElement extends SVGElement, SVGFitToViewBox, SVGURIReference {
1437614376
readonly height: SVGAnimatedLength;
1437714377
readonly patternContentUnits: SVGAnimatedEnumeration;
1437814378
readonly patternTransform: SVGAnimatedTransformList;
@@ -14478,6 +14478,7 @@ declare var SVGPreserveAspectRatio: {
1447814478
interface SVGRadialGradientElement extends SVGGradientElement {
1447914479
readonly cx: SVGAnimatedLength;
1448014480
readonly cy: SVGAnimatedLength;
14481+
readonly fr: SVGAnimatedLength;
1448114482
readonly fx: SVGAnimatedLength;
1448214483
readonly fy: SVGAnimatedLength;
1448314484
readonly r: SVGAnimatedLength;

inputfiles/addedTypes.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,14 @@
21092109
}
21102110
]
21112111
},
2112+
"SVGLinearGradientElement": {
2113+
"element": [
2114+
{
2115+
"namespace": "SVG",
2116+
"name": "linearGradient"
2117+
}
2118+
]
2119+
},
21122120
"SVGLineElement": {
21132121
"element": [
21142122
{
@@ -2133,6 +2141,14 @@
21332141
}
21342142
]
21352143
},
2144+
"SVGPatternElement": {
2145+
"element": [
2146+
{
2147+
"namespace": "SVG",
2148+
"name": "pattern"
2149+
}
2150+
]
2151+
},
21362152
"SVGPolygonElement": {
21372153
"element": [
21382154
{
@@ -2149,6 +2165,22 @@
21492165
}
21502166
]
21512167
},
2168+
"SVGRadialGradientElement": {
2169+
"element": [
2170+
{
2171+
"namespace": "SVG",
2172+
"name": "radialGradient"
2173+
}
2174+
]
2175+
},
2176+
"SVGStopElement": {
2177+
"element": [
2178+
{
2179+
"namespace": "SVG",
2180+
"name": "stop"
2181+
}
2182+
]
2183+
},
21522184
"SVGTextElement": {
21532185
"element": [
21542186
{
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[Exposed=Window]
2+
interface SVGGradientElement : SVGElement {
3+
4+
// Spread Method Types
5+
const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
6+
const unsigned short SVG_SPREADMETHOD_PAD = 1;
7+
const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
8+
const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
9+
10+
[SameObject] readonly attribute SVGAnimatedEnumeration gradientUnits;
11+
[SameObject] readonly attribute SVGAnimatedTransformList gradientTransform;
12+
[SameObject] readonly attribute SVGAnimatedEnumeration spreadMethod;
13+
};
14+
15+
SVGGradientElement includes SVGURIReference;
16+
17+
[Exposed=Window]
18+
interface SVGLinearGradientElement : SVGGradientElement {
19+
[SameObject] readonly attribute SVGAnimatedLength x1;
20+
[SameObject] readonly attribute SVGAnimatedLength y1;
21+
[SameObject] readonly attribute SVGAnimatedLength x2;
22+
[SameObject] readonly attribute SVGAnimatedLength y2;
23+
};
24+
25+
[Exposed=Window]
26+
interface SVGRadialGradientElement : SVGGradientElement {
27+
[SameObject] readonly attribute SVGAnimatedLength cx;
28+
[SameObject] readonly attribute SVGAnimatedLength cy;
29+
[SameObject] readonly attribute SVGAnimatedLength r;
30+
[SameObject] readonly attribute SVGAnimatedLength fx;
31+
[SameObject] readonly attribute SVGAnimatedLength fy;
32+
[SameObject] readonly attribute SVGAnimatedLength fr;
33+
};
34+
35+
[Exposed=Window]
36+
interface SVGStopElement : SVGElement {
37+
[SameObject] readonly attribute SVGAnimatedNumber offset;
38+
};
39+
40+
[Exposed=Window]
41+
interface SVGPatternElement : SVGElement {
42+
[SameObject] readonly attribute SVGAnimatedEnumeration patternUnits;
43+
[SameObject] readonly attribute SVGAnimatedEnumeration patternContentUnits;
44+
[SameObject] readonly attribute SVGAnimatedTransformList patternTransform;
45+
[SameObject] readonly attribute SVGAnimatedLength x;
46+
[SameObject] readonly attribute SVGAnimatedLength y;
47+
[SameObject] readonly attribute SVGAnimatedLength width;
48+
[SameObject] readonly attribute SVGAnimatedLength height;
49+
};
50+
51+
SVGPatternElement includes SVGFitToViewBox;
52+
SVGPatternElement includes SVGURIReference;
53+
54+
partial interface CSSStyleDeclaration {
55+
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString stopColor;
56+
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString stopOpacity;
57+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@
419419
"url": "https://www.w3.org/TR/SVG2/painting.html",
420420
"title": "SVG - Painting"
421421
},
422+
{
423+
"url": "https://www.w3.org/TR/SVG2/pservers.html",
424+
"title": "SVG - Paint Servers"
425+
},
422426
{
423427
"url": "https://www.w3.org/TR/SVG2/text.html",
424428
"title": "SVG - Text"

inputfiles/removedTypes.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@
217217
}
218218
}
219219
},
220-
"SVGGradientElement": {
221-
"implements": [
222-
"SVGUnitTypes"
223-
]
224-
},
225220
"SVGMatrix": null,
226221
"SVGMarkerElement": {
227222
"properties": {
@@ -230,11 +225,6 @@
230225
}
231226
}
232227
},
233-
"SVGPatternElement": {
234-
"implements": [
235-
"SVGUnitTypes"
236-
]
237-
},
238228
"SVGPoint": null,
239229
"SVGRect": null,
240230
"SVGSVGElement": {

src/idlfetcher.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const idlSelector = [
2222

2323
const cssPropSelector = [
2424
".propdef dfn", // CSS Fonts, SVG
25+
".propdef-title", // SVG Paint Servers
2526
"dfn.css[data-dfn-type=property]"
2627
].join(",");
2728

0 commit comments

Comments
 (0)