Skip to content

Commit 444d2e1

Browse files
committed
Merge pull request #213 from mattiacci/svg
Add all remaining SVG properties
2 parents 7a2eeb2 + 2391d1a commit 444d2e1

File tree

2 files changed

+238
-2
lines changed

2 files changed

+238
-2
lines changed

src/css/Properties.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ var Properties = module.exports = {
144144
"clip-path" : "<clip-source> | <clip-path> | none",
145145
"clip-rule" : "nonzero | evenodd",
146146
"color" : "<color>",
147+
"color-interpolation" : "auto | sRGB | linearRGB",
148+
"color-interpolation-filters" : "auto | sRGB | linearRGB",
147149
"color-profile" : 1,
150+
"color-rendering" : "auto | optimizeSpeed | optimizeQuality",
148151
"column-count" : "<integer> | auto", //http://www.w3.org/TR/css3-multicol/
149152
"column-fill" : "auto | balance",
150153
"column-gap" : "<length> | normal",
@@ -178,6 +181,7 @@ var Properties = module.exports = {
178181
//E
179182
"elevation" : "<angle> | below | level | above | higher | lower",
180183
"empty-cells" : "show | hide",
184+
"enable-background" : 1,
181185

182186
//F
183187
"fill" : "<paint>",
@@ -208,6 +212,8 @@ var Properties = module.exports = {
208212
"-ms-flex-wrap" : "nowrap | wrap | wrap-reverse",
209213
"float" : "left | right | none",
210214
"float-offset" : 1,
215+
"flood-color" : 1,
216+
"flood-opacity" : "<opacity-value>",
211217
"font" : "<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar",
212218
"font-family" : "<font-family>",
213219
"font-feature-settings" : "<feature-tag-value> | normal",
@@ -269,7 +275,7 @@ var Properties = module.exports = {
269275
//I
270276
"icon" : 1,
271277
"image-orientation" : "angle | auto",
272-
"image-rendering" : 1,
278+
"image-rendering" : "auto | optimizeSpeed | optimizeQuality",
273279
"image-resolution" : 1,
274280
"ime-mode" : "auto | normal | active | inactive | disabled",
275281
"inline-box-align" : "last | <integer>",
@@ -278,6 +284,9 @@ var Properties = module.exports = {
278284
"justify-content" : "flex-start | flex-end | center | space-between | space-around",
279285
"-webkit-justify-content" : "flex-start | flex-end | center | space-between | space-around",
280286

287+
//K
288+
"kerning" : "auto | <length>",
289+
281290
//L
282291
"left" : "<margin-width>",
283292
"letter-spacing" : "<length> | normal",
@@ -301,11 +310,16 @@ var Properties = module.exports = {
301310
"mark" : 1,
302311
"mark-after" : 1,
303312
"mark-before" : 1,
313+
"marker" : 1,
314+
"marker-end" : 1,
315+
"marker-mid" : 1,
316+
"marker-start" : 1,
304317
"marks" : 1,
305318
"marquee-direction" : 1,
306319
"marquee-play-count" : 1,
307320
"marquee-speed" : 1,
308321
"marquee-style" : 1,
322+
"mask" : 1,
309323
"max-height" : "<length> | <percentage> | <content-sizing> | none",
310324
"max-width" : "<length> | <percentage> | <content-sizing> | none",
311325
"min-height" : "<length> | <percentage> | <content-sizing> | contain-floats | -moz-contain-floats | -webkit-contain-floats",
@@ -381,13 +395,16 @@ var Properties = module.exports = {
381395
"ruby-span" : 1,
382396

383397
//S
398+
"shape-rendering" : "auto | optimizeSpeed | crispEdges | geometricPrecision",
384399
"size" : 1,
385400
"speak" : "normal | none | spell-out",
386401
"speak-header" : "once | always",
387402
"speak-numeral" : "digits | continuous",
388403
"speak-punctuation" : "code | none",
389404
"speech-rate" : 1,
390405
"src" : 1,
406+
"stop-color" : 1,
407+
"stop-opacity" : "<opacity-value>",
391408
"stress" : 1,
392409
"string-set" : 1,
393410
"stroke" : "<paint>",
@@ -405,9 +422,9 @@ var Properties = module.exports = {
405422
"target-name" : 1,
406423
"target-new" : 1,
407424
"target-position" : 1,
408-
"text-anchor" : "start | middle | end",
409425
"text-align" : "left | right | center | justify | match-parent | start | end" ,
410426
"text-align-last" : 1,
427+
"text-anchor" : "start | middle | end",
411428
"text-decoration" : "<text-decoration>",
412429
"text-emphasis" : 1,
413430
"text-height" : 1,

tests/css/Validation.js

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ var YUITest = require("yuitest"),
8383

8484
var suite = new YUITest.TestSuite("Validation Tests");
8585

86+
suite.add(new ValidationTestCase({
87+
property: "alignment-baseline",
88+
89+
valid: [
90+
"auto",
91+
"baseline",
92+
"use-script",
93+
"before-edge",
94+
"text-before-edge",
95+
"after-edge",
96+
"text-after-edge",
97+
"central",
98+
"middle",
99+
"ideographic",
100+
"alphabetic",
101+
"hanging",
102+
"mathematical"
103+
],
104+
105+
invalid: {
106+
"foo" : "Expected (auto | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical) but found 'foo'."
107+
}
108+
}));
109+
86110
suite.add(new ValidationTestCase({
87111
property: "animation-direction",
88112

@@ -312,8 +336,21 @@ var YUITest = require("yuitest"),
312336
}
313337
}));
314338

339+
suite.add(new ValidationTestCase({
340+
property: "baseline-shift",
315341

342+
valid: [
343+
"baseline",
344+
"sub",
345+
"super",
346+
"5%",
347+
"2px"
348+
],
316349

350+
invalid: {
351+
"foo" : "Expected (baseline | sub | super | <percentage> | <length>) but found 'foo'."
352+
}
353+
}));
317354

318355
suite.add(new ValidationTestCase({
319356
property: "border",
@@ -683,6 +720,48 @@ var YUITest = require("yuitest"),
683720
}
684721
}));
685722

723+
suite.add(new ValidationTestCase({
724+
property: "color-interpolation",
725+
726+
valid: [
727+
"auto",
728+
"sRGB",
729+
"linearRGB"
730+
],
731+
732+
invalid: {
733+
"foo" : "Expected (auto | sRGB | linearRGB) but found 'foo'."
734+
}
735+
}));
736+
737+
suite.add(new ValidationTestCase({
738+
property: "color-interpolation-filters",
739+
740+
valid: [
741+
"auto",
742+
"sRGB",
743+
"linearRGB"
744+
],
745+
746+
invalid: {
747+
"foo" : "Expected (auto | sRGB | linearRGB) but found 'foo'."
748+
}
749+
}));
750+
751+
suite.add(new ValidationTestCase({
752+
property: "color-rendering",
753+
754+
valid: [
755+
"auto",
756+
"optimizeSpeed",
757+
"optimizeQuality"
758+
],
759+
760+
invalid: {
761+
"foo" : "Expected (auto | optimizeSpeed | optimizeQuality) but found 'foo'."
762+
}
763+
}));
764+
686765
suite.add(new ValidationTestCase({
687766
property: "display",
688767

@@ -741,6 +820,61 @@ var YUITest = require("yuitest"),
741820
}
742821
}));
743822

823+
suite.add(new ValidationTestCase({
824+
property: "dominant-baseline",
825+
826+
valid: [
827+
"auto",
828+
"use-script",
829+
"no-change",
830+
"reset-size",
831+
"ideographic",
832+
"alphabetic",
833+
"hanging",
834+
"mathematical",
835+
"central",
836+
"middle",
837+
"text-after-edge",
838+
"text-before-edge"
839+
],
840+
841+
invalid: {
842+
"foo" : "Expected (auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge) but found 'foo'."
843+
}
844+
}));
845+
846+
suite.add(new ValidationTestCase({
847+
property: "fill-opacity",
848+
849+
valid: [
850+
"0",
851+
"0.5",
852+
"1"
853+
],
854+
855+
invalid: {
856+
"-0.75" : "Expected (<opacity-value>) but found '-0.75'.",
857+
"12" : "Expected (<opacity-value>) but found '12'.",
858+
"foo" : "Expected (<opacity-value>) but found 'foo'."
859+
}
860+
}));
861+
862+
suite.add(new ValidationTestCase({
863+
property: "flood-opacity",
864+
865+
valid: [
866+
"0",
867+
"0.5",
868+
"1"
869+
],
870+
871+
invalid: {
872+
"-0.75" : "Expected (<opacity-value>) but found '-0.75'.",
873+
"12" : "Expected (<opacity-value>) but found '12'.",
874+
"foo" : "Expected (<opacity-value>) but found 'foo'."
875+
}
876+
}));
877+
744878
suite.add(new ValidationTestCase({
745879
property: "font",
746880

@@ -883,6 +1017,35 @@ var YUITest = require("yuitest"),
8831017
]
8841018
}));
8851019

1020+
suite.add(new ValidationTestCase({
1021+
property: "image-rendering",
1022+
1023+
valid: [
1024+
"auto",
1025+
"optimizeSpeed",
1026+
"optimizeQuality"
1027+
],
1028+
1029+
invalid: {
1030+
"foo" : "Expected (auto | optimizeSpeed | optimizeQuality) but found 'foo'."
1031+
}
1032+
}));
1033+
1034+
suite.add(new ValidationTestCase({
1035+
property: "kerning",
1036+
1037+
valid: [
1038+
"auto",
1039+
"0.1em",
1040+
"1px"
1041+
],
1042+
1043+
invalid: {
1044+
"5%" : "Expected (auto | <length>) but found '5%'.",
1045+
"foo" : "Expected (auto | <length>) but found 'foo'."
1046+
}
1047+
}));
1048+
8861049
suite.add(new ValidationTestCase({
8871050
property: "min-height",
8881051

@@ -1119,6 +1282,62 @@ var YUITest = require("yuitest"),
11191282
}
11201283
}));
11211284

1285+
suite.add(new ValidationTestCase({
1286+
property: "shape-rendering",
1287+
1288+
valid: [
1289+
"auto",
1290+
"optimizeSpeed",
1291+
"crispEdges",
1292+
"geometricPrecision"
1293+
],
1294+
1295+
invalid: {
1296+
"foo" : "Expected (auto | optimizeSpeed | crispEdges | geometricPrecision) but found 'foo'."
1297+
}
1298+
}));
1299+
1300+
suite.add(new ValidationTestCase({
1301+
property: "stop-opacity",
1302+
1303+
valid: [
1304+
"0",
1305+
"0.5",
1306+
"1"
1307+
],
1308+
1309+
invalid: {
1310+
"foo" : "Expected (<opacity-value>) but found 'foo'."
1311+
}
1312+
}));
1313+
1314+
suite.add(new ValidationTestCase({
1315+
property: "stroke-opacity",
1316+
1317+
valid: [
1318+
"0",
1319+
"0.5",
1320+
"1"
1321+
],
1322+
1323+
invalid: {
1324+
"foo" : "Expected (<opacity-value>) but found 'foo'."
1325+
}
1326+
}));
1327+
1328+
suite.add(new ValidationTestCase({
1329+
property: "stroke-width",
1330+
1331+
valid: [
1332+
"5%",
1333+
"2px"
1334+
],
1335+
1336+
invalid: {
1337+
"foo" : "Expected (<percentage> | <length>) but found 'foo'."
1338+
}
1339+
}));
1340+
11221341
suite.add(new ValidationTestCase({
11231342
property: "text-anchor",
11241343

0 commit comments

Comments
 (0)