Skip to content

Commit aae73f7

Browse files
committed
Add SVG paint attributes
Fixes htacg#903
1 parent 1889880 commit aae73f7

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

include/tidyenum.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,22 @@ typedef enum
13431343

13441344
TidyAttr_XMLNSXLINK, /**< svg xmls:xlink="url" */
13451345

1346+
/* SVG paint attributes (SVG 1.1) */
1347+
TidyAttr_FILL, /**< FILL= */
1348+
TidyAttr_FILLRULE, /**< FILLRULE= */
1349+
TidyAttr_STROKE, /**< STROKE= */
1350+
TidyAttr_STROKEDASHARRAY, /**< STROKEDASHARRAY= */
1351+
TidyAttr_STROKEDASHOFFSET, /**< STROKEDASHOFFSET= */
1352+
TidyAttr_STROKELINECAP, /**< STROKELINECAP= */
1353+
TidyAttr_STROKELINEJOIN, /**< STROKELINEJOIN= */
1354+
TidyAttr_STROKEMITERLIMIT, /**< STROKEMITERLIMIT= */
1355+
TidyAttr_STROKEWIDTH, /**< STROKEWIDTH= */
1356+
TidyAttr_COLORINTERPOLATION, /**< COLORINTERPOLATION= */
1357+
TidyAttr_COLORRENDERING, /**< COLORRENDERING= */
1358+
TidyAttr_OPACITY, /**< OPACITY= */
1359+
TidyAttr_STROKEOPACITY, /**< STROKEOPACITY= */
1360+
TidyAttr_FILLOPACITY, /**< FILLOPACITY= */
1361+
13461362
N_TIDY_ATTRIBS /**< Must be last */
13471363
} TidyAttrId;
13481364

src/attrdict.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,20 @@ const AttrVersion TY_(W3CAttrsFor_SVG)[] =
31023102
{ TidyAttr_BASEPROFILE, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 },
31033103
{ TidyAttr_CONTENTSCRIPTTYPE, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 },
31043104
{ TidyAttr_CONTENTSTYLETYPE, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 },
3105+
{ TidyAttr_FILL, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3106+
{ TidyAttr_FILLRULE, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3107+
{ TidyAttr_STROKE, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3108+
{ TidyAttr_STROKEDASHARRAY, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3109+
{ TidyAttr_STROKEDASHOFFSET, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3110+
{ TidyAttr_STROKELINECAP, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3111+
{ TidyAttr_STROKELINEJOIN, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3112+
{ TidyAttr_STROKEMITERLIMIT, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3113+
{ TidyAttr_STROKEWIDTH, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3114+
{ TidyAttr_COLORINTERPOLATION, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3115+
{ TidyAttr_COLORRENDERING, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3116+
{ TidyAttr_OPACITY, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3117+
{ TidyAttr_STROKEOPACITY, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
3118+
{ TidyAttr_FILLOPACITY, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 },
31053119
INCLUDE_CORE_ATTRIBS
31063120
INCLUDE_CORE_EVENTS
31073121
INCLUDE_RDFA

src/attrs.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,23 @@ static const Attribute attribute_defs [] =
440440
/* for xmlns:xlink in <svg> */
441441
{ TidyAttr_XMLNSXLINK, "xmlns:xlink", CH_URL },
442442

443+
/* SVG paint attributes (SVG 1.1) */
444+
{ TidyAttr_COLOR, "color", CH_PCDATA }, /* for <svg> */
445+
{ TidyAttr_FILL, "fill", CH_PCDATA }, /* for <svg> */
446+
{ TidyAttr_FILLRULE, "fill-rule", CH_PCDATA }, /* for <svg> */
447+
{ TidyAttr_STROKE, "stroke", CH_PCDATA }, /* for <svg> */
448+
{ TidyAttr_STROKEDASHARRAY, "stroke-dasharray", CH_PCDATA }, /* for <svg> */
449+
{ TidyAttr_STROKEDASHOFFSET, "stroke-dashoffset", CH_PCDATA }, /* for <svg> */
450+
{ TidyAttr_STROKELINECAP, "stroke-linecap", CH_PCDATA }, /* for <svg> */
451+
{ TidyAttr_STROKELINEJOIN, "stroke-linejoin", CH_PCDATA }, /* for <svg> */
452+
{ TidyAttr_STROKEMITERLIMIT, "stroke-miterlimit", CH_PCDATA }, /* for <svg> */
453+
{ TidyAttr_STROKEWIDTH, "stroke-width", CH_PCDATA }, /* for <svg> */
454+
{ TidyAttr_COLORINTERPOLATION, "color-interpolation", CH_PCDATA }, /* for <svg> */
455+
{ TidyAttr_COLORRENDERING, "color-rendering", CH_PCDATA }, /* for <svg> */
456+
{ TidyAttr_OPACITY, "opacity", CH_PCDATA }, /* for <svg> */
457+
{ TidyAttr_STROKEOPACITY, "stroke-opacity", CH_PCDATA }, /* for <svg> */
458+
{ TidyAttr_FILLOPACITY, "fill-opacity", CH_PCDATA }, /* for <svg> */
459+
443460
/* this must be the final entry */
444461
{ N_TIDY_ATTRIBS, NULL, NULL }
445462
};

0 commit comments

Comments
 (0)