@@ -83,6 +83,30 @@ var YUITest = require("yuitest"),
83
83
84
84
var suite = new YUITest . TestSuite ( "Validation Tests" ) ;
85
85
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
+
86
110
suite . add ( new ValidationTestCase ( {
87
111
property : "animation-direction" ,
88
112
@@ -312,8 +336,21 @@ var YUITest = require("yuitest"),
312
336
}
313
337
} ) ) ;
314
338
339
+ suite . add ( new ValidationTestCase ( {
340
+ property : "baseline-shift" ,
315
341
342
+ valid : [
343
+ "baseline" ,
344
+ "sub" ,
345
+ "super" ,
346
+ "5%" ,
347
+ "2px"
348
+ ] ,
316
349
350
+ invalid : {
351
+ "foo" : "Expected (baseline | sub | super | <percentage> | <length>) but found 'foo'."
352
+ }
353
+ } ) ) ;
317
354
318
355
suite . add ( new ValidationTestCase ( {
319
356
property : "border" ,
@@ -683,6 +720,48 @@ var YUITest = require("yuitest"),
683
720
}
684
721
} ) ) ;
685
722
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
+
686
765
suite . add ( new ValidationTestCase ( {
687
766
property : "display" ,
688
767
@@ -741,6 +820,61 @@ var YUITest = require("yuitest"),
741
820
}
742
821
} ) ) ;
743
822
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
+
744
878
suite . add ( new ValidationTestCase ( {
745
879
property : "font" ,
746
880
@@ -883,6 +1017,35 @@ var YUITest = require("yuitest"),
883
1017
]
884
1018
} ) ) ;
885
1019
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
+
886
1049
suite . add ( new ValidationTestCase ( {
887
1050
property : "min-height" ,
888
1051
@@ -1119,6 +1282,62 @@ var YUITest = require("yuitest"),
1119
1282
}
1120
1283
} ) ) ;
1121
1284
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
+
1122
1341
suite . add ( new ValidationTestCase ( {
1123
1342
property : "text-anchor" ,
1124
1343
0 commit comments