|
1 |
| -/*global Validation, ValidationTypes, ValidationError*/ |
2 | 1 | /*exported Properties*/
|
3 | 2 | var Properties = {
|
4 | 3 | __proto__: null,
|
@@ -53,36 +52,7 @@ var Properties = {
|
53 | 52 | "-o-animation-play-state" : { multi: "running | paused", comma: true },
|
54 | 53 |
|
55 | 54 | "appearance" : "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none",
|
56 |
| - "azimuth" : function (expression) { |
57 |
| - var simple = "<angle> | leftwards | rightwards | inherit", |
58 |
| - direction = "left-side | far-left | left | center-left | center | center-right | right | far-right | right-side", |
59 |
| - behind = false, |
60 |
| - valid = false, |
61 |
| - part; |
62 |
| - |
63 |
| - if (!ValidationTypes.isAny(expression, simple)) { |
64 |
| - if (ValidationTypes.isAny(expression, "behind")) { |
65 |
| - behind = true; |
66 |
| - valid = true; |
67 |
| - } |
68 |
| - |
69 |
| - if (ValidationTypes.isAny(expression, direction)) { |
70 |
| - valid = true; |
71 |
| - if (!behind) { |
72 |
| - ValidationTypes.isAny(expression, "behind"); |
73 |
| - } |
74 |
| - } |
75 |
| - } |
76 |
| - |
77 |
| - if (expression.hasNext()) { |
78 |
| - part = expression.next(); |
79 |
| - if (valid) { |
80 |
| - throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col); |
81 |
| - } else { |
82 |
| - throw new ValidationError("Expected (<'azimuth'>) but found '" + part + "'.", part.line, part.col); |
83 |
| - } |
84 |
| - } |
85 |
| - }, |
| 55 | + "azimuth" : "<azimuth>", |
86 | 56 |
|
87 | 57 | //B
|
88 | 58 | "backface-visibility" : "visible | hidden",
|
@@ -115,83 +85,14 @@ var Properties = {
|
115 | 85 | "border-image" : 1,
|
116 | 86 | "border-image-outset" : { multi: "<length> | <number>", max: 4 },
|
117 | 87 | "border-image-repeat" : { multi: "stretch | repeat | round", max: 2 },
|
118 |
| - "border-image-slice" : function(expression) { |
119 |
| - |
120 |
| - var valid = false, |
121 |
| - numeric = "<number> | <percentage>", |
122 |
| - fill = false, |
123 |
| - count = 0, |
124 |
| - max = 4, |
125 |
| - part; |
126 |
| - |
127 |
| - if (ValidationTypes.isAny(expression, "fill")) { |
128 |
| - fill = true; |
129 |
| - valid = true; |
130 |
| - } |
131 |
| - |
132 |
| - while (expression.hasNext() && count < max) { |
133 |
| - valid = ValidationTypes.isAny(expression, numeric); |
134 |
| - if (!valid) { |
135 |
| - break; |
136 |
| - } |
137 |
| - count++; |
138 |
| - } |
139 |
| - |
140 |
| - |
141 |
| - if (!fill) { |
142 |
| - ValidationTypes.isAny(expression, "fill"); |
143 |
| - } else { |
144 |
| - valid = true; |
145 |
| - } |
146 |
| - |
147 |
| - if (expression.hasNext()) { |
148 |
| - part = expression.next(); |
149 |
| - if (valid) { |
150 |
| - throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col); |
151 |
| - } else { |
152 |
| - throw new ValidationError("Expected ([<number> | <percentage>]{1,4} && fill?) but found '" + part + "'.", part.line, part.col); |
153 |
| - } |
154 |
| - } |
155 |
| - }, |
| 88 | + "border-image-slice" : "<border-image-slice>", |
156 | 89 | "border-image-source" : "<image> | none",
|
157 | 90 | "border-image-width" : { multi: "<length> | <percentage> | <number> | auto", max: 4 },
|
158 | 91 | "border-left" : "<border-width> || <border-style> || <color>",
|
159 | 92 | "border-left-color" : "<color>",
|
160 | 93 | "border-left-style" : "<border-style>",
|
161 | 94 | "border-left-width" : "<border-width>",
|
162 |
| - "border-radius" : function(expression) { |
163 |
| - |
164 |
| - var valid = false, |
165 |
| - simple = "<length> | <percentage> | inherit", |
166 |
| - slash = false, |
167 |
| - count = 0, |
168 |
| - max = 8, |
169 |
| - part; |
170 |
| - |
171 |
| - while (expression.hasNext() && count < max) { |
172 |
| - valid = ValidationTypes.isAny(expression, simple); |
173 |
| - if (!valid) { |
174 |
| - |
175 |
| - if (String(expression.peek()) === "/" && count > 0 && !slash) { |
176 |
| - slash = true; |
177 |
| - max = count + 5; |
178 |
| - expression.next(); |
179 |
| - } else { |
180 |
| - break; |
181 |
| - } |
182 |
| - } |
183 |
| - count++; |
184 |
| - } |
185 |
| - |
186 |
| - if (expression.hasNext()) { |
187 |
| - part = expression.next(); |
188 |
| - if (valid) { |
189 |
| - throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col); |
190 |
| - } else { |
191 |
| - throw new ValidationError("Expected (<'border-radius'>) but found '" + part + "'.", part.line, part.col); |
192 |
| - } |
193 |
| - } |
194 |
| - }, |
| 95 | + "border-radius" : "<border-radius>", |
195 | 96 | "border-right" : "<border-width> || <border-style> || <color>",
|
196 | 97 | "border-right-color" : "<color>",
|
197 | 98 | "border-right-style" : "<border-style>",
|
@@ -226,18 +127,7 @@ var Properties = {
|
226 | 127 | "-webkit-box-orient" : "horizontal | vertical | inline-axis | block-axis",
|
227 | 128 | "-webkit-box-pack" : "start | end | center | justify",
|
228 | 129 | "box-decoration-break" : "slice | clone",
|
229 |
| - "box-shadow" : function (expression) { |
230 |
| - var part; |
231 |
| - |
232 |
| - if (!ValidationTypes.isAny(expression, "none")) { |
233 |
| - Validation.multiProperty("<shadow>", expression, true, Infinity); |
234 |
| - } else { |
235 |
| - if (expression.hasNext()) { |
236 |
| - part = expression.next(); |
237 |
| - throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col); |
238 |
| - } |
239 |
| - } |
240 |
| - }, |
| 130 | + "box-shadow" : "<box-shadow>", |
241 | 131 | "box-sizing" : "content-box | border-box",
|
242 | 132 | "break-after" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
|
243 | 133 | "break-before" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
|
|
0 commit comments