/[suikacvs]/webroot/www/css/jsie/Property.js
Suika

Contents of /webroot/www/css/jsie/Property.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sun Dec 30 03:09:38 2007 UTC (17 years, 3 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: application/javascript
Copied from http://suika.fam.cx/gate/cvs/www/cx/fam/suika/y2005/CSS/

1 if (typeof (cx) == "undefined") {
2 cx = {};
3 }
4 if (typeof (cx.fam) == "undefined") {
5 cx.fam = {};
6 }
7 if (typeof (cx.fam.suika) == "undefined") {
8 cx.fam.suika = {};
9 }
10 if (typeof (cx.fam.suika.y2005) == "undefined") {
11 cx.fam.suika.y2005 = {};
12 }
13 if (typeof (cx.fam.suika.y2005.CSS) == "undefined") {
14 cx.fam.suika.y2005.CSS = {};
15 }
16 if (typeof (cx.fam.suika.y2005.CSS.Property) == "undefined") {
17 cx.fam.suika.y2005.CSS.Property = {};
18 }
19
20 JSAN.require ("cx.fam.suika.y2005.CSS.Value");
21 JSAN.require ("cx.fam.suika.y2005.DOM.Node");
22
23 cx.fam.suika.y2005.DOM.Node.Element._AddFeature
24 ("http://suika.fam.cx/www/cx/fam/suika/y2005/CSS/Property#", "1.0", {
25 _GetComputedValueSetForMedia: function (mediaManager) {
26 return this._Node._ComputedStyle;
27 },
28 _SetComputedValueSetForMedia: function (propSet, mediaManager) {
29 this._Node._ComputedStyle = propSet;
30 }
31 /* TODO: |mediaManager| support */
32 });
33
34 /**
35 Interface |CSSPropertyValueComputer|
36
37 Literal : |supported| |unsupported| |invalid| |ill@formed|
38 <(tokenization)>
39 Tokenized : |supported| |unsupported| |invalid| |ill| |formed|
40 <parseValueFromTokens>
41 Declared0 : "supported" "unsupported" "invalid" null
42 or null
43 <setDeclaredValue> <convertToDeclaredValue> <isValidValue>
44 Declared1 : "supported" "unsupported" null N/A
45 <isSupportedValue>
46 Specified : "supported" N/A N/A N/A
47
48
49
50 |textual representation|
51 "CSSValue object"
52 */
53 cx.fam.suika.y2005.CSS.Property.Computer =
54 function (uaStyleSheetList, userStyleSheetList) {
55 this.userAgentStyleSheetList = uaStyleSheetList != null
56 ? uaStyleSheetList
57 : new cx.fam.suika.y2005.CSS.StyleSheetList ();
58 this.userStyleSheetList = userStyleSheetList != null
59 ? userStyleSheetList
60 : new cx.fam.suika.y2005.CSS.StyleSheetList ();
61 };
62
63 /**
64 The list of the user agent style sheets.
65 */
66 cx.fam.suika.y2005.CSS.Property.Computer.prototype.getUserAgentStyleSheetList =
67 function () {
68 return this.userAgentStyleSheetList;
69 };
70 cx.fam.suika.y2005.CSS.Property.Computer.prototype.setUserAgentStyleSheetList =
71 function (newValue) {
72 this.userAgentStyleSheetList = newValue;
73 };
74
75 /**
76 The list of the user style sheets.
77 */
78 cx.fam.suika.y2005.CSS.Property.Computer.prototype.getUserStyleSheetList =
79 function () {
80 return this.userStyleSheetList;
81 };
82 cx.fam.suika.y2005.CSS.Property.Computer.prototype.setUserStyleSheetList =
83 function (newValue) {
84 this.userStyleSheetList = newValue;
85 };
86
87 cx.fam.suika.y2005.CSS.Property.Computer.prototype._UpdateComputedValueForMedia =
88 function (authorStyleSheetList, rootElement, mediaManager) {
89 /* Gets enabled top-level style sheets */
90 var uass = this._GetEnabledCSSStyleSheets
91 (this.userAgentStyleSheetList, mediaManager);
92 var auss = this._GetEnabledCSSStyleSheets
93 (authorStyleSheetList, mediaManager);
94 var usss = this._GetEnabledCSSStyleSheets (this.userStyleSheetList, mediaManager);
95
96 var propList =
97 [
98 ["urn:x-suika-fam-cx:css:", "clear"],
99 ["urn:x-suika-fam-cx:css:", "direction"],
100 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.", "display-model"],
101 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.", "display-role"],
102 ["urn:x-suika-fam-cx:css:", "float"],
103 ["urn:x-suika-fam-cx:css:", "unicode-bidi"],
104 ["urn:x-suika-fam-cx:css:", "overflow-x"],
105 ["urn:x-suika-fam-cx:css:", "overflow-y"], /* after |overflow-x| */
106 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.", "scroller"],
107 ["urn:x-suika-fam-cx:css:", "visibility"],
108 ["urn:x-suika-fam-cx:css:", "z-index"],
109 ["urn:x-suika-fam-cx:css:", "list-style-type"],
110 ["urn:x-suika-fam-cx:css:", "list-style-image"],
111 ["urn:x-suika-fam-cx:css:", "list-style-position"],
112 ["urn:x-suika-fam-cx:css:", "page-break-after"],
113 ["urn:x-suika-fam-cx:css:", "page-break-before"],
114 ["urn:x-suika-fam-cx:css:", "page-break-inside"],
115 ["urn:x-suika-fam-cx:css:", "orphans"],
116 ["urn:x-suika-fam-cx:css:", "widows"],
117 ["urn:x-suika-fam-cx:css:", "background-image"],
118 ["urn:x-suika-fam-cx:css:", "background-repeat"],
119 ["urn:x-suika-fam-cx:css:", "background-attachment"],
120 ["urn:x-suika-fam-cx:css:", "font-style"],
121 ["urn:x-suika-fam-cx:css:", "font-variant"],
122 ["urn:x-suika-fam-cx:css:", "font-weight"],
123
124 /* <length> - after |font-size| */
125 ["urn:x-suika-fam-cx:css:", "height"],
126 ["urn:x-suika-fam-cx:css:", "width"],
127 ["urn:x-suika-fam-cx:css:", "min-height"],
128 ["urn:x-suika-fam-cx:css:", "min-width"],
129 ["urn:x-suika-fam-cx:css:", "max-height"],
130 ["urn:x-suika-fam-cx:css:", "max-width"],
131 ["urn:x-suika-fam-cx:css:", "line-height"],
132 ["urn:x-suika-fam-cx:css:", "vertical-align"],
133 ["urn:x-suika-fam-cx:css:", "top"],
134 ["urn:x-suika-fam-cx:css:", "bottom"],
135 ["urn:x-suika-fam-cx:css:", "left"],
136 ["urn:x-suika-fam-cx:css:", "right"],
137 ["urn:x-suika-fam-cx:css:", "padding-bottom"],
138 ["urn:x-suika-fam-cx:css:", "padding-left"],
139 ["urn:x-suika-fam-cx:css:", "padding-right"],
140 ["urn:x-suika-fam-cx:css:", "padding-top"],
141 ["urn:x-suika-fam-cx:css:", "margin-bottom"],
142 ["urn:x-suika-fam-cx:css:", "margin-left"],
143 ["urn:x-suika-fam-cx:css:", "margin-right"],
144 ["urn:x-suika-fam-cx:css:", "margin-top"],
145 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.", "background-position-x"],
146 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.", "background-position-y"],
147
148 ["urn:x-suika-fam-cx:css:", "position"],
149 /* after |top|, |bottom|, |right|, |left|, |direction| */
150 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.props.", "display"],
151 /* after |display|, |position|, and |float| */
152
153 ["urn:x-suika-fam-cx:css:", "color"],
154
155 ["urn:x-suika-fam-cx:css:", "border-bottom-color"],
156 ["urn:x-suika-fam-cx:css:", "border-left-color"],
157 ["urn:x-suika-fam-cx:css:", "border-right-color"],
158 ["urn:x-suika-fam-cx:css:", "border-top-color"],
159 ["urn:x-suika-fam-cx:css:", "background-color"],
160 /* after |color| */
161
162 ["urn:x-suika-fam-cx:css:", "border-bottom-style"],
163 ["urn:x-suika-fam-cx:css:", "border-left-style"],
164 ["urn:x-suika-fam-cx:css:", "border-right-style"],
165 ["urn:x-suika-fam-cx:css:", "border-top-style"],
166
167 ["urn:x-suika-fam-cx:css:", "border-bottom-width"],
168 ["urn:x-suika-fam-cx:css:", "border-left-width"],
169 ["urn:x-suika-fam-cx:css:", "border-right-width"],
170 ["urn:x-suika-fam-cx:css:", "border-top-width"],
171 /* after |font-size| and |border-*-style| */
172
173 ["urn:x-suika-fam-cx:css:", "opacity"]
174 ]; /* mediaManager._GetSupportedPropertyNameList */
175
176 /* Prepares a property set initially containing initial values */
177 var initialValueSet = new cx.fam.suika.y2005.CSS.Property.PropertySet ();
178 this._SetInitialValues (propList, initialValueSet);
179
180 /* For each elements (in depth first order), ... */
181 var els = [[rootElement]];
182 while (els.length > 0) {
183 var el = els.pop ();
184
185 /* Gets a set of rule sets applied to an element */
186 var uadecls = this._GetStyleDeclarationsForElement (uass, el[0], mediaManager);
187 var audecls = this._GetStyleDeclarationsForElement (auss, el[0], mediaManager);
188 /* TODO: inline and override style sheets support */
189 var usdecls = this._GetStyleDeclarationsForElement (usss, el[0], mediaManager);
190
191 /* TODO: pseudo element support */
192 uadecls = uadecls[""] != null ? uadecls[""][1] : [];
193 audecls = audecls[""] != null ? audecls[""][1] : [];
194 usdecls = usdecls[""] != null ? usdecls[""][1] : [];
195
196 /* Gets a set of computed values for an element */
197 var propSet = initialValueSet.clone ();
198 this._GetCascadedValueSet (uadecls, usdecls, audecls, [], mediaManager, propSet);
199 this._ComputeSpecifiedValue (propList, el[1], propSet, mediaManager);
200 this._ComputeComputedValue (propList, el[1], propSet, el[0]);
201 el[0]._SetComputedValueSetForMedia (propSet, mediaManager);
202
203 /* For children... */
204 var elcs = el[0].getChildNodes ();
205 var elcsl = elcs.getLength ();
206 for (var i = 0; i < elcsl; i++) {
207 var elc = elcs.item (i);
208 if (elc.getNodeType () == elc.ELEMENT_NODE) {
209 els.push ([elc, propSet]);
210 }
211 /* Note. Entity reference nodes are not supported. */
212 }
213 }
214 };
215
216 /**
217 Creates a style sheet list consists of all enabled CSS top-level style sheets
218 for a media from a style sheet list.
219
220 @param styleSheetList A source list of style sheets.
221 @param mediaManager A media manager to which media queries are issued.
222 @return A |StyleSheetList| object.
223 */
224 cx.fam.suika.y2005.CSS.Property.Computer.prototype._GetEnabledCSSStyleSheets =
225 function (styleSheetList, mediaManager) {
226 var r = new cx.fam.suika.y2005.CSS.StyleSheetList ();
227 var l = styleSheetList.getLength ();
228 for (var i = 0; i < l; i++) {
229 var s = styleSheetList.item (i);
230 if (!s.getDisabled () && s.getType () == "text/css") {
231 /* TODO: Media query support */
232 r.addStyleSheet (s);
233 }
234 }
235 return r;
236 };
237
238 /**
239 Returns a set of declaration blocks applied to an element or a pseudo element
240 generated for the element.
241
242 @param styleSheetList A style sheet list from which rule sets are find.
243 @param elementNode An element node, for which selectors are matched.
244 @param mediaMatch A media manager to which media queries are issued.
245 @return An associative array whose keys are hash key obtained by
246 |_GetPseudoElementHashKey| method on selectors. Each value
247 is an array with two items: pseudo element selector object
248 and another array. The array in turn contain arrays consist of declaration
249 block (|CSSStyleDeclaration|), its specificity, and
250 an integer that can be used to sort the array without losting
251 its items' original order.
252 */
253 cx.fam.suika.y2005.CSS.Property.Computer.prototype._GetStyleDeclarationsForElement =
254 function (styleSheetList, elementNode, mediaManager) {
255 var r = {};
256 var i = 0;
257
258 var styleSheetListLength = styleSheetList.getLength ();
259 for (var j = 0; j < styleSheetListLength; j++) {
260 var rules = styleSheetList.item (j).getCSSRules ();
261 var rulesLength = rules.getLength ();
262 for (var k = 0; k < rulesLength; k++) {
263 var rule = rules.item (k);
264 RT: switch (rule.getType ()) {
265 case rule.STYLE_RULE:
266 var selGroup = rule.getSelectorObject ();
267 var selGroupLength = selGroup.getLength ();
268 for (var l = 0; l < selGroupLength; l++) {
269 var sel = selGroup.item (l);
270 if (sel.matchElement (elementNode)) {
271 var selPE = sel.getPseudoElements ();
272 var key = selPE._GetPseudoElementHashKey ();
273 if (!r[key]) r[key] = [selPE, []];
274 r[key][1].push ([rule.getStyle (), sel.getSpecificity (), i++]);
275 }
276 } /* selector */
277 break RT;
278 case rule.MEDIA_RULE:
279 /* TODO: implement */
280 break RT;
281 case rule.IMPORT_RULE:
282 /* TODO: implement */
283 break RT;
284 } /* RT */
285 } /* styleSheet.cssRules */
286 } /* styleSheetList */
287 return r;
288 };
289
290 /**
291 Sets initial values of properties to a property set.
292
293 @param propList An array that contains arrays of namespace URI and
294 local name pairs, which indicates what properties should
295 be set their specified values. Note that the order
296 is *not* significant for this method.
297 @param propSet A property set.
298 */
299 cx.fam.suika.y2005.CSS.Property.Computer.prototype._SetInitialValues =
300 function (propList, propSet) {
301 for (var i in propList) {
302 var pn = propList[i];
303 if (pn[0] == "http://suika.fam.cx/~wakaba/archive/2005/11/css.props.") {
304 /* Dummy properties */
305 continue;
306 } else {
307 var propDef = cx.fam.suika.y2005.CSS.Property.getPropertyDefinition
308 (pn[0], pn[1]);
309 propSet.setPropertyValueNS
310 (pn[0], propDef.prefix, pn[1], propDef.initialValue);
311 }
312 }
313 };
314
315 /**
316 Returns a set of cascaded property values. This method
317 receives four inputs of |_GetStyleDeclarationsForElement|'s result format
318 and returns a |CSSPropertyDeclaration| object.
319
320 @param userAgentDeclarations A list of declarations from user agent style sheets.
321 @param userDeclarations A list of declarations from user style sheets.
322 @param authorDeclarations A list of declarations from author style sheets.
323 @param overrideDeclarations A list of declarations from override style sheets.
324 @param renderingEngine The layout engine for which the cascaded value
325 is computed. It is expected that the engine
326 provides information on whether a particular
327 value, e.g. |rgba()| is supported in the engine
328 or not. If a declared value is not supported,
329 then the value is ignored as per the forward
330 compatible rule of CSS.
331 @param propSet The property set to which properties are set.
332 @return |propSet|.
333 */
334 cx.fam.suika.y2005.CSS.Property.Computer.prototype._GetCascadedValueSet =
335 function (userAgentDeclarations, userDeclarations,
336 authorDeclarations, overrideDeclarations, renderingEngine, propSet) {
337 var props1 = [];
338 var props2 = [];
339 var props3 = [];
340 var cmps = function (a, b) {
341 var c = a[1].compareSpecificity (b[1]); /* Selector specificity order */
342 if (c == 0) {
343 return a[2] - b[2]; /* Occurence order */
344 } else {
345 return c;
346 }
347 };
348
349 var important = new cx.fam.suika.y2005.CSS.Value.IdentValue
350 ("urn:x-suika-fam-cx:css:", null, "important");
351
352 userAgentDeclarations = userAgentDeclarations.sort (cmps);
353 for (var i in userAgentDeclarations) {
354 var decls = userAgentDeclarations[i][0];
355 var propnames = decls.getSpecifiedPropertyNameList ();
356 for (var k in propnames) {
357 var propname = propnames[k];
358 var vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], null);
359 for (var j = 0; j < vals.length; j++) {
360 props1.push ([propname, vals[j]]);
361 }
362 vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], important);
363 for (var j = 0; j < vals.length; j++) {
364 props2.push ([propname, vals[j]]);
365 }
366 }
367 }
368 for (var i = 0; i < props2.length; i++) { props1.push (props2[i]) }
369
370 userDeclarations = userDeclarations.sort (cmps);
371 for (var i in userDeclarations) {
372 var decls = userDeclarations[i][0];
373 var propnames = decls.getSpecifiedPropertyNameList ();
374 for (var k in propnames) {
375 var propname = propnames[k];
376 var vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], null);
377 for (var j = 0; j < vals.length; j++) {
378 props1.push ([propname, vals[j]]);
379 }
380 vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], important);
381 for (var j = 0; j < vals.length; j++) {
382 props3.push ([propname, vals[j]]);
383 }
384 }
385 }
386
387 authorDeclarations = authorDeclarations.sort (cmps);
388 for (var i in authorDeclarations) {
389 var decls = authorDeclarations[i][0];
390 var propnames = decls.getSpecifiedPropertyNameList ();
391 for (var k in propnames) {
392 var propname = propnames[k];
393 var vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], null);
394 for (var j = 0; j < vals.length; j++) {
395 props1.push ([propname, vals[j]]);
396 }
397 vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], important);
398 for (var j = 0; j < vals.length; j++) {
399 props2.push ([propname, vals[j]]);
400 }
401 }
402 }
403
404 overrideDeclarations = overrideDeclarations.sort (cmps);
405 for (var i in overrideDeclarations) {
406 var decls = overrideDeclarations[i][0];
407 var propnames = decls.getSpecifiedPropertyNameList ();
408 for (var k in propnames) {
409 var propname = propnames[k];
410 var vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], null);
411 for (var j = 0; j < vals.length; j++) {
412 props1.push ([propname, vals[j]]);
413 }
414 vals = decls.getSpecifiedPropertyValuesNS (propname[0], propname[2], important);
415 for (var j = 0; j < vals.length; j++) {
416 props2.push ([propname, vals[j]]);
417 }
418 }
419 }
420
421 for (var i = 0; i < props2.length; i++) { props1.push (props2[i]) }
422 for (var i = 0; i < props3.length; i++) { props1.push (props3[i]) }
423 for (var i in props1) {
424 var prop = props1[i];
425 /* TODO: Query |mediaManager| to set value or not */
426 propSet.setPropertyValueNS (prop[0][0], prop[0][1], prop[0][2], prop[1]);
427 }
428 return propSet;
429 };
430
431 /**
432 Computes specified value of properties.
433
434 Note. In some properties their initial values are defined as
435 the computed value of another property. This method
436 fill properties by special values
437 (e.g. |-manakai_c-left-or-right-by-direction|)
438 if such initial values are their specified values. They
439 will be resolved in computed value phase.
440
441 @param propList An array that contains arrays of namespace URI and
442 local name pairs, which indicates what properties should
443 be set their specified values. Note that the order
444 is *not* significant for this method.
445 @param parentPropSet A property set containing computed values of the
446 parent element, if any, or |null|.
447 @param propSet A property set containing cascaded values.
448 @param mediaManager A media manager.
449 ISSUE: Is this parameter necessary?
450 */
451 cx.fam.suika.y2005.CSS.Property.Computer.prototype._ComputeSpecifiedValue =
452 function (propList, parentPropSet, propSet, mediaManager) {
453 for (var i in propList) {
454 var pn = propList[i];
455 if (pn[0] == "http://suika.fam.cx/~wakaba/archive/2005/11/css.props.") {
456 /* Dummy properties */
457 continue;
458 } else if (propSet.hasSpecifiedPropertyValueNS (pn[0], pn[1])) {
459 continue;
460 } else {
461 var propDef = cx.fam.suika.y2005.CSS.Property.getPropertyDefinition
462 (pn[0], pn[1]);
463 if (parentPropSet != null && propDef.inherit) {
464 propSet.setPropertyValueNS
465 (pn[0], propDef.prefix,
466 pn[1], parentPropSet.getSpecifiedPropertyValueNS (pn[0], pn[1]));
467 } else {
468 // Set by |_SetInitialValues|
469 //propSet.setPropertyValueNS
470 // (pn[0], propDef.prefix, pn[1], propDef.initialValue);
471 }
472 }
473 }
474 };
475
476
477 /**
478 Computes computed value of properties.
479
480 @param propList An array that contains arrays of namespace URI and
481 local name pairs, which indicates what properties should
482 be set their specified values. Note that the order
483 *is* significant for this method.
484 @param parentPropSet A property set containing computed values of the
485 parent element, if any, or |null|.
486 @param propSet A property set containing cascaded values.
487 @param elementNode The element for which the value is computed.
488 */
489 cx.fam.suika.y2005.CSS.Property.Computer.prototype._ComputeComputedValue =
490 function (propList, parentPropSet, propSet, elementNode) {
491 P: for (var i = 0; i < propList.length; i++) {
492 var pn = propList[i];
493 var propDef = cx.fam.suika.y2005.CSS.Property.getPropertyDefinition (pn[0], pn[1]);
494 var value = propSet.getSpecifiedPropertyValueNS (pn[0], pn[1]);
495 propDef.setComputedValue (pn[0], propDef.prefix, pn[1], parentPropSet, propSet,
496 value, elementNode);
497 } /* P */
498 };
499
500
501 /**
502 Class |CSSPropertySet| implements |CSSStyleDeclaration|
503
504 A |CSSPropertySet| object is a set of CSS property name and value pairs.
505 The class does not hold information on shorthand properties,
506 dupulicate or unknown (so that ignored) properties, and so on,
507 unlike |CSSStyleDeclaration| class in |CSS.Node| module.
508 */
509 cx.fam.suika.y2005.CSS.Property.PropertySet = function () {
510 this.v = {};
511 };
512
513 /**
514 Creates a clone.
515 [non-standard]
516
517 Note. Property values are not cloned but references to thems
518 are copied.
519
520 @return A cloned |CSS.Property.PropertySet|.
521 */
522 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.clone =
523 function () {
524 var r = new cx.fam.suika.y2005.CSS.Property.PropertySet ();
525 for (var i in this.v) {
526 r.v[i] = this.v[i];
527 }
528 return r;
529 };
530
531 /**
532 The textual representation of the style declarations, excluding the
533 surrounding curly braces.
534 [DOM Level 2 CSS]
535
536 Note that namespace fix up is not done.
537 */
538 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.getCSSText =
539 function () {
540 var r = "";
541 for (var ns in this.v) {
542 for (var ln in this.v[ns]) {
543 var pv = this.v[ns][ln];
544 if (pv == null) continue;
545 if (pv.prefix == null) {
546 r += " " + ln;
547 } else {
548 r += " -" + pv.prefix + "-" + ln;
549 }
550 r += ": " + pv.value.getCSSText () + ";\n";
551 }
552 }
553 return r;
554 };
555
556 /**
557 Gets a property name prefix.
558 [non-standard]
559
560 @param namespaceURI The namespace URI of the property.
561 @param localName The local name of the property.
562 @return The namespace prefix of the property, if any, or |null|.
563 */
564 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype._GetPropertyPrefix =
565 function (namespaceURI, localName) {
566 if (this.v[namespaceURI] && this.v[namespaceURI][localName]) {
567 return this.v[namespaceURI][localName].prefix;
568 } else {
569 return null;
570 }
571 };
572
573 /**
574 Gets a property value.
575 [non-standard]
576
577 @param namespaceURI The namespace URI of the property.
578 @param localName The local name of the property.
579 @return The |CSSValue| of the property, if any, or |null|.
580 */
581 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.getSpecifiedPropertyValueNS =
582 function (namespaceURI, localName) {
583 if (this.v[namespaceURI] && this.v[namespaceURI][localName]) {
584 return this.v[namespaceURI][localName].value;
585 } else {
586 return null;
587 }
588 };
589
590 /**
591 Returns whether a property has value or not.
592 [non-standard]
593
594 @param namespaceURI The namespace URI of the property.
595 @param localName The local name of the property.
596 @return |true| or |false|.
597 */
598 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.hasSpecifiedPropertyValueNS =
599 function (namespaceURI, localName) {
600 if (this.v[namespaceURI] && this.v[namespaceURI][localName]) {
601 return true;
602 } else {
603 return false;
604 }
605 };
606
607 /**
608 Sets a property value.
609 [non-standard]
610
611 @param namespaceURI The namespace URI of the property.
612 @param prefix The namespace prefix of the property.
613 @param localName The local name of the property.
614 @param value The |CSSValue| of the property.
615 */
616 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.setPropertyValueNS =
617 function (namespaceURI, prefix, localName, value) {
618 if (!this.v[namespaceURI]) this.v[namespaceURI] = [];
619 this.v[namespaceURI][localName] = {prefix: prefix, value: value};
620 };
621
622 cx.fam.suika.y2005.CSS.Property.PropertySet.prototype.toString = function () {
623 return "[CSSStyleDeclaration]";
624 };
625
626
627 /**
628 Class |CSS.Property.MultiValueSet|
629 Implements:
630 |CSSStyleDeclaration| [DOM Level 2 CSS] (partially)
631 |CSSPropertySet|
632
633 The |CSS.Property.MultiValueSet| is yet another implementation (with
634 some extention) of |CSSPropertySet|, which allows a property
635 to have more than one values.
636 In the declaration block of the CSS style sheet source entity,
637 there might be more than one declarations for a property. Since
638 the CSS forward compatible parsing rules is so defined that unknown
639 property values are ignored and later declaration wins, it is used
640 to specify values for different levels of implementations. Although
641 the current implementation of |CSS.Property.Definition| are intended to
642 discard values in unknown syntax and values in known syntax whose
643 semantics is not known, the implementation may still encount to the
644 value whose semantics is known but cannot be supported because of the
645 limitations of the rendering engine.
646
647 Note. The order of values for different properties are not
648 preserved while the order in the same property is preserved.
649
650 Note. This class ensures a value is valid for the property
651 before the addition of the value.
652 */
653 cx.fam.suika.y2005.CSS.Property.MultiValueSet = function () {
654 this.v = {};
655 this.important = {};
656 };
657
658 /**
659 Adds a property value.
660 [non-standard]
661
662 @param namespaceURI The namespace URI of the property.
663 @param prefix The namespace prefix of the property.
664 @param localName The local name of the property.
665 @param value The |CSSValue| of the property. If the value is
666 invalid for the property, the method invocation has no effect.
667 @param priority The priority object, if any, or |null|.
668 */
669 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.addPropertyValueNS =
670 function (namespaceURI, prefix, localName, value, priority) {
671 if (!cx.fam.suika.y2005.CSS.Property.getPropertyDefinition (namespaceURI, localName)
672 .isValidValue (namespaceURI, localName, value)) {
673 return;
674 }
675 var key = namespaceURI + localName;
676 if (this.v[key]) {
677 switch (priority ? priority.getExpandedURI ()
678 : "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal") {
679 case "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal":
680 this.v[key].push (value);
681 break;
682 case "urn:x-suika-fam-cx:css:important":
683 this.important[key].push (value);
684 break;
685 }
686 } else {
687 switch (priority ? priority.getExpandedURI ()
688 : "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal") {
689 case "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal":
690 this.v[key] = [value];
691 this.v[key].namespaceURI = namespaceURI;
692 this.v[key].prefix = prefix;
693 this.v[key].localName = localName;
694 this.important[key] = [];
695 this.important[key].namespaceURI = namespaceURI;
696 this.important[key].prefix = prefix;
697 this.important[key].localName = localName;
698 break;
699 case "urn:x-suika-fam-cx:css:important":
700 this.v[key] = [];
701 this.v[key].namespaceURI = namespaceURI;
702 this.v[key].prefix = prefix;
703 this.v[key].localName = localName;
704 this.important[key] = [value];
705 this.important[key].namespaceURI = namespaceURI;
706 this.important[key].prefix = prefix;
707 this.important[key].localName = localName;
708 break;
709 }
710 }
711 };
712
713 /**
714 The textual representation of the style declarations, excluding the
715 surrounding curly braces.
716 [DOM Level 2 CSS]
717
718 Note that namespace fix up is not done.
719 */
720 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.getCSSText =
721 function () {
722 var r = "";
723 P: for (var xuri in this.v) {
724 var values = this.v[xuri];
725 if (!values) continue P;
726 var name = " ";
727 if (values.prefix == null) {
728 name += values.localName + ": ";
729 } else {
730 name += "-" + values.prefix + "-" + values.localName + ": ";
731 }
732 for (var i = 0; i < values.length; i++) {
733 r += name + values[i].getCSSText () + ";\n";
734 }
735 var values = this.important[xuri];
736 for (var i = 0; i < values.length; i++) {
737 r += name + values[i].getCSSText () + " !important;\n";
738 }
739 }
740 return r;
741 };
742
743 /**
744 Gets a property name prefix.
745 [non-standard]
746
747 @param namespaceURI The namespace URI of the property.
748 @param localName The local name of the property.
749 @return The namespace prefix of the property, if any, or |null|.
750 */
751 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype._GetPropertyPrefix =
752 function (namespaceURI, localName) {
753 if (this.v[namespaceURI + localName]) {
754 return this.v[namespaceURI + localName].prefix;
755 } else {
756 return null;
757 }
758 };
759
760 /**
761 Returns a snapshot list of namespaceURI, namespace prefix, and local name
762 of properties its value is specified in the collection.
763 [non-standard]
764
765 @return An |Array| of |Array|s.
766 */
767 cx.fam.suika.y2005.CSS.Property.MultiValueSet
768 .prototype.getSpecifiedPropertyNameList = function () {
769 var r = [];
770 for (var xuri in this.v) {
771 if (this.v[xuri].length > 0 || this.important[xuri].length > 0) {
772 r.push ([this.v[xuri].namespaceURI, this.v[xuri].prefix,
773 this.v[xuri].localName]);
774 }
775 }
776 return r;
777 };
778
779 /**
780 Gets a property value.
781 [non-standard]
782
783 @param expandedURI The expanded URI of the property.
784 @return The |CSSValue| of the property, if any, or |null|.
785 */
786 cx.fam.suika.y2005.CSS.Property.MultiValueSet
787 .prototype.getSpecifiedPropertyValueByExpandedURI =
788 function (expandedURI) {
789 if (this.v[expandedURI]) {
790 if (this.important[expandedURI].length > 0) {
791 return this.important[expandedURI][this.important[expandedURI].length - 1];
792 } else {
793 return this.v[expandedURI][this.v[expandedURI].length - 1];
794 }
795 } else {
796 return null;
797 }
798 };
799
800 /**
801 Gets a property value.
802 [non-standard]
803
804 @param namespaceURI The namespace URI of the property.
805 @param localName The local name of the property.
806 @return The |CSSValue| of the property, if any, or |null|.
807 */
808 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.getSpecifiedPropertyValueNS =
809 function (namespaceURI, localName) {
810 var key = namespaceURI + localName;
811 if (this.v[key]) {
812 if (this.important[key].length > 0) {
813 return this.important[key][this.important[key].length - 1];
814 } else {
815 return this.v[key][this.v[key].length - 1];
816 }
817 } else {
818 return null;
819 }
820 };
821
822 /**
823 Gets an array of the property values.
824 [non-standard]
825
826 @param namespaceURI The namespace URI of the property.
827 @param localName The local name of the property.
828 @param priority The priority value, if any, or |null|.
829 @return The |Array| of the property values.
830 */
831 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.getSpecifiedPropertyValuesNS =
832 function (namespaceURI, localName, priority) {
833 var key = namespaceURI + localName;
834 if (this.v[key]) {
835 switch (priority ? priority.getExpandedURI ()
836 : "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal") {
837 case "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal":
838 return this.v[key];
839 default:
840 return this.important[key];
841 }
842 } else {
843 return [];
844 }
845 };
846
847 /**
848 Returns whether a property has value or not.
849 [non-standard]
850
851 @param namespaceURI The namespace URI of the property.
852 @param localName The local name of the property.
853 @return |true| or |false|.
854 */
855 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.hasSpecifiedPropertyValueNS =
856 function (namespaceURI, localName) {
857 var key = namespaceURI + localName;
858 if (this.v[key]) {
859 return (this.v[key].length > 0 || this.important[key].length > 0);
860 } else {
861 return false;
862 }
863 };
864
865 /**
866 Sets a property value. It clears the set of property values before addition.
867 [non-standard]
868
869 @param namespaceURI The namespace URI of the property.
870 @param prefix The namespace prefix of the property.
871 @param localName The local name of the property.
872 @param value The |CSSValue| of the property.
873 @param priority The priority object, if any, or |null|.
874 */
875 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.setPropertyValueNS =
876 function (namespaceURI, prefix, localName, value, priority) {
877 if (!cx.fam.suika.y2005.CSS.Property.getPropertyDefinition (namespaceURI, localName)
878 .isValidValue (namespaceURI, localName, value)) {
879 return;
880 }
881 var key = namespaceURI + localName;
882 switch (priority ? priority.getExpandedURI ()
883 : "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal") {
884 case "http://suika.fam.cx/~wakaba/archive/2005/cssc.normal":
885 this.v[key] = [value];
886 this.v[key].namespaceURI = namespaceURI;
887 this.v[key].prefix = prefix;
888 this.v[key].localName = localName;
889 this.important[key] = [];
890 this.important[key].namespaceURI = namespaceURI;
891 this.important[key].prefix = prefix;
892 this.important[key].localName = localName;
893 break;
894 case "urn:x-suika-fam-cx:css:important":
895 this.v[key] = [];
896 this.v[key].namespaceURI = namespaceURI;
897 this.v[key].prefix = prefix;
898 this.v[key].localName = localName;
899 this.important[key] = [value];
900 this.important[key].namespaceURI = namespaceURI;
901 this.important[key].prefix = prefix;
902 this.important[key].localName = localName;
903 break;
904 }
905 };
906
907 cx.fam.suika.y2005.CSS.Property.MultiValueSet.prototype.toString = function () {
908 return "[CSSStyleDeclaration]";
909 };
910
911
912
913 /**
914 Returns the definition of a property, if any, or an empty
915 definition for unsupported property.
916 */
917 cx.fam.suika.y2005.CSS.Property.getPropertyDefinition =
918 function (namespaceURI, localName) {
919 if (cx.fam.suika.y2005.CSS.Property.Definition[namespaceURI + localName]) {
920 return cx.fam.suika.y2005.CSS.Property.Definition[namespaceURI + localName];
921 } else {
922 return new cx.fam.suika.y2005.CSS.Property.Definition ({isSupported: true});
923 }
924 };
925
926 /**
927 Class |CSS.Property.Definition|
928
929 A |CSS.Property.Definition| object represents the definition of a property.
930 */
931 cx.fam.suika.y2005.CSS.Property.Definition = function (template) {
932 for (var i in template) {
933 switch (i) {
934 default:
935 this[i] = template[i];
936 }
937 }
938 if (typeof (this.validKeyword) == "undefined") this.validKeyword = {};
939 if (typeof (this.validKeyword1) == "undefined") this.validKeyword1 = {};
940 if (typeof (this.validFunction) == "undefined") this.validFunction = {};
941 if (typeof (this.validType) == "undefined") this.validType = {};
942 if (typeof (this.validUnit) == "undefined") this.validUnit = {};
943 this.validKeyword1["urn:x-suika-fam-cx:css:inherit"] = true;
944 this.validKeyword1["urn:x-suika-fam-cx:css:-moz-initial"] = true;
945 this.validKeyword1["http://suika.fam.cx/~wakaba/archive/2005/cssc.initial"] = true;
946 };
947
948
949 /**
950 The "well-known" namespace prefix of the property, or |null|
951 for properties in the standard namespace.
952 */
953 cx.fam.suika.y2005.CSS.Property.Definition.prototype.prefix = null;
954
955 /**
956 Whether the property is supported or not.
957 */
958 cx.fam.suika.y2005.CSS.Property.Definition.prototype.isSupported = true;
959
960 /**
961 Whether the property is a shorthand property in the implementation or not.
962 */
963 cx.fam.suika.y2005.CSS.Property.Definition.prototype.isShorthand = false;
964
965 /**
966 Whether the property does inherit or not.
967 */
968 cx.fam.suika.y2005.CSS.Property.Definition.prototype.inherit = false;
969
970 /**
971 The initial value.
972 */
973 cx.fam.suika.y2005.CSS.Property.Definition.prototype.initialValue
974 = new cx.fam.suika.y2005.CSS.Value.IdentValue
975 ("http://suika.fam.cx/~wakaba/archive/2005/cssc.",
976 "manakai_c", "user-agent-dependent");
977
978 /**
979 Parses the property value without priority declaration, from
980 the token sequence.
981
982 Note. If the implementation supports the value specified in the
983 property declaration, then the method must return a value
984 that holds information on the value and the |parser|'s
985 head must reference the next token, whose value might be |!|
986 introducing the priority declaration for the property,
987 to the last token of the property value, if any. The
988 value returned from the method would be passed to
989 |setDeclaredValue| method unless the parser is encounted
990 to a parse error before the |;|, |}|, or end of the entity that
991 terminates the property declaration. The method may or
992 may not discard any value that is syntatically legal but
993 inappropriate or unsupported for the property. Such values are
994 discarded at the time of added to property sets in any way.
995 If the implementation does not support the value specified
996 in the property declaration, including cases of parse errors,
997 then the method must return a |null|. If the method
998 returns |null|, the parser would skip until the end of the
999 property declaration.
1000
1001 @param parser The |CSS.SimpleParser| object that is reached at a
1002 property value.
1003 @param namespaceURI The namespace URI of the property.
1004 @param prefix The namespace prefix of the property, if any, or |null|.
1005 @param localName The local name of the property.
1006 @return A non-|null| value, or |null| indicating parse error.
1007 */
1008 cx.fam.suika.y2005.CSS.Property.Definition.prototype.parseValueFromTokens =
1009 function (parser, namespaceURI, prefix, localName) {
1010 return null;
1011 };
1012
1013 /**
1014 Sets a value or a set of values to a set of properties. For shorthand
1015 properties, values must be set to longhand properties.
1016
1017 @param namespaceURI The namespace URI of the property.
1018 @param prefix The namespace prefix of the property, if any, or |null|.
1019 @param localName The local name of the property.
1020 @param propSet The property set to which the value(s) should be set.
1021 @param valueSet The object returned by |parseValueFromTokens| method.
1022 */
1023 cx.fam.suika.y2005.CSS.Property.Definition.prototype.setDeclaredValue =
1024 function (namespaceURI, prefix, localName, propSet, valueSource, priority) {
1025 /*
1026 This template sets the |valueSource| as a property value.
1027 Unless this method is overridden, the |parseVaueFromTokens| method
1028 must return a |CSSValue| object valid for the property.
1029 */
1030 propSet.addPropertyValueNS
1031 (namespaceURI, prefix, localName,
1032 this.convertToDeclaredValue (namespaceURI, localName, valueSource), priority);
1033 /*
1034 Note. Using public methods in |CSS.Property.MultiValueSet|
1035 ensures that unsupported values are not set and that
1036 values are normalized in the |propSet|.
1037 */
1038 };
1039
1040 /**
1041 Converts a value returned by |parseValueFromTokens| into a |CSSValue|.
1042
1043 Note. Shorthand properties does not need to implement this method.
1044
1045 @param namespaceURI The namespace URI of the property.
1046 @param localName The local name of the property.
1047 @param valueSource The value returned by |parseValueFromTokens|.
1048 @return A |CSSValue|.
1049 */
1050 cx.fam.suika.y2005.CSS.Property.Definition.prototype.convertToDeclaredValue =
1051 function (namespaceURI, localName, valueSource) {
1052 return valueSource;
1053 };
1054
1055 /**
1056 Returns whether a value is valid for the property or not.
1057 For shorthand properties, it must return a |false|.
1058
1059 @param namespaceURI The namespace URI of the property.
1060 @param localName The local name of the property.
1061 @param value The |CSSValue| to test.
1062 @param partial Is |value| is part of a property value or not.
1063 If |true|, keyword in |propDef.validKeyword1|
1064 should be reported as invalid.
1065 @return |true| or |false|.
1066 */
1067 cx.fam.suika.y2005.CSS.Property.Definition.prototype.isValidValue =
1068 function (namespaceURI, localName, value) {
1069 return false;
1070 };
1071
1072 /**
1073 Sets the computed value of a specified value of the property.
1074
1075 @param namespaceURI The namespace URI of the property.
1076 @param prefix The namespace prefix of the property, if any, or |null|.
1077 @param localName The local name of the property.
1078 @param parentPropSet The parent property set from which the computed value
1079 is taken in the case of |inherit| value, if any, or |null|.
1080 @param propSet The property set for computed values. If no
1081 new value for the property is set to this set,
1082 then the specified value is the computed value.
1083 @param elementNode The |Element| for which the value is computed. If the
1084 specified value contains |attr()| function, its value
1085 is taken from this node.
1086 @param value The specified value. The |value| comes from
1087 the source where it is ensured that the |value|
1088 is valid as a specified value of the property.
1089 */
1090 cx.fam.suika.y2005.CSS.Property.Definition.prototype.setComputedValue =
1091 function (namespaceURI, prefix, localName, parentPropSet, propSet, value,
1092 elementNode) {
1093 switch (value.getTypeURI ()) {
1094 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1095 switch (value.getExpandedURI ()) {
1096 case "urn:x-suika-fam-cx:css:inherit":
1097 /* CSS2 |inherit| value */
1098 if (parentPropSet != null) {
1099 propSet.setPropertyValueNS (namespaceURI, prefix, localName,
1100 parentPropSet.getSpecifiedPropertyValueNS
1101 (namespaceURI, localName));
1102 } else {
1103 propSet.setPropertyValueNS (namespaceURI, prefix, localName,
1104 this.initialValue);
1105 }
1106 return /* OK */;
1107 case "http://suika.fam.cx/~wakaba/archive/2005/cssc.initial":
1108 case "urn:x-suika-fam-cx:css:-moz-initial":
1109 /* CSS3 |initial| value */
1110 propSet.setPropertyValueNS (namespaceURI, prefix, localName, this.initialValue);
1111 return /* OK */;
1112 }
1113 break;
1114 }
1115 /* unchange */
1116 };
1117
1118
1119 /**
1120 Class |CSS.Property.Definition_Keyword|
1121
1122 The definition for a property that only allows a set of one keywords.
1123 */
1124 cx.fam.suika.y2005.CSS.Property.Definition_Keyword = function (template) {
1125 cx.fam.suika.y2005.CSS.Property.Definition_Keyword._superclass.apply
1126 (this, [template]);
1127 };
1128 cx.fam.suika.y2005.CSS.Property.Definition_Keyword.inherits
1129 (cx.fam.suika.y2005.CSS.Property.Definition);
1130
1131 cx.fam.suika.y2005.CSS.Property.Definition_Keyword.prototype.parseValueFromTokens =
1132 function (parser, namespaceURI, prefix, localName) {
1133 var value = parser._GetNextValue ();
1134 if (value == null) return null;
1135 switch (value.getTypeURI ()) {
1136 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1137 return value;
1138 }
1139 return null;
1140 };
1141
1142 cx.fam.suika.y2005.CSS.Property.Definition_Keyword.prototype.isValidValue =
1143 function (namespaceURI, localName, value, partial) {
1144 switch (value.getTypeURI ()) {
1145 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1146 return (this.validKeyword[value.getExpandedURI ()] ||
1147 (!partial && this.validKeyword1[value.getExpandedURI ()]));
1148 break;
1149 }
1150 return false;
1151 };
1152
1153
1154 /**
1155 Class |CSS.Property.Definition_Length|
1156
1157 The definition for a property that only allows one <length>
1158 or other dimension.
1159 */
1160 cx.fam.suika.y2005.CSS.Property.Definition_Length = function (template) {
1161 cx.fam.suika.y2005.CSS.Property.Definition_Length._superclass.apply
1162 (this, [template]);
1163 if (this.validType["tag:manakai@suika.fam.cx,2005-11:length"]) {
1164 this.validUnit["urn:x-suika-fam-cx:css:em"] = true;
1165 this.validUnit["urn:x-suika-fam-cx:css:px"] = true;
1166 this.validUnit["urn:x-suika-fam-cx:css:vw"] = true;
1167 this.validUnit["urn:x-suika-fam-cx:css:vh"] = true;
1168 this.validUnit["urn:x-suika-fam-cx:css:vm"] = true;
1169 this.validUnit["urn:x-suika-fam-cx:css:in"] = true;
1170 this.validUnit["urn:x-suika-fam-cx:css:cm"] = true;
1171 this.validUnit["urn:x-suika-fam-cx:css:mm"] = true;
1172 this.validUnit["urn:x-suika-fam-cx:css:pt"] = true;
1173 this.validUnit["urn:x-suika-fam-cx:css:pc"] = true;
1174 this.validUnit["urn:x-suika-fam-cx:css:gd"] = true;
1175 this.validUnit["urn:x-suika-fam-cx:css:rem"] = true;
1176 this.validUnit["urn:x-suika-fam-cx:css:ex"] = true;
1177 }
1178 };
1179 cx.fam.suika.y2005.CSS.Property.Definition_Length.inherits
1180 (cx.fam.suika.y2005.CSS.Property.Definition);
1181
1182 /**
1183 Whether negative values are allowed or not.
1184 */
1185 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.negativeNotAllowed = false;
1186
1187 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.parseValueFromTokens =
1188 function (parser, namespaceURI, prefix, localName) {
1189 var value = parser._GetNextValue ();
1190 if (value == null) return null;
1191 switch (value.getTypeURI ()) {
1192 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1193 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1194 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1195 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1196 return value;
1197 }
1198 return null;
1199 };
1200
1201 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.isValidValue =
1202 function (namespaceURI, localName, value, partial) {
1203 switch (value.getTypeURI ()) {
1204 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1205 if (this.negativeNotAllowed) {
1206 if (value.getValue () < 0) return false;
1207 }
1208 return this.validUnit[value.getUnitExpandedURI ()];
1209 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1210 if (this.negativeNotAllowed) {
1211 if (value.getValue () < 0) return false;
1212 }
1213 return this.validType["tag:manakai@suika.fam.cx,2005-11:percentage"];
1214 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1215 if (this.negativeNotAllowed) {
1216 if (value.getValue () < 0) return false;
1217 }
1218 if (this.validType["tag:manakai@suika.fam.cx,2005-11:number"]) return true;
1219 if (this.validType["tag:manakai@suika.fam.cx,2005-11:integer"] &&
1220 value.getValue () % 1 == 0) return true;
1221 if (this.validUnit["urn:x-suika-fam-cx:css:px"] && value.getValue () == 0) {
1222 return true;
1223 }
1224 return false;
1225 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1226 return (this.validKeyword[value.getExpandedURI ()] ||
1227 (!partial && this.validKeyword1[value.getExpandedURI ()]));
1228 }
1229 return false;
1230 };
1231
1232 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue =
1233 function (namespaceURI, prefix, localName, parentPropSet, propSet, value,
1234 elementNode) {
1235 switch (value.getTypeURI ()) {
1236 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1237 /* TODO: resolve relative length */
1238 break;
1239 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1240 var xuri = value.getExpandedURI ();
1241 if (this.validKeyword[xuri].computedValue) {
1242 propSet.setPropertyValueNS (namespaceURI, prefix, localName,
1243 this.validKeyword[xuri].computedValue);
1244 } else {
1245 cx.fam.suika.y2005.CSS.Property.Definition_Length._super.setComputedValue.apply
1246 (this, arguments);
1247 }
1248 return;
1249 }
1250 /* unchange */
1251 };
1252
1253
1254 /**
1255 Class |CSS.Property.Definition_Length4|
1256
1257 The definition for a property that only allows one, two, three, or four <length>
1258 or other dimensions.
1259 */
1260 cx.fam.suika.y2005.CSS.Property.Definition_Length4 = function (template) {
1261 cx.fam.suika.y2005.CSS.Property.Definition_Length4._superclass.apply
1262 (this, [template]);
1263 };
1264 cx.fam.suika.y2005.CSS.Property.Definition_Length4.inherits
1265 (cx.fam.suika.y2005.CSS.Property.Definition_Length);
1266
1267 cx.fam.suika.y2005.CSS.Property.Definition_Length4.prototype.parseValueFromTokens =
1268 function (parser, namespaceURI, prefix, localName) {
1269 var value = parser._GetNextValue ();
1270 if (value == null) return null;
1271 switch (value.getTypeURI ()) {
1272 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1273 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1274 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1275 var values = [value, value, value, value];
1276 break;
1277 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1278 if (this.validKeyword1[value.getExpandedURI ()]) {
1279 var values = [value];
1280 } else {
1281 var values = [value, value, value, value];
1282 }
1283 break;
1284 default:
1285 return null;
1286 }
1287
1288 value = parser._GetNextValue ();
1289 if (value == null) return values;
1290 if (values.length == 1) return null;
1291 switch (value.getTypeURI ()) {
1292 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1293 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1294 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1295 values[1] = value;
1296 values[3] = value;
1297 break;
1298 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1299 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1300 values[1] = value;
1301 values[3] = value;
1302 break;
1303 default:
1304 return null;
1305 }
1306
1307 value = parser._GetNextValue ();
1308 if (value == null) return values;
1309 switch (value.getTypeURI ()) {
1310 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1311 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1312 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1313 values[2] = value;
1314 break;
1315 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1316 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1317 values[2] = value;
1318 break;
1319 default:
1320 return null;
1321 }
1322
1323 value = parser._GetNextValue ();
1324 if (value == null) return values;
1325 switch (value.getTypeURI ()) {
1326 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1327 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1328 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1329 values[3] = value;
1330 return values;
1331 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1332 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1333 values[3] = value;
1334 return values;
1335 default:
1336 return null;
1337 }
1338 };
1339
1340 cx.fam.suika.y2005.CSS.Property.Definition_Length4.prototype.isValidValue =
1341 function (namespaceURI, localName, value) {
1342 return false;
1343 };
1344
1345 /* |setDeclaredValue| method must be defined for each property. */
1346
1347
1348 /**
1349 Class |CSS.Property.Definition_Color|
1350
1351 The definition for a property that only allows one <color>.
1352 */
1353 cx.fam.suika.y2005.CSS.Property.Definition_Color = function (template) {
1354 cx.fam.suika.y2005.CSS.Property.Definition_Color._superclass.apply
1355 (this, [template]);
1356 this.validFunction["urn:x-suika-fam-cx:css:rgb"] = true;
1357 this.validFunction["urn:x-suika-fam-cx:css:rgba"] = true;
1358 this.validFunction["urn:x-suika-fam-cx:css:hsl"] = true;
1359 this.validFunction["urn:x-suika-fam-cx:css:hsla"] = true;
1360 var kwd = [
1361 /* X11 color keywords */
1362 "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
1363 "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
1364 "burlywood", "cadetblue", "chartreuse", "chocolate", "coral",
1365 "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue",
1366 "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey",
1367 "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid",
1368 "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray",
1369 "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue",
1370 "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite",
1371 "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod",
1372 "gray", "green", "greenyellow", "grey", "honeydew", "hotpink",
1373 "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush",
1374 "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan",
1375 "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey",
1376 "lightpink", "lightsalmon", "lightseagreen", "lightskyblue",
1377 "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow",
1378 "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine",
1379 "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
1380 "mediumslateblue", "mediumspringgreen", "mediumturquoise",
1381 "mediumvioletred", "midnightblue", "mintcream", "mistyrose",
1382 "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab",
1383 "orange", "orangered", "orchid", "palegoldenrod", "palegreen",
1384 "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru",
1385 "pink", "plum", "powderblue", "purple", "red", "rosybrown",
1386 "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen",
1387 "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray",
1388 "slategrey", "snow", "springgreen", "steelblue", "tan", "teal",
1389 "thistle", "tomato", "turquoise", "violet", "wheat", "white",
1390 "whitesmoke", "yellow", "yellowgreen",
1391
1392 /* CSS2 system colors */
1393 "activeborder", "activecaption", "appworkspace", "background",
1394 "buttonface", "buttonhighlight", "buttonshadow", "buttontext",
1395 "captiontext", "graytext", "highlight", "highlighttext",
1396 "inactiveborder", "inactivecaption", "inactivecaptiontext",
1397 "infobackground", "infotext", "menu", "menutext", "scrollbar",
1398 "threeddarkshadow", "threedface", "threedhighlight",
1399 "threedlightshadow", "threedshadow", "window", "windowframe",
1400 "windowtext",
1401
1402 "transparent",
1403 "currentcolor",
1404 "flavor"
1405 ];
1406 for (var i in kwd) {
1407 this.validKeyword["urn:x-suika-fam-cx:css:" + kwd[i]] = true;
1408 }
1409 this.validKeyword
1410 ["http://suika.fam.cx/~wakaba/archive/2005/cssc.user-agent-dependent"] = true;
1411 };
1412 cx.fam.suika.y2005.CSS.Property.Definition_Color.inherits
1413 (cx.fam.suika.y2005.CSS.Property.Definition);
1414
1415 cx.fam.suika.y2005.CSS.Property.Definition_Color.prototype.parseValueFromTokens =
1416 function (parser, namespaceURI, prefix, localName) {
1417 var value = parser._GetNextValue ();
1418 if (value == null) return null;
1419 switch (value.getTypeURI ()) {
1420 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1421 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1422 return value;
1423 }
1424 return null;
1425 };
1426
1427 cx.fam.suika.y2005.CSS.Property.Definition_Color.prototype.isValidValue =
1428 function (namespaceURI, localName, value, partial) {
1429 switch (value.getTypeURI ()) {
1430 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1431 return this.validFunction[value.getFunctionExpandedURI ()];
1432 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1433 return (this.validKeyword[value.getExpandedURI ()] ||
1434 (!partial && this.validKeyword1[value.getExpandedURI ()]));
1435 }
1436 return false;
1437 };
1438
1439 cx.fam.suika.y2005.CSS.Property.Definition_Color.prototype.setComputedValue =
1440 function (namespaceURI, prefix, localName, parentPropSet, propSet, value,
1441 elementNode) {
1442 switch (value.getTypeURI ()) {
1443 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1444 switch (value.getFunctionExpandedURI ()) {
1445 /*
1446 Although CSS3 color CR defines computed value for |hsl| and |hsla|
1447 as same as specified value, this implementation converts them
1448 into |rgb| or |rgba| for convinience.
1449 */
1450 case "urn:x-suika-fam-cx:css:hsl":
1451 propSet.setPropertyValueNS (namespaceURI, prefix, localName,
1452 value.getRGBAValue ());
1453 break;
1454 case "urn:x-suika-fam-cx:css:hsla":
1455 propSet.setPropertyValueNS (namespaceURI, prefix, localName,
1456 value.getRGBAValue ());
1457 break;
1458 }
1459 return;
1460 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1461 var xuri = value.getExpandedURI ();
1462 var rgb = {
1463 /* so-called X11 colors including HTML4 colors [SVG, CSS3 Color CR] */
1464 "urn:x-suika-fam-cx:css:aliceblue": [0xf0, 0xf8, 0xff],
1465 "urn:x-suika-fam-cx:css:antiquewhite": [0xfa, 0xeb, 0xd7],
1466 "urn:x-suika-fam-cx:css:aqua": [0x00, 0xff, 0xff],
1467 "urn:x-suika-fam-cx:css:aquamarine": [0x7f, 0xff, 0xd4],
1468 "urn:x-suika-fam-cx:css:azure": [0xf0, 0xff, 0xff],
1469 "urn:x-suika-fam-cx:css:beige": [0xf5, 0xf5, 0xdc],
1470 "urn:x-suika-fam-cx:css:bisque": [0xff, 0xe4, 0xc4],
1471 "urn:x-suika-fam-cx:css:black": [0x00, 0x00, 0x00],
1472 "urn:x-suika-fam-cx:css:blanchedalmond": [0xff, 0xeb, 0xcd],
1473 "urn:x-suika-fam-cx:css:blue": [0x00, 0x00, 0xff],
1474 "urn:x-suika-fam-cx:css:blueviolet": [0x8a, 0x2b, 0xe2],
1475 "urn:x-suika-fam-cx:css:brown": [0xa5, 0x2a, 0x2a],
1476 "urn:x-suika-fam-cx:css:burlywood": [0xde, 0xb8, 0x87],
1477 "urn:x-suika-fam-cx:css:cadetblue": [0x5f, 0x9e, 0xa0],
1478 "urn:x-suika-fam-cx:css:chartreuse": [0x7f, 0xff, 0x00],
1479 "urn:x-suika-fam-cx:css:chocolate": [0xd2, 0x69, 0x1e],
1480 "urn:x-suika-fam-cx:css:coral": [0xff, 0x7f, 0x50],
1481 "urn:x-suika-fam-cx:css:cornflowerblue": [0x64, 0x95, 0xed],
1482 "urn:x-suika-fam-cx:css:cornsilk": [0xff, 0xf8, 0xdc],
1483 "urn:x-suika-fam-cx:css:crimson": [0xdc, 0x14, 0x3c],
1484 "urn:x-suika-fam-cx:css:cyan": [0x00, 0xff, 0xff],
1485 "urn:x-suika-fam-cx:css:darkblue": [0x00, 0x00, 0x8b],
1486 "urn:x-suika-fam-cx:css:darkcyan": [0x00, 0x8b, 0x8b],
1487 "urn:x-suika-fam-cx:css:darkgoldenrod": [0xb8, 0x86, 0x0b],
1488 "urn:x-suika-fam-cx:css:darkgray": [0xa9, 0xa9, 0xa9],
1489 "urn:x-suika-fam-cx:css:darkgreen": [0x00, 0x64, 0x00],
1490 "urn:x-suika-fam-cx:css:darkgrey": [0xa9, 0xa9, 0xa9],
1491 "urn:x-suika-fam-cx:css:darkkhaki": [0xbd, 0xb7, 0x6b],
1492 "urn:x-suika-fam-cx:css:darkmagenta": [0x8b, 0x00, 0x8b],
1493 "urn:x-suika-fam-cx:css:darkolivegreen": [0x55, 0x6b, 0x2f],
1494 "urn:x-suika-fam-cx:css:darkorange": [0xff, 0x8c, 0x00],
1495 "urn:x-suika-fam-cx:css:darkorchid": [0x99, 0x32, 0xcc],
1496 "urn:x-suika-fam-cx:css:darkred": [0x8b, 0x00, 0x00],
1497 "urn:x-suika-fam-cx:css:darksalmon": [0xe9, 0x96, 0x7a],
1498 "urn:x-suika-fam-cx:css:darkseagreen": [0x8f, 0xbc, 0x8f],
1499 "urn:x-suika-fam-cx:css:darkslateblue": [0x48, 0x3d, 0x8b],
1500 "urn:x-suika-fam-cx:css:darkslategray": [0x2f, 0x4f, 0x4f],
1501 "urn:x-suika-fam-cx:css:darkslategrey": [0x2f, 0x4f, 0x4f],
1502 "urn:x-suika-fam-cx:css:darkturquoise": [0x00, 0xce, 0xd1],
1503 "urn:x-suika-fam-cx:css:darkviolet": [0x94, 0x00, 0xd3],
1504 "urn:x-suika-fam-cx:css:deeppink": [0xff, 0x14, 0x93],
1505 "urn:x-suika-fam-cx:css:deepskyblue": [0x00, 0xbf, 0xff],
1506 "urn:x-suika-fam-cx:css:dimgray": [0x69, 0x69, 0x69],
1507 "urn:x-suika-fam-cx:css:dimgrey": [0x69, 0x69, 0x69],
1508 "urn:x-suika-fam-cx:css:dodgerblue": [0x1e, 0x90, 0xff],
1509 "urn:x-suika-fam-cx:css:firebrick": [0xb2, 0x22, 0x22],
1510 "urn:x-suika-fam-cx:css:floralwhite": [0xff, 0xfa, 0xf0],
1511 "urn:x-suika-fam-cx:css:forestgreen": [0x22, 0x8b, 0x22],
1512 "urn:x-suika-fam-cx:css:fuchsia": [0xff, 0x00, 0xff],
1513 "urn:x-suika-fam-cx:css:gainsboro": [0xdc, 0xdc, 0xdc],
1514 "urn:x-suika-fam-cx:css:ghostwhite": [0xf8, 0xf8, 0xff],
1515 "urn:x-suika-fam-cx:css:gold": [0xff, 0xd7, 0x00],
1516 "urn:x-suika-fam-cx:css:goldenrod": [0xda, 0xa5, 0x20],
1517 "urn:x-suika-fam-cx:css:gray": [0x80, 0x80, 0x80],
1518 "urn:x-suika-fam-cx:css:green": [0x00, 0x80, 0x00],
1519 "urn:x-suika-fam-cx:css:greenyellow": [0xad, 0xff, 0x2f],
1520 "urn:x-suika-fam-cx:css:grey": [0x80, 0x80, 0x80],
1521 "urn:x-suika-fam-cx:css:honeydew": [0xf0, 0xff, 0xf0],
1522 "urn:x-suika-fam-cx:css:hotpink": [0xff, 0x69, 0xb4],
1523 "urn:x-suika-fam-cx:css:indianred": [0xcd, 0x5c, 0x5c],
1524 "urn:x-suika-fam-cx:css:indigo": [0x4b, 0x00, 0x82],
1525 "urn:x-suika-fam-cx:css:ivory": [0xff, 0xff, 0xf0],
1526 "urn:x-suika-fam-cx:css:khaki": [0xf0, 0xe6, 0x8c],
1527 "urn:x-suika-fam-cx:css:lavender": [0xe6, 0xe6, 0xfa],
1528 "urn:x-suika-fam-cx:css:lavenderblush": [0xff, 0xf0, 0xf5],
1529 "urn:x-suika-fam-cx:css:lawngreen": [0x7c, 0xfc, 0x00],
1530 "urn:x-suika-fam-cx:css:lemonchiffon": [0xff, 0xfa, 0xcd],
1531 "urn:x-suika-fam-cx:css:lightblue": [0xad, 0xd8, 0xe6],
1532 "urn:x-suika-fam-cx:css:lightcoral": [0xf0, 0x80, 0x80],
1533 "urn:x-suika-fam-cx:css:lightcyan": [0xe0, 0xff, 0xff],
1534 "urn:x-suika-fam-cx:css:lightgoldenrodyellow": [0xfa, 0xfa, 0xd2],
1535 "urn:x-suika-fam-cx:css:lightgray": [0xd3, 0xd3, 0xd3],
1536 "urn:x-suika-fam-cx:css:lightgreen": [0x90, 0xee, 0x90],
1537 "urn:x-suika-fam-cx:css:lightgrey": [0xd3, 0xd3, 0xd3],
1538 "urn:x-suika-fam-cx:css:lightpink": [0xff, 0xb6, 0xc1],
1539 "urn:x-suika-fam-cx:css:lightsalmon": [0xff, 0xa0, 0x7a],
1540 "urn:x-suika-fam-cx:css:lightseagreen": [0x20, 0xb2, 0xaa],
1541 "urn:x-suika-fam-cx:css:lightskyblue": [0x87, 0xce, 0xfa],
1542 "urn:x-suika-fam-cx:css:lightslategray": [0x77, 0x88, 0x99],
1543 "urn:x-suika-fam-cx:css:lightslategrey": [0x77, 0x88, 0x99],
1544 "urn:x-suika-fam-cx:css:lightsteelblue": [0xb0, 0xc4, 0xde],
1545 "urn:x-suika-fam-cx:css:lightyellow": [0xff, 0xff, 0xe0],
1546 "urn:x-suika-fam-cx:css:lime": [0x00, 0xff, 0x00],
1547 "urn:x-suika-fam-cx:css:limegreen": [0x32, 0xcd, 0x32],
1548 "urn:x-suika-fam-cx:css:linen": [0xfa, 0xf0, 0xe6],
1549 "urn:x-suika-fam-cx:css:magenta": [0xff, 0x00, 0xff],
1550 "urn:x-suika-fam-cx:css:maroon": [0x80, 0x00, 0x00],
1551 "urn:x-suika-fam-cx:css:mediumaquamarine": [0x66, 0xcd, 0xaa],
1552 "urn:x-suika-fam-cx:css:mediumblue": [0x00, 0x00, 0xcd],
1553 "urn:x-suika-fam-cx:css:mediumorchid": [0xba, 0x55, 0xd3],
1554 "urn:x-suika-fam-cx:css:mediumpurple": [0x93, 0x70, 0xdb],
1555 "urn:x-suika-fam-cx:css:mediumseagreen": [0x3c, 0xb3, 0x71],
1556 "urn:x-suika-fam-cx:css:mediumslateblue": [0x7b, 0x68, 0xee],
1557 "urn:x-suika-fam-cx:css:mediumspringgreen": [0x00, 0xfa, 0x9a],
1558 "urn:x-suika-fam-cx:css:mediumturquoise": [0x48, 0xd1, 0xcc],
1559 "urn:x-suika-fam-cx:css:mediumvioletred": [0xc7, 0x15, 0x85],
1560 "urn:x-suika-fam-cx:css:midnightblue": [0x19, 0x19, 0x70],
1561 "urn:x-suika-fam-cx:css:mintcream": [0xf5, 0xff, 0xfa],
1562 "urn:x-suika-fam-cx:css:mistyrose": [0xff, 0xe4, 0xe1],
1563 "urn:x-suika-fam-cx:css:moccasin": [0xff, 0xe4, 0xb5],
1564 "urn:x-suika-fam-cx:css:navajowhite": [0xff, 0xde, 0xad],
1565 "urn:x-suika-fam-cx:css:navy": [0x00, 0x00, 0x80],
1566 "urn:x-suika-fam-cx:css:oldlace": [0xfd, 0xf5, 0xe6],
1567 "urn:x-suika-fam-cx:css:olive": [0x80, 0x80, 0x00],
1568 "urn:x-suika-fam-cx:css:olivedrab": [0x6b, 0x8e, 0x23],
1569 "urn:x-suika-fam-cx:css:orange": [0xff, 0xa5, 0x00],
1570 "urn:x-suika-fam-cx:css:orangered": [0xff, 0x45, 0x00],
1571 "urn:x-suika-fam-cx:css:orchid": [0xda, 0x70, 0xd6],
1572 "urn:x-suika-fam-cx:css:palegoldenrod": [0xee, 0xe8, 0xaa],
1573 "urn:x-suika-fam-cx:css:palegreen": [0x98, 0xfb, 0x98],
1574 "urn:x-suika-fam-cx:css:paleturquoise": [0xaf, 0xee, 0xee],
1575 "urn:x-suika-fam-cx:css:palevioletred": [0xdb, 0x70, 0x93],
1576 "urn:x-suika-fam-cx:css:papayawhip": [0xff, 0xef, 0xd5],
1577 "urn:x-suika-fam-cx:css:peachpuff": [0xff, 0xda, 0xb9],
1578 "urn:x-suika-fam-cx:css:peru": [0xcd, 0x85, 0x3f],
1579 "urn:x-suika-fam-cx:css:pink": [0xff, 0xc0, 0xcb],
1580 "urn:x-suika-fam-cx:css:plum": [0xdd, 0xa0, 0xdd],
1581 "urn:x-suika-fam-cx:css:powderblue": [0xb0, 0xe0, 0xe6],
1582 "urn:x-suika-fam-cx:css:purple": [0x80, 0x00, 0x80],
1583 "urn:x-suika-fam-cx:css:red": [0xff, 0x00, 0x00],
1584 "urn:x-suika-fam-cx:css:rosybrown": [0xbc, 0x8f, 0x8f],
1585 "urn:x-suika-fam-cx:css:royalblue": [0x41, 0x69, 0xe1],
1586 "urn:x-suika-fam-cx:css:saddlebrown": [0x8b, 0x45, 0x13],
1587 "urn:x-suika-fam-cx:css:salmon": [0xfa, 0x80, 0x72],
1588 "urn:x-suika-fam-cx:css:sandybrown": [0xf4, 0xa4, 0x60],
1589 "urn:x-suika-fam-cx:css:seagreen": [0x2e, 0x8b, 0x57],
1590 "urn:x-suika-fam-cx:css:seashell": [0xff, 0xf5, 0xee],
1591 "urn:x-suika-fam-cx:css:sienna": [0xa0, 0x52, 0x2d],
1592 "urn:x-suika-fam-cx:css:silver": [0xc0, 0xc0, 0xc0],
1593 "urn:x-suika-fam-cx:css:skyblue": [0x87, 0xce, 0xeb],
1594 "urn:x-suika-fam-cx:css:slateblue": [0x6a, 0x5a, 0xcd],
1595 "urn:x-suika-fam-cx:css:slategray": [0x70, 0x80, 0x90],
1596 "urn:x-suika-fam-cx:css:slategrey": [0x70, 0x80, 0x90],
1597 "urn:x-suika-fam-cx:css:snow": [0xff, 0xfa, 0xfa],
1598 "urn:x-suika-fam-cx:css:springgreen": [0x00, 0xff, 0x7f],
1599 "urn:x-suika-fam-cx:css:steelblue": [0x46, 0x82, 0xb4],
1600 "urn:x-suika-fam-cx:css:tan": [0xd2, 0xb4, 0x8c],
1601 "urn:x-suika-fam-cx:css:teal": [0x00, 0x80, 0x80],
1602 "urn:x-suika-fam-cx:css:thistle": [0xd8, 0xbf, 0xd8],
1603 "urn:x-suika-fam-cx:css:tomato": [0xff, 0x63, 0x47],
1604 "urn:x-suika-fam-cx:css:turquoise": [0x40, 0xe0, 0xd0],
1605 "urn:x-suika-fam-cx:css:violet": [0xee, 0x82, 0xee],
1606 "urn:x-suika-fam-cx:css:wheat": [0xf5, 0xde, 0xb3],
1607 "urn:x-suika-fam-cx:css:white": [0xff, 0xff, 0xff],
1608 "urn:x-suika-fam-cx:css:whitesmoke": [0xf5, 0xf5, 0xf5],
1609 "urn:x-suika-fam-cx:css:yellow": [0xff, 0xff, 0x00],
1610 "urn:x-suika-fam-cx:css:yellowgreen": [0x9a, 0xcd, 0x32],
1611
1612 "urn:x-suika-fam-cx:css:transparent": [0, 0, 0, 0]
1613 }[xuri];
1614 if (rgb) {
1615 if (rgb.length == 3) {
1616 propSet.setPropertyValueNS
1617 (namespaceURI, prefix, localName,
1618 new cx.fam.suika.y2005.CSS.Value.RGBValue (rgb[0], rgb[1], rgb[2], 1));
1619 } else if (rgb.length == 4) {
1620 propSet.setPropertyValueNS
1621 (namespaceURI, prefix, localName,
1622 new cx.fam.suika.y2005.CSS.Value.RGBValue (rgb[0], rgb[1], rgb[2], rgb[3]));
1623 }
1624 return;
1625 }
1626 if (xuri == "urn:x-suika-fam-cx:css:currentcolor") {
1627 propSet.setPropertyValueNS
1628 (namespaceURI, prefix, localName,
1629 propSet.getSpecifiedPropertyValueNS ("urn:x-suika-fam-cx:css:", "color"));
1630 }
1631 cx.fam.suika.y2005.CSS.Property.Definition_Length._super.setComputedValue.apply
1632 (this, arguments);
1633 return;
1634 }
1635 /* unchange */
1636 };
1637
1638 /**
1639 Class |CSS.Property.Definition_Color4|
1640
1641 The definition for a property that only allows one, two, three, or four <color>s.
1642 */
1643 cx.fam.suika.y2005.CSS.Property.Definition_Color4 = function (template) {
1644 cx.fam.suika.y2005.CSS.Property.Definition_Color4._superclass.apply
1645 (this, [template]);
1646 };
1647 cx.fam.suika.y2005.CSS.Property.Definition_Color4.inherits
1648 (cx.fam.suika.y2005.CSS.Property.Definition_Color);
1649
1650 cx.fam.suika.y2005.CSS.Property.Definition_Color4.prototype.parseValueFromTokens =
1651 function (parser, namespaceURI, prefix, localName) {
1652 var value = parser._GetNextValue ();
1653 if (value == null) return null;
1654 switch (value.getTypeURI ()) {
1655 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1656 var values = [value, value, value, value];
1657 break;
1658 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1659 if (this.validKeyword1[value.getExpandedURI ()]) {
1660 var values = [value];
1661 } else {
1662 var values = [value, value, value, value];
1663 }
1664 break;
1665 default:
1666 return null;
1667 }
1668
1669 value = parser._GetNextValue ();
1670 if (value == null) return values;
1671 if (values.length == 1) return null;
1672 switch (value.getTypeURI ()) {
1673 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1674 values[1] = value;
1675 values[3] = value;
1676 break;
1677 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1678 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1679 values[1] = value;
1680 values[3] = value;
1681 break;
1682 default:
1683 return null;
1684 }
1685
1686 value = parser._GetNextValue ();
1687 if (value == null) return values;
1688 switch (value.getTypeURI ()) {
1689 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1690 values[2] = value;
1691 break;
1692 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1693 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1694 values[2] = value;
1695 break;
1696 default:
1697 return null;
1698 }
1699
1700 value = parser._GetNextValue ();
1701 if (value == null) return values;
1702 switch (value.getTypeURI ()) {
1703 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1704 values[3] = value;
1705 return values;
1706 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1707 if (this.validKeyword1[value.getExpandedURI ()]) return null;
1708 values[3] = value;
1709 return values;
1710 default:
1711 return null;
1712 }
1713 };
1714
1715 cx.fam.suika.y2005.CSS.Property.Definition_Color4.prototype.isValidValue =
1716 function (namespaceURI, localName, value) {
1717 return false;
1718 };
1719
1720 /* |setDeclaredValue| method must be defined for each property. */
1721
1722
1723 /**
1724 Class |CSS.Property.Definition_URI|
1725
1726 The definition for a property that only allows one <uri>.
1727 */
1728 cx.fam.suika.y2005.CSS.Property.Definition_URI = function (template) {
1729 cx.fam.suika.y2005.CSS.Property.Definition_URI._superclass.apply
1730 (this, [template]);
1731 this.validFunction["urn:x-suika-fam-cx:css:url"] = true;
1732 };
1733 cx.fam.suika.y2005.CSS.Property.Definition_URI.inherits
1734 (cx.fam.suika.y2005.CSS.Property.Definition);
1735
1736 cx.fam.suika.y2005.CSS.Property.Definition_URI.prototype.parseValueFromTokens =
1737 function (parser, namespaceURI, prefix, localName) {
1738 var value = parser._GetNextValue ();
1739 if (value == null) return null;
1740 switch (value.getTypeURI ()) {
1741 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1742 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1743 return value;
1744 }
1745 return null;
1746 };
1747
1748 cx.fam.suika.y2005.CSS.Property.Definition_URI.prototype.isValidValue =
1749 function (namespaceURI, localName, value, partial) {
1750 switch (value.getTypeURI ()) {
1751 case "tag:manakai@suika.fam.cx,2005-11:FUNCTION":
1752 return this.validFunction[value.getFunctionExpandedURI ()];
1753 return true;
1754 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1755 return (this.validKeyword[value.getExpandedURI ()] ||
1756 (!partial && this.validKeyword1[value.getExpandedURI ()]));
1757 }
1758 return false;
1759 };
1760
1761 cx.fam.suika.y2005.CSS.Property.Definition_URI.prototype.setComputedValue =
1762 function (namespaceURI, prefix, localName, parentPropSet, propSet, value,
1763 elementNode) {
1764 switch (value.getTypeURI ()) {
1765 case "tag:manakai@suika.fam.cx,2005-11:URI":
1766 /* TODO: resolve relative URIs */
1767 break;
1768 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1769 cx.fam.suika.y2005.CSS.Property.Definition_URI._super.setComputedValue.apply
1770 (this, arguments);
1771 return;
1772 }
1773 /* unchange */
1774 };
1775
1776
1777 /**
1778 Returns a |setDeclaredValue| method implementation for shorthand
1779 properties that corresponding to a set of |top|, |right|, |bottom|, and
1780 |left| longhand properties.
1781 */
1782 cx.fam.suika.y2005.CSS.Property.setDeclaredValue4 =
1783 function (propNamespaceURI, propPrefix, propSuffix) {
1784 return function (namespaceURI, prefix, localName, propSet, valueSource, priority) {
1785 if (valueSource.length == 1) { /* |inherit| and so on */
1786 valueSource = [valueSource[0], valueSource[0], valueSource[0], valueSource[0]];
1787 } else {
1788 var checker = cx.fam.suika.y2005.CSS.Property.Definition
1789 [propNamespaceURI + propPrefix + "bottom" + propSuffix].isValidValue;
1790 if (!checker.apply (this, [namespaceURI, localName, valueSource[0], true]) ||
1791 !checker.apply (this, [namespaceURI, localName, valueSource[1], true]) ||
1792 !checker.apply (this, [namespaceURI, localName, valueSource[2], true]) ||
1793 !checker.apply (this, [namespaceURI, localName, valueSource[3], true]))
1794 return;
1795 }
1796 propSet.addPropertyValueNS
1797 (propNamespaceURI, null, propPrefix + "top" + propSuffix,
1798 valueSource[0], priority);
1799 propSet.addPropertyValueNS
1800 (propNamespaceURI, null, propPrefix + "right" + propSuffix,
1801 valueSource[1], priority);
1802 propSet.addPropertyValueNS
1803 (propNamespaceURI, null, propPrefix + "bottom" + propSuffix,
1804 valueSource[2], priority);
1805 propSet.addPropertyValueNS
1806 (propNamespaceURI, null, propPrefix + "left" + propSuffix,
1807 valueSource[3], priority);
1808 };
1809 };
1810
1811
1812 /*
1813 Instances of property definitions
1814 */
1815
1816 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:background"] =
1817 new cx.fam.suika.y2005.CSS.Property.Definition ({
1818 isShorthand: true,
1819 isValidValue: function () { return false },
1820 parseValueFromTokens: function (parser, namespaceURI, prefix, localName) {
1821 var propDef = {
1822 color: cx.fam.suika.y2005.CSS.Property.Definition
1823 ["urn:x-suika-fam-cx:css:background-color"],
1824 image: cx.fam.suika.y2005.CSS.Property.Definition
1825 ["urn:x-suika-fam-cx:css:background-image"],
1826 repeat: cx.fam.suika.y2005.CSS.Property.Definition
1827 ["urn:x-suika-fam-cx:css:background-repeat"],
1828 attachment: cx.fam.suika.y2005.CSS.Property.Definition
1829 ["urn:x-suika-fam-cx:css:background-attachment"],
1830 position: cx.fam.suika.y2005.CSS.Property.Definition
1831 ["urn:x-suika-fam-cx:css:background-position"]
1832 };
1833 var values = {
1834 color: propDef.color.initialValue,
1835 image: propDef.image.initialValue,
1836 repeat: propDef.repeat.initialValue,
1837 attachment: propDef.attachment.initialValue,
1838 positionX: new cx.fam.suika.y2005.CSS.Value.NumericValue
1839 (50, null, null, "%"),
1840 positionY: new cx.fam.suika.y2005.CSS.Value.NumericValue
1841 (50, null, null, "%")
1842 };
1843
1844 for (var i = 0; i < 5; i++) {
1845 var value = parser._GetNextValue ();
1846 if (value == null) {
1847 if (i == 0) return null;
1848 return values;
1849 }
1850
1851 if (propDef.color &&
1852 propDef.color.isValidValue (namespaceURI, localName, value, true)) {
1853 values.color = value;
1854 propDef.color = null;
1855 } else if (propDef.image &&
1856 propDef.image.isValidValue (namespaceURI, localName, value, true)) {
1857 values.image = value;
1858 propDef.image = null;
1859 } else if (propDef.repeat &&
1860 propDef.repeat.isValidValue (namespaceURI, localName, value, true)) {
1861 values.repeat = value;
1862 propDef.repeat = null;
1863 } else if (propDef.attachment &&
1864 propDef.attachment.isValidValue (namespaceURI, localName, value, true)) {
1865 values.attachment = value;
1866 propDef.attachment = null;
1867 } else if (propDef.position) {
1868 parser._ValueStack.push (value);
1869 var valueSourcePosition = propDef.position.parseValueFromTokens
1870 (parser, namespaceURI, prefix, localName);
1871 if (valueSourcePosition == null) return null;
1872 values.positionX = valueSourcePosition[0];
1873 values.positionY = valueSourcePosition[1];
1874 } else {
1875 return null;
1876 }
1877 }
1878 return values;
1879 },
1880 setDeclaredValue: function (namespaceURI, prefix, localName,
1881 propSet, valueSource, priority) {
1882 /* Since |parseValueFromTokens| ensures three values are
1883 valid, this method does not have to check it. */
1884 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
1885 "background-color", valueSource.color, priority);
1886 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
1887 "background-image", valueSource.image, priority);
1888 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
1889 "background-repeat", valueSource.repeat, priority);
1890 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null, "background-attachment",
1891 valueSource.attachment, priority);
1892 propSet.addPropertyValueNS ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
1893 "manakai", "background-position-x",
1894 valueSource.positionX, priority);
1895 propSet.addPropertyValueNS ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
1896 "manakai", "background-position-y",
1897 valueSource.positionY, priority);
1898 }
1899 });
1900 cx.fam.suika.y2005.CSS.Property.Definition
1901 ["urn:x-suika-fam-cx:css:background-attachment"] =
1902 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
1903 /* CSS2.1 */
1904 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
1905 ("urn:x-suika-fam-cx:css:", null, "scroll"),
1906 validKeyword: {
1907 "urn:x-suika-fam-cx:css:fixed": true,
1908 "urn:x-suika-fam-cx:css:scroll": true
1909 }
1910 });
1911 cx.fam.suika.y2005.CSS.Property.Definition
1912 ["urn:x-suika-fam-cx:css:background-color"] =
1913 new cx.fam.suika.y2005.CSS.Property.Definition_Color ({
1914 /* Introduced in CSS1 */
1915 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
1916 ("urn:x-suika-fam-cx:css:", null, "transparent")
1917 });
1918 cx.fam.suika.y2005.CSS.Property.Definition
1919 ["urn:x-suika-fam-cx:css:background-position"] =
1920 new cx.fam.suika.y2005.CSS.Property.Definition ({
1921 isShorthand: true,
1922 isValidValue: function () { return false },
1923 parseValueFromTokens: function (parser, namespaceURI, prefix, localName) {
1924 var value = parser._GetNextValue ();
1925 if (value == null) return null;
1926 var defX = cx.fam.suika.y2005.CSS.Property.Definition
1927 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.background-position-x"];
1928 var defY = cx.fam.suika.y2005.CSS.Property.Definition
1929 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.background-position-x"];
1930
1931 switch (value.getTypeURI ()) {
1932 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1933 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1934 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1935 var value1 = value;
1936 break;
1937 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1938 switch (value.getExpandedURI ()) {
1939 case "urn:x-suika-fam-cx:css:left":
1940 case "urn:x-suika-fam-cx:css:right":
1941 var value1 = value;
1942 break;
1943 case "urn:x-suika-fam-cx:css:top":
1944 case "urn:x-suika-fam-cx:css:bottom":
1945 var value1 = parser._GetNextValue ();
1946 if (value1 == null) {
1947 return [new cx.fam.suika.y2005.CSS.Value.NumericValue
1948 (50, null, null, "%"), value];
1949 }
1950 if (value1.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT") {
1951 switch (value1.getExpandedURI ()) {
1952 case "urn:x-suika-fam-cx:css:left":
1953 case "urn:x-suika-fam-cx:css:center":
1954 case "urn:x-suika-fam-cx:css:right":
1955 return [value1, value];
1956 }
1957 }
1958 parser._ValueStack.push (value1);
1959 return null;
1960 case "urn:x-suika-fam-cx:css:center":
1961 var value2 = parser._GetNextValue ();
1962 if (value2 == null) {
1963 return [value, new cx.fam.suika.y2005.CSS.Value.NumericValue
1964 (50, null, null, "%")];
1965 }
1966 switch (value2.getTypeURI ()) {
1967 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
1968 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
1969 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
1970 return [value, value2];
1971 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
1972 switch (value2.getExpandedURI ()) {
1973 case "urn:x-suika-fam-cx:css:top":
1974 case "urn:x-suika-fam-cx:css:center":
1975 case "urn:x-suika-fam-cx:css:bottom":
1976 return [value, value2];
1977 case "urn:x-suika-fam-cx:css:left":
1978 case "urn:x-suika-fam-cx:css:right":
1979 return [value2, value];
1980 }
1981 }
1982 parser._ValueStack.push (value2);
1983 return null;
1984 default:
1985 if (this.validKeyword1[value.getExpandedURI ()]) {
1986 var r = [value, value];
1987 r.isKeyword1 = true;
1988 return r;
1989 } else {
1990 parser._ValueStack.push (value);
1991 return null;
1992 }
1993 }
1994 break;
1995 default:
1996 parser._ValueStack.push (value);
1997 return null;
1998 }
1999
2000 var value2 = parser._GetNextValue ();
2001 if (value2 == null) {
2002 return [value, new cx.fam.suika.y2005.CSS.Value.NumericValue
2003 (50, null, null, "%")];
2004 }
2005 switch (value2.getTypeURI ()) {
2006 case "tag:manakai@suika.fam.cx,2005-11:DIMENSION":
2007 case "tag:manakai@suika.fam.cx,2005-11:PERCENTAGE":
2008 case "tag:manakai@suika.fam.cx,2005-11:NUMBER":
2009 return [value, value2];
2010 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
2011 switch (value2.getExpandedURI ()) {
2012 case "urn:x-suika-fam-cx:css:top":
2013 case "urn:x-suika-fam-cx:css:center":
2014 case "urn:x-suika-fam-cx:css:bottom":
2015 return [value, value2];
2016 }
2017 }
2018 /* For |background| parser */
2019 parser._ValueStack.push (value2);
2020 return [value, new cx.fam.suika.y2005.CSS.Value.NumericValue
2021 (50, null, null, "%")];
2022 },
2023 setDeclaredValue: function (namespaceURI, prefix, localName,
2024 propSet, valueSource, priority) {
2025 /* Since |parseValueFromTokens| ensures three values are
2026 valid, this method does not have to check it. */
2027 propSet.addPropertyValueNS
2028 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.", "manakai",
2029 "background-position-x", valueSource[0], priority);
2030 propSet.addPropertyValueNS
2031 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.", "manakai",
2032 "background-position-y", valueSource[1], priority);
2033 }
2034 });
2035 cx.fam.suika.y2005.CSS.Property.Definition
2036 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.background-position-x"] =
2037 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2038 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, "%"),
2039 prefix: "manakai",
2040 validKeyword: {
2041 "urn:x-suika-fam-cx:css:center": {
2042 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2043 (50, null, null, "%")
2044 },
2045 "urn:x-suika-fam-cx:css:left": {
2046 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2047 (0, null, null, "%")
2048 },
2049 "urn:x-suika-fam-cx:css:right": {
2050 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2051 (100, null, null, "%")
2052 }
2053 },
2054 validType: {
2055 "tag:manakai@suika.fam.cx,2005-11:length": true,
2056 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2057 }
2058 });
2059 cx.fam.suika.y2005.CSS.Property.Definition
2060 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.background-position-y"] =
2061 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2062 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, "%"),
2063 prefix: "manakai",
2064 validKeyword: {
2065 "urn:x-suika-fam-cx:css:bottom": {
2066 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2067 (100, null, null, "%")
2068 },
2069 "urn:x-suika-fam-cx:css:center": {
2070 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2071 (50, null, null, "%")
2072 },
2073 "urn:x-suika-fam-cx:css:top": {
2074 computedValue: new cx.fam.suika.y2005.CSS.Value.NumericValue
2075 (0, null, null, "%")
2076 }
2077 },
2078 validType: {
2079 "tag:manakai@suika.fam.cx,2005-11:length": true,
2080 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2081 }
2082 });
2083 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:background-image"] =
2084 new cx.fam.suika.y2005.CSS.Property.Definition_URI ({
2085 /* Introduced in CSS1 */
2086 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2087 ("urn:x-suika-fam-cx:css:", null, "none"),
2088 validKeyword: {
2089 "urn:x-suika-fam-cx:css:none": true
2090 }
2091 });
2092 cx.fam.suika.y2005.CSS.Property.Definition
2093 ["urn:x-suika-fam-cx:css:background-repeat"] =
2094 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2095 /* CSS2.1 */
2096 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2097 ("urn:x-suika-fam-cx:css:", null, "repeat"),
2098 validKeyword: {
2099 "urn:x-suika-fam-cx:css:no-repeat": true,
2100 "urn:x-suika-fam-cx:css:repeat": true,
2101 "urn:x-suika-fam-cx:css:repeat-x": true,
2102 "urn:x-suika-fam-cx:css:repeat-y": true
2103 }
2104 });
2105 cx.fam.suika.y2005.CSS.Property.Definition
2106 ["urn:x-suika-fam-cx:css:border"] =
2107 new cx.fam.suika.y2005.CSS.Property.Definition ({
2108 isShorthand: true,
2109 isValidValue: function () { return false },
2110 parseValueFromTokens: function (parser, namespaceURI, prefix, localName) {
2111 var value = parser._GetNextValue ();
2112 if (value == null) return null;
2113 var bColor = cx.fam.suika.y2005.CSS.Property.Definition
2114 ["urn:x-suika-fam-cx:css:border-bottom-color"];
2115 var bStyle = cx.fam.suika.y2005.CSS.Property.Definition
2116 ["urn:x-suika-fam-cx:css:border-bottom-style"];
2117 var bWidth = cx.fam.suika.y2005.CSS.Property.Definition
2118 ["urn:x-suika-fam-cx:css:border-bottom-width"];
2119 var color = bColor.initialValue;
2120 var style = bStyle.initialValue;
2121 var width = bWidth.initialValue;
2122
2123 /* 1st value */
2124 if (bColor.isValidValue (namespaceURI, localName, value, true)) {
2125 color = value; bColor = null;
2126 } else if (bStyle.isValidValue (namespaceURI, localName, value, true)) {
2127 style = value; bStyle = null;
2128 } else if (bWidth.isValidValue (namespaceURI, localName, value, true)) {
2129 width = value; bWidth = null;
2130 } else if (value.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2131 this.validKeyword1[value.getExpandedURI ()]) {
2132 color = value; bColor = null;
2133 style = value; bStyle = null;
2134 width = value; bWidth = null;
2135 } else {
2136 return null;
2137 }
2138
2139 /* 2nd value */
2140 value = parser._GetNextValue ();
2141 if (value == null) {
2142 //
2143 } else if (bColor != null && bColor.isValidValue
2144 (namespaceURI, localName, value, true)) {
2145 color = value; bColor = null;
2146 value = parser._GetNextValue ();
2147 } else if (bStyle != null && bStyle.isValidValue
2148 (namespaceURI, localName, value, true)) {
2149 style = value; bStyle = null;
2150 value = parser._GetNextValue ();
2151 } else if (bWidth != null && bWidth.isValidValue
2152 (namespaceURI, localName, value, true)) {
2153 width = value; bWidth = null;
2154 value = parser._GetNextValue ();
2155 } else {
2156 return null;
2157 }
2158
2159 /* 3rd value */
2160 if (value == null) {
2161 //
2162 } else if (bColor != null && bColor.isValidValue
2163 (namespaceURI, localName, value, true)) {
2164 color = value;
2165 } else if (bStyle != null && bStyle.isValidValue
2166 (namespaceURI, localName, value, true)) {
2167 style = value;
2168 } else if (bWidth != null && bWidth.isValidValue
2169 (namespaceURI, localName, value, true)) {
2170 width = value;
2171 } else {
2172 return null;
2173 }
2174 return [color, style, width];
2175 },
2176 setDeclaredValue: function (namespaceURI, prefix, localName,
2177 propSet, valueSource, priority) {
2178 /* Since |parseValueFromTokens| ensures three values are
2179 valid, this method does not have to check it. */
2180 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2181 "border-bottom-color", valueSource[0], priority);
2182 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2183 "border-bottom-style", valueSource[1], priority);
2184 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2185 "border-bottom-width", valueSource[2], priority);
2186 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2187 "border-left-color", valueSource[0], priority);
2188 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2189 "border-left-style", valueSource[1], priority);
2190 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2191 "border-left-width", valueSource[2], priority);
2192 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2193 "border-right-color", valueSource[0], priority);
2194 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2195 "border-right-style", valueSource[1], priority);
2196 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2197 "border-right-width", valueSource[2], priority);
2198 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2199 "border-top-color", valueSource[0], priority);
2200 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2201 "border-top-style", valueSource[1], priority);
2202 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
2203 "border-top-width", valueSource[2], priority);
2204 }
2205 });
2206 cx.fam.suika.y2005.CSS.Property.Definition
2207 ["urn:x-suika-fam-cx:css:border-bottom"] =
2208 new cx.fam.suika.y2005.CSS.Property.Definition ({
2209 isShorthand: true,
2210 isValidValue: function () { return false },
2211 parseValueFromTokens: cx.fam.suika.y2005.CSS.Property.Definition
2212 ["urn:x-suika-fam-cx:css:border"].parseValueFromTokens,
2213 setDeclaredValue: function (namespaceURI, prefix, localName,
2214 propSet, valueSource, priority) {
2215 /* Since |parseValueFromTokens| ensures three values are
2216 valid, this method does not have to check it. */
2217 propSet.addPropertyValueNS
2218 ("urn:x-suika-fam-cx:css:", null, localName + "-color",
2219 valueSource[0], priority);
2220 propSet.addPropertyValueNS
2221 ("urn:x-suika-fam-cx:css:", null, localName + "-style",
2222 valueSource[1], priority);
2223 propSet.addPropertyValueNS
2224 ("urn:x-suika-fam-cx:css:", null, localName + "-width",
2225 valueSource[2], priority);
2226 }
2227 });
2228 cx.fam.suika.y2005.CSS.Property.Definition
2229 ["urn:x-suika-fam-cx:css:border-bottom-color"] =
2230 new cx.fam.suika.y2005.CSS.Property.Definition_Color ({
2231 /* Introduced in CSS1, modified in CSS2, CSS3 border WD */
2232 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2233 ("urn:x-suika-fam-cx:css:", null, "currentcolor")
2234 });
2235 cx.fam.suika.y2005.CSS.Property.Definition
2236 ["urn:x-suika-fam-cx:css:border-bottom-style"] =
2237 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2238 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2239 ("urn:x-suika-fam-cx:css:", null, "none"),
2240 validKeyword: {
2241 "urn:x-suika-fam-cx:css:dashed": true,
2242 "urn:x-suika-fam-cx:css:dotted": true,
2243 "urn:x-suika-fam-cx:css:double": true,
2244 "urn:x-suika-fam-cx:css:groove": true,
2245 "urn:x-suika-fam-cx:css:hidden": true,
2246 "urn:x-suika-fam-cx:css:inset": true,
2247 "urn:x-suika-fam-cx:css:none": true,
2248 "urn:x-suika-fam-cx:css:outset": true,
2249 "urn:x-suika-fam-cx:css:ridge": true,
2250 "urn:x-suika-fam-cx:css:solid": true
2251 }
2252 });
2253 cx.fam.suika.y2005.CSS.Property.Definition
2254 ["urn:x-suika-fam-cx:css:border-bottom-width"] =
2255 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2256 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2257 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2258 ("urn:x-suika-fam-cx:css:", null, "medium"),
2259 negativeNotAllowed: true,
2260 setComputedValue: function (namespaceURI, prefix, localName, parentPropSet,
2261 propSet, value, elementNode) {
2262 var bs = propSet.getSpecifiedPropertyValueNS
2263 ("urn:x-suika-fam-cx:css:", localName.replace ("width", "style"));
2264 switch (bs.getExpandedURI ()) {
2265 case "urn:x-suika-fam-cx:css:none":
2266 case "urn:x-suika-fam-cx:css:hidden":
2267 propSet.setPropertyValueNS
2268 (namespaceURI, prefix, localName,
2269 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2270 return;
2271 }
2272
2273 switch (value.getTypeURI ()) {
2274 case "tag:manakai@suika.fam.cx,2005-11:IDENT":
2275 switch (value.getExpandedURI ()) {
2276 case "urn:x-suika-fam-cx:css:thin":
2277 /* UA dependent */
2278 propSet.setPropertyValueNS
2279 (namespaceURI, prefix, localName,
2280 new cx.fam.suika.y2005.CSS.Value.NumericValue
2281 (1, "urn:x-suika-fam-cx:css:", null, "px"));
2282 return;
2283 case "urn:x-suika-fam-cx:css:medium":
2284 /* UA dependent */
2285 propSet.setPropertyValueNS
2286 (namespaceURI, prefix, localName,
2287 new cx.fam.suika.y2005.CSS.Value.NumericValue
2288 (3, "urn:x-suika-fam-cx:css:", null, "px"));
2289 return;
2290 case "urn:x-suika-fam-cx:css:thick":
2291 /* UA dependent */
2292 propSet.setPropertyValueNS
2293 (namespaceURI, prefix, localName,
2294 new cx.fam.suika.y2005.CSS.Value.NumericValue
2295 (5, "urn:x-suika-fam-cx:css:", null, "px"));
2296 return;
2297 /* Note. CSS3 box model WD proposes 1px, 3px, and 5px as a possible choice. */
2298 }
2299 }
2300 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue
2301 .apply (this, arguments);
2302 },
2303 validKeyword: {
2304 "urn:x-suika-fam-cx:css:medium": true,
2305 "urn:x-suika-fam-cx:css:thick": true,
2306 "urn:x-suika-fam-cx:css:thin": true
2307 },
2308 validType: {
2309 "tag:manakai@suika.fam.cx,2005-11:length": true,
2310 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2311 /* percentage allowed in CSS3 Box model WD */
2312 }
2313 });
2314 cx.fam.suika.y2005.CSS.Property.Definition
2315 ["urn:x-suika-fam-cx:css:border-color"] =
2316 new cx.fam.suika.y2005.CSS.Property.Definition_Color4 ({
2317 isShorthand: true,
2318 isValidValue: function () { return false },
2319 setDeclaredValue: cx.fam.suika.y2005.CSS.Property.setDeclaredValue4
2320 ("urn:x-suika-fam-cx:css:", "border-", "-color")
2321 });
2322 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:border-left"]
2323 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:border-bottom"];
2324 cx.fam.suika.y2005.CSS.Property.Definition
2325 ["urn:x-suika-fam-cx:css:border-left-color"]
2326 = cx.fam.suika.y2005.CSS.Property.Definition
2327 ["urn:x-suika-fam-cx:css:border-bottom-color"];
2328 cx.fam.suika.y2005.CSS.Property.Definition
2329 ["urn:x-suika-fam-cx:css:border-left-style"]
2330 = cx.fam.suika.y2005.CSS.Property.Definition
2331 ["urn:x-suika-fam-cx:css:border-bottom-style"];
2332 cx.fam.suika.y2005.CSS.Property.Definition
2333 ["urn:x-suika-fam-cx:css:border-left-width"]
2334 = cx.fam.suika.y2005.CSS.Property.Definition
2335 ["urn:x-suika-fam-cx:css:border-bottom-width"];
2336 cx.fam.suika.y2005.CSS.Property.Definition
2337 ["urn:x-suika-fam-cx:css:border-right"]
2338 = cx.fam.suika.y2005.CSS.Property.Definition
2339 ["urn:x-suika-fam-cx:css:border-bottom"];
2340 cx.fam.suika.y2005.CSS.Property.Definition
2341 ["urn:x-suika-fam-cx:css:border-right-color"]
2342 = cx.fam.suika.y2005.CSS.Property.Definition
2343 ["urn:x-suika-fam-cx:css:border-bottom-color"];
2344 cx.fam.suika.y2005.CSS.Property.Definition
2345 ["urn:x-suika-fam-cx:css:border-right-style"]
2346 = cx.fam.suika.y2005.CSS.Property.Definition
2347 ["urn:x-suika-fam-cx:css:border-bottom-style"];
2348 cx.fam.suika.y2005.CSS.Property.Definition
2349 ["urn:x-suika-fam-cx:css:border-right-width"]
2350 = cx.fam.suika.y2005.CSS.Property.Definition
2351 ["urn:x-suika-fam-cx:css:border-bottom-width"];
2352 cx.fam.suika.y2005.CSS.Property.Definition
2353 ["urn:x-suika-fam-cx:css:border-top"]
2354 = cx.fam.suika.y2005.CSS.Property.Definition
2355 ["urn:x-suika-fam-cx:css:border-bottom"];
2356 cx.fam.suika.y2005.CSS.Property.Definition
2357 ["urn:x-suika-fam-cx:css:border-top-color"]
2358 = cx.fam.suika.y2005.CSS.Property.Definition
2359 ["urn:x-suika-fam-cx:css:border-bottom-color"];
2360 cx.fam.suika.y2005.CSS.Property.Definition
2361 ["urn:x-suika-fam-cx:css:border-top-style"]
2362 = cx.fam.suika.y2005.CSS.Property.Definition
2363 ["urn:x-suika-fam-cx:css:border-bottom-style"];
2364 cx.fam.suika.y2005.CSS.Property.Definition
2365 ["urn:x-suika-fam-cx:css:border-top-width"]
2366 = cx.fam.suika.y2005.CSS.Property.Definition
2367 ["urn:x-suika-fam-cx:css:border-bottom-width"];
2368 cx.fam.suika.y2005.CSS.Property.Definition
2369 ["urn:x-suika-fam-cx:css:border-style"] =
2370 new cx.fam.suika.y2005.CSS.Property.Definition_Length4 ({
2371 isShorthand: true,
2372 isValidValue: function () { return false },
2373 setDeclaredValue: cx.fam.suika.y2005.CSS.Property.setDeclaredValue4
2374 ("urn:x-suika-fam-cx:css:", "border-", "-style"),
2375 validKeyword: {
2376 "urn:x-suika-fam-cx:css:dashed": true,
2377 "urn:x-suika-fam-cx:css:dotted": true,
2378 "urn:x-suika-fam-cx:css:double": true,
2379 "urn:x-suika-fam-cx:css:groove": true,
2380 "urn:x-suika-fam-cx:css:hidden": true,
2381 "urn:x-suika-fam-cx:css:inset": true,
2382 "urn:x-suika-fam-cx:css:none": true,
2383 "urn:x-suika-fam-cx:css:outset": true,
2384 "urn:x-suika-fam-cx:css:ridge": true,
2385 "urn:x-suika-fam-cx:css:solid": true
2386 }
2387 });
2388 cx.fam.suika.y2005.CSS.Property.Definition
2389 ["urn:x-suika-fam-cx:css:border-width"] =
2390 new cx.fam.suika.y2005.CSS.Property.Definition_Length4 ({
2391 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2392 isShorthand: true,
2393 isValidValue: function () { return false },
2394 negativeNotAllowed: true,
2395 setDeclaredValue: cx.fam.suika.y2005.CSS.Property.setDeclaredValue4
2396 ("urn:x-suika-fam-cx:css:", "border-", "-width"),
2397 validKeyword: {
2398 "urn:x-suika-fam-cx:css:medium": true,
2399 "urn:x-suika-fam-cx:css:thick": true,
2400 "urn:x-suika-fam-cx:css:thin": true
2401 },
2402 validType: {
2403 "tag:manakai@suika.fam.cx,2005-11:length": true,
2404 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2405 /* percentage allowed in CSS3 Box model WD */
2406 }
2407 });
2408 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:bottom"] =
2409 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2410 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2411 ("urn:x-suika-fam-cx:css:", null, "auto"),
2412 /* Computed value might be amended in |position| computing */
2413 validKeyword: {
2414 "urn:x-suika-fam-cx:css:auto": true
2415 },
2416 validType: {
2417 "tag:manakai@suika.fam.cx,2005-11:length": true,
2418 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2419 }
2420 });
2421 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:clear"] =
2422 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2423 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2424 ("urn:x-suika-fam-cx:css:", null, "none"),
2425 validKeyword: {
2426 "urn:x-suika-fam-cx:css:both": true,
2427 "urn:x-suika-fam-cx:css:left": true,
2428 "urn:x-suika-fam-cx:css:none": true,
2429 "urn:x-suika-fam-cx:css:right": true
2430 }
2431 });
2432 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:color"] =
2433 new cx.fam.suika.y2005.CSS.Property.Definition_Color ({
2434 /* Introduced in CSS1, modified in CSS2, CSS2.1, SVG1, CSS3 Color CR */
2435 /* TODO: |attr| */
2436 inherit: true,
2437 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2438 ("http://suika.fam.cx/~wakaba/archive/2005/cssc.",
2439 "manakai_c", "user-agent-dependent"),
2440 parseValueFromTokens: function (parser, namespaceURI, prefix, localName) {
2441 var value = cx.fam.suika.y2005.CSS.Property.Definition_Color
2442 .prototype.parseValueFromTokens.apply (this, arguments);
2443 if (value &&
2444 value.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2445 value.getExpandedURI () == "urn:x-suika-fam-cx:css:currentcolor") {
2446 value = new cx.fam.suika.y2005.CSS.Value.IdentValue
2447 ("urn:x-suika-fam-cx:css:", null, "inherit");
2448 }
2449 return value;
2450 }
2451 });
2452 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:direction"] =
2453 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2454 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2455 ("urn:x-suika-fam-cx:css:", null, "ltr"),
2456 validKeyword: {
2457 "urn:x-suika-fam-cx:css:ltr": true,
2458 "urn:x-suika-fam-cx:css:rtl": true
2459 }
2460 });
2461 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:display"] =
2462 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2463 isShorthand: true,
2464 isValidValue: function () { return false },
2465 setDeclaredValue: function (namespaceURI, prefix, localName,
2466 propSet, valueSource, priority) {
2467 if (valueSource.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT") {
2468 switch (valueSource.getExpandedURI ()) {
2469 case "urn:x-suika-fam-cx:css:none":
2470 case "urn:x-suika-fam-cx:css:inline":
2471 case "urn:x-suika-fam-cx:css:run-in":
2472 case "urn:x-suika-fam-cx:css:compact":
2473 case "urn:x-suika-fam-cx:css:table-cell":
2474 case "urn:x-suika-fam-cx:css:table-caption":
2475 case "urn:x-suika-fam-cx:css:table-row-group":
2476 case "urn:x-suika-fam-cx:css:table-header-group":
2477 case "urn:x-suika-fam-cx:css:table-footer-group":
2478 case "urn:x-suika-fam-cx:css:table-column":
2479 case "urn:x-suika-fam-cx:css:table-column-group":
2480 case "urn:x-suika-fam-cx:css:table-row":
2481 case "urn:x-suika-fam-cx:css:ruby-base":
2482 case "urn:x-suika-fam-cx:css:ruby-text":
2483 case "urn:x-suika-fam-cx:css:ruby-base-group":
2484 case "urn:x-suika-fam-cx:css:ruby-text-group":
2485 propSet.setPropertyValueNS
2486 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2487 "manakai", "display-role",
2488 new cx.fam.suika.y2005.CSS.Value.IdentValue
2489 ("urn:x-suika-fam-cx:css:", null, valueSource.getLocalName ()));
2490 propSet.setPropertyValueNS
2491 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2492 "manakai", "display-model",
2493 new cx.fam.suika.y2005.CSS.Value.IdentValue
2494 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2495 "manakai", "inline-inside"));
2496 break;
2497 case "urn:x-suika-fam-cx:css:block":
2498 case "urn:x-suika-fam-cx:css:list-item":
2499 propSet.setPropertyValueNS
2500 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2501 "manakai", "display-role",
2502 new cx.fam.suika.y2005.CSS.Value.IdentValue
2503 ("urn:x-suika-fam-cx:css:", null, valueSource.getLocalName ()));
2504 propSet.setPropertyValueNS
2505 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2506 "manakai", "display-model",
2507 new cx.fam.suika.y2005.CSS.Value.IdentValue
2508 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2509 "manakai", "block-inside"));
2510 break;
2511 case "urn:x-suika-fam-cx:css:table":
2512 propSet.setPropertyValueNS
2513 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2514 "manakai", "display-role",
2515 new cx.fam.suika.y2005.CSS.Value.IdentValue
2516 ("urn:x-suika-fam-cx:css:", null, "block"));
2517 propSet.setPropertyValueNS
2518 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2519 "manakai", "display-model",
2520 new cx.fam.suika.y2005.CSS.Value.IdentValue
2521 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2522 "manakai", "table"));
2523 break;
2524 case "urn:x-suika-fam-cx:css:inline-block":
2525 propSet.setPropertyValueNS
2526 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2527 "manakai", "display-role",
2528 new cx.fam.suika.y2005.CSS.Value.IdentValue
2529 ("urn:x-suika-fam-cx:css:", null, "inline"));
2530 propSet.setPropertyValueNS
2531 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2532 "manakai", "display-model",
2533 new cx.fam.suika.y2005.CSS.Value.IdentValue
2534 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2535 "manakai", "block-inside"));
2536 break;
2537 case "urn:x-suika-fam-cx:css:inline-table":
2538 propSet.setPropertyValueNS
2539 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2540 "manakai", "display-role",
2541 new cx.fam.suika.y2005.CSS.Value.IdentValue
2542 ("urn:x-suika-fam-cx:css:", null, "inline"));
2543 propSet.setPropertyValueNS
2544 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2545 "manakai", "display-model",
2546 new cx.fam.suika.y2005.CSS.Value.IdentValue
2547 ("urn:x-suika-fam-cx:css:", null, "table"));
2548 break;
2549 case "urn:x-suika-fam-cx:css:ruby":
2550 propSet.setPropertyValueNS
2551 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2552 "manakai", "display-role",
2553 new cx.fam.suika.y2005.CSS.Value.IdentValue
2554 ("urn:x-suika-fam-cx:css:", null, "inline"));
2555 propSet.setPropertyValueNS
2556 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2557 "manakai", "display-model",
2558 new cx.fam.suika.y2005.CSS.Value.IdentValue
2559 ("urn:x-suika-fam-cx:css:", null, "ruby"));
2560 break;
2561 default:
2562 propSet.setPropertyValueNS
2563 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2564 "manakai", "display-role", valueSource);
2565 propSet.setPropertyValueNS
2566 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2567 "manakai", "display-model", valueSource);
2568 } /* typeURI */
2569 }
2570 }
2571 });
2572 cx.fam.suika.y2005.CSS.Property.Definition
2573 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.display-model"] =
2574 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2575 /* CSS3 Box model WD */
2576 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2577 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
2578 "manakai", "inline-inside"),
2579 prefix: "manakai",
2580 validKeyword: {
2581 "http://suika.fam.cx/~wakaba/archive/2005/11/css.block-inside": true,
2582 "http://suika.fam.cx/~wakaba/archive/2005/11/css.inline-inside": true
2583 }
2584 });
2585 cx.fam.suika.y2005.CSS.Property.Definition
2586 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.display-role"] =
2587 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2588 /* CSS3 Box model WD */
2589 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2590 ("urn:x-suika-fam-cx:css:", null, "inline"),
2591 prefix: "manakai",
2592 validKeyword: {
2593 "urn:x-suika-fam-cx:css:block": true,
2594 "urn:x-suika-fam-cx:css:compact": true,
2595 "urn:x-suika-fam-cx:css:inline": true,
2596 "urn:x-suika-fam-cx:css:list-item": true,
2597 "urn:x-suika-fam-cx:css:none": true,
2598 "urn:x-suika-fam-cx:css:ruby-base": true,
2599 "urn:x-suika-fam-cx:css:ruby-base-group": true,
2600 "urn:x-suika-fam-cx:css:ruby-text": true,
2601 "urn:x-suika-fam-cx:css:ruby-text-group": true,
2602 "urn:x-suika-fam-cx:css:run-in": true,
2603 "urn:x-suika-fam-cx:css:table": true,
2604 "urn:x-suika-fam-cx:css:table-caption": true,
2605 "urn:x-suika-fam-cx:css:table-cell": true,
2606 "urn:x-suika-fam-cx:css:table-column": true,
2607 "urn:x-suika-fam-cx:css:table-column-group": true,
2608 "urn:x-suika-fam-cx:css:table-footer-group": true,
2609 "urn:x-suika-fam-cx:css:table-header-group": true,
2610 "urn:x-suika-fam-cx:css:table-row": true,
2611 "urn:x-suika-fam-cx:css:table-row-group": true
2612 }
2613 });
2614 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:float"] =
2615 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2616 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2617 ("urn:x-suika-fam-cx:css:", null, "none"),
2618 validKeyword: {
2619 "urn:x-suika-fam-cx:css:left": true,
2620 "urn:x-suika-fam-cx:css:none": true,
2621 "urn:x-suika-fam-cx:css:right": true
2622 }
2623 });
2624 cx.fam.suika.y2005.CSS.Property.Definition
2625 ["urn:x-suika-fam-cx:css:font-style"] =
2626 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2627 /* CSS2.1 */
2628 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2629 ("urn:x-suika-fam-cx:css:", null, "normal"),
2630 validKeyword: {
2631 "urn:x-suika-fam-cx:css:italic": true,
2632 "urn:x-suika-fam-cx:css:normal": true,
2633 "urn:x-suika-fam-cx:css:oblique": true
2634 }
2635 });
2636 cx.fam.suika.y2005.CSS.Property.Definition
2637 ["urn:x-suika-fam-cx:css:font-variant"] =
2638 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2639 /* CSS2.1 */
2640 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2641 ("urn:x-suika-fam-cx:css:", null, "normal"),
2642 validKeyword: {
2643 "urn:x-suika-fam-cx:css:normal": true,
2644 "urn:x-suika-fam-cx:css:small-caps": true
2645 }
2646 });
2647 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:font-weight"] =
2648 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2649 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2650 ("urn:x-suika-fam-cx:css:", null, "normal"),
2651 negativeNotAllowed: true,
2652 /* TODO: Computed value & NUMBER range */
2653 validKeyword: {
2654 "urn:x-suika-fam-cx:css:bold": true,
2655 "urn:x-suika-fam-cx:css:bolder": true,
2656 "urn:x-suika-fam-cx:css:lighter": true
2657 },
2658 validType: {
2659 "tag:manakai@suika.fam.cx,2005-11:number": true
2660 }
2661 });
2662 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"] =
2663 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2664 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2665 ("urn:x-suika-fam-cx:css:", null, "auto"),
2666 validKeyword: {
2667 "urn:x-suika-fam-cx:css:auto": true
2668 },
2669 validType: {
2670 "tag:manakai@suika.fam.cx,2005-11:length": true,
2671 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2672 }
2673 });
2674 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:left"]
2675 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:bottom"];
2676 cx.fam.suika.y2005.CSS.Property.Definition
2677 ["urn:x-suika-fam-cx:css:margin"] =
2678 new cx.fam.suika.y2005.CSS.Property.Definition_Length4 ({
2679 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2680 isShorthand: true,
2681 isValidValue: function () { return false },
2682 setDeclaredValue: cx.fam.suika.y2005.CSS.Property.setDeclaredValue4
2683 ("urn:x-suika-fam-cx:css:", "margin-", ""),
2684 validKeyword: {
2685 "urn:x-suika-fam-cx:css:auto": true
2686 },
2687 validType: {
2688 "tag:manakai@suika.fam.cx,2005-11:length": true,
2689 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2690 }
2691 });
2692 cx.fam.suika.y2005.CSS.Property.Definition
2693 ["urn:x-suika-fam-cx:css:margin-bottom"] =
2694 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2695 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2696 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null),
2697 validKeyword: {
2698 "urn:x-suika-fam-cx:css:auto": true
2699 },
2700 validType: {
2701 "tag:manakai@suika.fam.cx,2005-11:length": true,
2702 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2703 }
2704 });
2705 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-left"]
2706 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-bottom"];
2707 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-right"]
2708 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-bottom"];
2709 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-top"]
2710 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:margin-bottom"];
2711 cx.fam.suika.y2005.CSS.Property.Definition
2712 ["urn:x-suika-fam-cx:css:padding"] =
2713 new cx.fam.suika.y2005.CSS.Property.Definition_Length4 ({
2714 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2715 isShorthand: true,
2716 isValidValue: function () { return false },
2717 negativeNotAllowed: true,
2718 setDeclaredValue: cx.fam.suika.y2005.CSS.Property.setDeclaredValue4
2719 ("urn:x-suika-fam-cx:css:", "padding-", ""),
2720 validType: {
2721 "tag:manakai@suika.fam.cx,2005-11:length": true,
2722 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2723 }
2724 });
2725 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:max-height"]
2726 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"];
2727 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:max-width"]
2728 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"];
2729 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:min-height"]
2730 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"];
2731 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:min-width"]
2732 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"];
2733 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:opacity"] =
2734 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2735 /* Introduced in SVG1, also defined in CSS3 color CR */
2736 /* Gecko's deprecated equivalent, |-moz-opacity|, had trouble
2737 in its implementation so that not identical to this property. */
2738 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (1, null, null, null),
2739 setComputedValue: function (namespaceURI, prefix, localName, parentPropSet,
2740 propSet, value, elementNode) {
2741 if (value.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:NUMBER") {
2742 var val = value.getValue ();
2743 if (val < 0) {
2744 propSet.setPropertyValueNS
2745 (namespaceURI, prefix, localName,
2746 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2747 } else if (val > 1) {
2748 propSet.setPropertyValueNS
2749 (namespaceURI, prefix, localName,
2750 new cx.fam.suika.y2005.CSS.Value.NumericValue (1, null, null, null));
2751 }
2752 return;
2753 }
2754 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue
2755 .apply (this, arguments);
2756 },
2757 validType: {
2758 "tag:manakai@suika.fam.cx,2005-11:number": true
2759 }
2760 });
2761 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:overflow"] =
2762 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2763 isShorthand: true,
2764 isValidValue: function () { return false },
2765 setDeclaredValue: function (namespaceURI, prefix, localName,
2766 propSet, valueSource, priority) {
2767 var checker = cx.fam.suika.y2005.CSS.Property.Definition
2768 ["overflow-x"].isValidValue;
2769 if (!checker.apply (this, [namespaceURI, localName, valueSource, true])) return;
2770 propSet.addPropertyValueNS
2771 ("urn:x-suika-fam-cx:css:", null, "overflow-x", valueSource, priority);
2772 propSet.addPropertyValueNS
2773 ("urn:x-suika-fam-cx:css:", null, "overflow-y", valueSource, priority);
2774 },
2775 validKeyword: {
2776 "urn:x-suika-fam-cx:css:auto": true,
2777 "urn:x-suika-fam-cx:css:hidden": true,
2778 "urn:x-suika-fam-cx:css:scroll": true,
2779 "urn:x-suika-fam-cx:css:visible": true
2780 }
2781 });
2782 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:overflow-x"] =
2783 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2784 /* CSS3 box model WD, WinIE 5.0+, Firefox 1.5+ */
2785 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2786 ("urn:x-suika-fam-cx:css:", null, "visible"),
2787 setComputedValue: function (namespaceURI, prefix, localName, parentPropSet,
2788 propSet, value, elementNode) {
2789 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue
2790 .apply (this, arguments);
2791 value = propSet.getSpecifiedPropertyValueNS (namespaceURI, localName);
2792 },
2793 validKeyword: {
2794 "urn:x-suika-fam-cx:css:auto": true,
2795 "urn:x-suika-fam-cx:css:hidden": true,
2796 "urn:x-suika-fam-cx:css:scroll": true,
2797 "urn:x-suika-fam-cx:css:visible": true
2798 }
2799 });
2800 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:overflow-y"] =
2801 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2802 /* CSS3 box model WD, WinIE 5.0+, Firefox 1.5+ */
2803 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2804 ("urn:x-suika-fam-cx:css:", null, "visible"),
2805 setComputedValue: function (namespaceURI, prefix, localName, parentPropSet,
2806 propSet, value, elementNode) {
2807 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue
2808 .apply (this, arguments);
2809
2810 var oX = propSet.getSpecifiedPropertyValueNS
2811 ("urn:x-suika-fam-cx:css:", "overflow-x");
2812 var oY = propSet.getSpecifiedPropertyValueNS
2813 ("urn:x-suika-fam-cx:css:", "overflow-y");
2814 switch (oX.getExpandedURI ()) {
2815 case "urn:x-suika-fam-cx:css:visible":
2816 switch (oY.getExpandedURI ()) {
2817 case "urn:x-suika-fam-cx:css:auto":
2818 case "urn:x-suika-fam-cx:css:scroll":
2819 propSet.setPropertyValueNS
2820 ("urn:x-suika-fam-cx:css:", null, "overflow-x",
2821 new cx.fam.suika.y2005.CSS.Value.IdentValue
2822 ("urn:x-suika-fam-cx:css:", null, "auto"));
2823 break;
2824 }
2825 break;
2826 case "urn:x-suika-fam-cx:css:auto":
2827 case "urn:x-suika-fam-cx:css:scroll":
2828 switch (oY.getExpandedURI ()) {
2829 case "urn:x-suika-fam-cx:css:visible":
2830 propSet.setPropertyValueNS
2831 ("urn:x-suika-fam-cx:css:", null, "overflow-y",
2832 new cx.fam.suika.y2005.CSS.Value.IdentValue
2833 ("urn:x-suika-fam-cx:css:", null, "auto"));
2834 break;
2835 }
2836 break;
2837 }
2838 },
2839 validKeyword: {
2840 "urn:x-suika-fam-cx:css:auto": true,
2841 "urn:x-suika-fam-cx:css:hidden": true,
2842 "urn:x-suika-fam-cx:css:scroll": true,
2843 "urn:x-suika-fam-cx:css:visible": true
2844 }
2845 });
2846 cx.fam.suika.y2005.CSS.Property.Definition
2847 ["urn:x-suika-fam-cx:css:padding-bottom"] =
2848 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
2849 /* Introduced in CSS1, modified in CSS2, CSS3 Box model WD */
2850 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null),
2851 negativeNotAllowed: true,
2852 validType: {
2853 "tag:manakai@suika.fam.cx,2005-11:length": true,
2854 "tag:manakai@suika.fam.cx,2005-11:percentage": true
2855 }
2856 });
2857 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-left"]
2858 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-bottom"];
2859 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-right"]
2860 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-bottom"];
2861 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-top"]
2862 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:padding-bottom"];
2863 cx.fam.suika.y2005.CSS.Property.Definition
2864 ["urn:x-suika-fam-cx:css:page-break-after"] =
2865 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2866 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2867 ("urn:x-suika-fam-cx:css:", null, "auto"),
2868 negativeNotAllowed: true,
2869 validKeyword: {
2870 "urn:x-suika-fam-cx:css:always": true,
2871 "urn:x-suika-fam-cx:css:auto": true,
2872 "urn:x-suika-fam-cx:css:avoid": true,
2873 "urn:x-suika-fam-cx:css:left": true,
2874 "urn:x-suika-fam-cx:css:right": true
2875 }
2876 });
2877 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:page-break-before"]
2878 = cx.fam.suika.y2005.CSS.Property.Definition
2879 ["urn:x-suika-fam-cx:css:page-break-before"];
2880 cx.fam.suika.y2005.CSS.Property.Definition
2881 ["urn:x-suika-fam-cx:css:page-break-inside"] =
2882 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2883 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2884 ("urn:x-suika-fam-cx:css:", null, "auto"),
2885 negativeNotAllowed: true,
2886 validKeyword: {
2887 "urn:x-suika-fam-cx:css:auto": true,
2888 "urn:x-suika-fam-cx:css:avoid": true
2889 }
2890 });
2891 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:position"] =
2892 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
2893 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
2894 ("urn:x-suika-fam-cx:css:", null, "static"),
2895 setComputedValue: function (namespaceURI, prefix, localName, parentPropSet,
2896 propSet, value, elementNode) {
2897 cx.fam.suika.y2005.CSS.Property.Definition_Length.prototype.setComputedValue
2898 .apply (this, arguments);
2899 value = propSet.getSpecifiedPropertyValueNS (namespaceURI, localName);
2900 switch (value.getExpandedURI ()) {
2901 case "urn:x-suika-fam-cx:css:static":
2902 var autoVal = new cx.fam.suika.y2005.CSS.Value.IdentValue
2903 ("urn:x-suika-fam-cx:css:", null, "auto");
2904 propSet.setPropertyValueNS
2905 ("urn:x-suika-fam-cx:css:", null, "left", autoVal);
2906 propSet.setPropertyValueNS
2907 ("urn:x-suika-fam-cx:css:", null, "right", autoVal);
2908 propSet.setPropertyValueNS
2909 ("urn:x-suika-fam-cx:css:", null, "top", autoVal);
2910 propSet.setPropertyValueNS
2911 ("urn:x-suika-fam-cx:css:", null, "bottom", autoVal);
2912 break;
2913 case "urn:x-suika-fam-cx:css:relative":
2914 var leftVal = propSet.getSpecifiedPropertyValueNS
2915 ("urn:x-suika-fam-cx:css:", "left");
2916 if (leftVal.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2917 leftVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
2918 var rightVal = propSet.getSpecifiedPropertyValueNS
2919 ("urn:x-suika-fam-cx:css:", "right");
2920 if (rightVal.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2921 rightVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
2922 /* left:auto; right:auto */
2923 propSet.setPropertyValueNS
2924 ("urn:x-suika-fam-cx:css:", null, "left",
2925 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2926 propSet.setPropertyValueNS
2927 ("urn:x-suika-fam-cx:css:", null, "right",
2928 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2929 } else {
2930 /* left:auto; right:~auto */
2931 propSet.setPropertyValueNS
2932 ("urn:x-suika-fam-cx:css:", null, "left",
2933 new cx.fam.suika.y2005.CSS.Value.NumericValue
2934 (-rightVal.getValue (),
2935 rightVal.getUnitNamespaceURI (),
2936 rightVal.getUnitPrefix (),
2937 rightVal.getUnitLocalName ()));
2938 }
2939 } else {
2940 var rightVal = propSet.getSpecifiedPropertyValueNS
2941 ("urn:x-suika-fam-cx:css:", "right");
2942 if (rightVal.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2943 rightVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
2944 /* left:~auto; right:auto */
2945 propSet.setPropertyValueNS
2946 ("urn:x-suika-fam-cx:css:", null, "right",
2947 new cx.fam.suika.y2005.CSS.Value.NumericValue
2948 (-leftVal.getValue (),
2949 leftVal.getUnitNamespaceURI (),
2950 leftVal.getUnitPrefix (),
2951 leftVal.getUnitLocalName ()));
2952 } else {
2953 /* left:~auto; right:~auto -- over-constrained */
2954 var dirVal = propSet.getSpecifiedPropertyValueNS
2955 ("urn:x-suika-fam-cx:css:", "direction");
2956 if (dirVal.getExpandedURI () == "urn:x-suika-fam-cx:css:ltr") {
2957 propSet.setPropertyValueNS
2958 ("urn:x-suika-fam-cx:css:", null, "right",
2959 new cx.fam.suika.y2005.CSS.Value.NumericValue
2960 (-leftVal.getValue (),
2961 leftVal.getUnitNamespaceURI (),
2962 leftVal.getUnitPrefix (),
2963 leftVal.getUnitLocalName ()));
2964 } else {
2965 propSet.setPropertyValueNS
2966 ("urn:x-suika-fam-cx:css:", null, "left",
2967 new cx.fam.suika.y2005.CSS.Value.NumericValue
2968 (-rightVal.getValue (),
2969 rightVal.getUnitNamespaceURI (),
2970 rightVal.getUnitPrefix (),
2971 rightVal.getUnitLocalName ()));
2972 }
2973 }
2974 }
2975
2976 var topVal = propSet.getSpecifiedPropertyValueNS
2977 ("urn:x-suika-fam-cx:css:", "top");
2978 if (topVal.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2979 topVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
2980 var bottomVal = propSet.getSpecifiedPropertyValueNS
2981 ("urn:x-suika-fam-cx:css:", "bottom");
2982 if (bottomVal.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
2983 bottomVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
2984 /* top:auto; bottom:auto */
2985 propSet.setPropertyValueNS
2986 ("urn:x-suika-fam-cx:css:", null, "top",
2987 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2988 propSet.setPropertyValueNS
2989 ("urn:x-suika-fam-cx:css:", null, "bottom",
2990 new cx.fam.suika.y2005.CSS.Value.NumericValue (0, null, null, null));
2991 } else {
2992 /* top:auto; bottom:~auto */
2993 propSet.setPropertyValueNS
2994 ("urn:x-suika-fam-cx:css:", null, "top",
2995 new cx.fam.suika.y2005.CSS.Value.NumericValue
2996 (-bottomVal.getValue (),
2997 bottomVal.getUnitNamespaceURI (),
2998 bottomVal.getUnitPrefix (),
2999 bottomVal.getUnitLocalName ()));
3000 }
3001 } else {
3002 var bottomVal = propSet.getSpecifiedPropertyValueNS
3003 ("urn:x-suika-fam-cx:css:", "bottom");
3004 if (bottomVal.getTypeURI == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
3005 bottomVal.getExpandedURI () == "urn:x-suika-fam-cx:css:auto") {
3006 /* top:~auto; bottom:auto */
3007 propSet.setPropertyValueNS
3008 ("urn:x-suika-fam-cx:css:", null, "bottom",
3009 new cx.fam.suika.y2005.CSS.Value.NumericValue
3010 (-topVal.getValue (),
3011 topVal.getUnitNamespaceURI (),
3012 topVal.getUnitPrefix (),
3013 topVal.getUnitLocalName ()));
3014 } else {
3015 /* top:~auto; bottom:~auto -- over-constrained */
3016 propSet.setPropertyValueNS
3017 ("urn:x-suika-fam-cx:css:", null, "bottom",
3018 new cx.fam.suika.y2005.CSS.Value.NumericValue
3019 (-topVal.getValue (),
3020 topVal.getUnitNamespaceURI (),
3021 topVal.getUnitPrefix (),
3022 topVal.getUnitLocalName ()));
3023 }
3024 }
3025 break;
3026 }
3027 },
3028 validKeyword: {
3029 "urn:x-suika-fam-cx:css:absolute": true,
3030 "urn:x-suika-fam-cx:css:fixed": true,
3031 "urn:x-suika-fam-cx:css:relative": true,
3032 "urn:x-suika-fam-cx:css:static": true
3033 }
3034 });
3035 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:line-height"] =
3036 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
3037 inherit: true,
3038 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3039 ("urn:x-suika-fam-cx:css:", null, "normal"),
3040 negativeNotAllowed: true,
3041 validKeyword: {
3042 "urn:x-suika-fam-cx:css:normal": true
3043 },
3044 validType: {
3045 "tag:manakai@suika.fam.cx,2005-11:length": true,
3046 "tag:manakai@suika.fam.cx,2005-11:number": true,
3047 "tag:manakai@suika.fam.cx,2005-11:percentage": true
3048 }
3049 });
3050 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:list-style"] =
3051 new cx.fam.suika.y2005.CSS.Property.Definition ({
3052 isShorthand: true,
3053 isValidValue: function () { return false },
3054 parseValueFromTokens: function (parser, namespaceURI, prefix, localName) {
3055 var value = parser._GetNextValue ();
3056 if (value == null) return null;
3057 var lsType = cx.fam.suika.y2005.CSS.Property.Definition
3058 ["urn:x-suika-fam-cx:css:list-style-type"];
3059 var lsPosition = cx.fam.suika.y2005.CSS.Property.Definition
3060 ["urn:x-suika-fam-cx:css:list-style-position"];
3061 var lsImage = cx.fam.suika.y2005.CSS.Property.Definition
3062 ["urn:x-suika-fam-cx:css:list-style-image"];
3063 var type = lsType.initialValue;
3064 var position = lsPosition.initialValue;
3065 var image = lsImage.initialValue;
3066 var hasNone = false;
3067
3068 /* 1st value */
3069 if (lsType.isValidValue (namespaceURI, localName, value, true)) {
3070 type = value;
3071 if (type.getExpandedURI () == "urn:x-suika-fam-cx:css:none") {
3072 image = type;
3073 hasNone = true;
3074 } else {
3075 lsType = null;
3076 }
3077 } else if (lsPosition.isValidValue (namespaceURI, localName, value, true)) {
3078 position = value; lsPosition = null;
3079 } else if (lsImage.isValidValue (namespaceURI, localName, value, true)) {
3080 image = value; lsImage = null;
3081 } else if (value.getTypeURI () == "tag:manakai@suika.fam.cx,2005-11:IDENT" &&
3082 this.validKeyword1[value.getExpandedURI ()]) {
3083 type = value; lsType = null;
3084 position = value; lsPosition = null;
3085 image = value; lsImage = null;
3086 } else {
3087 return null;
3088 }
3089
3090 /* 2nd value */
3091 value = parser._GetNextValue ();
3092 if (value == null) {
3093 //
3094 } else if (lsType != null && lsType.isValidValue
3095 (namespaceURI, localName, value, true)) {
3096 type = value;
3097 value = parser._GetNextValue ();
3098 if (hasNone) {
3099 lsImage = null;
3100 } else if (type.getExpandedURI () == "urn:x-suika-fam-cx:css:none") {
3101 image = type;
3102 } else {
3103 lsType = null;
3104 }
3105 } else if (lsPosition != null && lsPosition.isValidValue
3106 (namespaceURI, localName, value, true)) {
3107 position = value; lsPosition = null;
3108 value = parser._GetNextValue ();
3109 } else if (lsImage != null && lsImage.isValidValue
3110 (namespaceURI, localName, value, true)) {
3111 image = value; lsImage = null;
3112 value = parser._GetNextValue ();
3113 hasNone = false;
3114 } else {
3115 return null;
3116 }
3117
3118 /* 3rd value */
3119 if (value == null) {
3120 //
3121 } else if (lsType != null && lsType.isValidValue
3122 (namespaceURI, localName, value, true)) {
3123 type = value;
3124 if (type.getExpandedURI () == "urn:x-suika-fam-cx:css:none") {
3125 image = type;
3126 }
3127 } else if (lsPosition != null && lsPosition.isValidValue
3128 (namespaceURI, localName, value, true)) {
3129 position = value;
3130 } else if (lsImage != null && lsImage.isValidValue
3131 (namespaceURI, localName, value, true)) {
3132 image = value;
3133 } else {
3134 return null;
3135 }
3136 return [type, position, image];
3137 },
3138 setDeclaredValue: function (namespaceURI, prefix, localName,
3139 propSet, valueSource, priority) {
3140 /* Since |parseValueFromTokens| ensures three values are
3141 valid, this method does not have to check it. */
3142 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
3143 "list-style-type", valueSource[0], priority);
3144 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
3145 "list-style-position", valueSource[1], priority);
3146 propSet.addPropertyValueNS ("urn:x-suika-fam-cx:css:", null,
3147 "list-style-image", valueSource[2], priority);
3148 }
3149 });
3150 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:list-style-image"] =
3151 new cx.fam.suika.y2005.CSS.Property.Definition_URI ({
3152 /* CSS2.1 */
3153 inherit: true,
3154 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3155 ("urn:x-suika-fam-cx:css:", null, "none"),
3156 validKeyword: {
3157 "urn:x-suika-fam-cx:css:none": true
3158 }
3159 });
3160 cx.fam.suika.y2005.CSS.Property.Definition
3161 ["urn:x-suika-fam-cx:css:list-style-position"] =
3162 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3163 /* CSS2.1 */
3164 inherit: true,
3165 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3166 ("urn:x-suika-fam-cx:css:", null, "outside"),
3167 validKeyword: {
3168 "urn:x-suika-fam-cx:css:inside": true,
3169 "urn:x-suika-fam-cx:css:outside": true
3170 }
3171 });
3172 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:list-style-type"] =
3173 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3174 /* CSS2.1 */
3175 inherit: true,
3176 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3177 ("urn:x-suika-fam-cx:css:", null, "disc"),
3178 validKeyword: {
3179 "urn:x-suika-fam-cx:css:lower-alpha": true,
3180 "urn:x-suika-fam-cx:css:upper-alpha": true,
3181 "urn:x-suika-fam-cx:css:armenian": true,
3182 "urn:x-suika-fam-cx:css:circle": true,
3183 "urn:x-suika-fam-cx:css:disc": true,
3184 "urn:x-suika-fam-cx:css:decimal": true,
3185 "urn:x-suika-fam-cx:css:decimal-leading-zero": true,
3186 "urn:x-suika-fam-cx:css:georgian": true,
3187 "urn:x-suika-fam-cx:css:lower-greek": true,
3188 "urn:x-suika-fam-cx:css:lower-latin": true,
3189 "urn:x-suika-fam-cx:css:upper-latin": true,
3190 "urn:x-suika-fam-cx:css:none": true,
3191 "urn:x-suika-fam-cx:css:lower-roman": true,
3192 "urn:x-suika-fam-cx:css:upper-roman": true,
3193 "urn:x-suika-fam-cx:css:square": true
3194 }
3195 });
3196 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:orphans"] =
3197 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
3198 /* Introduced in CSS2 */
3199 inherit: true,
3200 initialValue: new cx.fam.suika.y2005.CSS.Value.NumericValue (2, null, null, null),
3201 validType: {
3202 "tag:manakai@suika.fam.cx,2005-11:integer": true
3203 }
3204 });
3205 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:right"]
3206 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:bottom"];
3207 cx.fam.suika.y2005.CSS.Property.Definition
3208 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.scroller"] =
3209 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3210 /* CSS3 Box model WD editor's note */
3211 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3212 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3213 "manakai", "scrollbar"),
3214 prefix: "manakai",
3215 validKeyword: {
3216 "http://suika.fam.cx/~wakaba/archive/2005/11/css.scrollbar": true,
3217 "http://suika.fam.cx/~wakaba/archive/2005/11/css.invisible": true
3218 }
3219 });
3220 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:top"]
3221 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:bottom"];
3222 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:unicode-bidi"] =
3223 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3224 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3225 ("urn:x-suika-fam-cx:css:", null, "normal"),
3226 validKeyword: {
3227 "urn:x-suika-fam-cx:css:bidi-override": true,
3228 "urn:x-suika-fam-cx:css:embed": true,
3229 "urn:x-suika-fam-cx:css:normal": true
3230 }
3231 });
3232 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:vertical-align"] =
3233 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3234 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3235 ("urn:x-suika-fam-cx:css:", null, "baseline"),
3236 validKeyword: {
3237 "urn:x-suika-fam-cx:css:baseline": true,
3238 "urn:x-suika-fam-cx:css:bottom": true,
3239 "urn:x-suika-fam-cx:css:middle": true,
3240 "urn:x-suika-fam-cx:css:sub": true,
3241 "urn:x-suika-fam-cx:css:super": true,
3242 "urn:x-suika-fam-cx:css:text-bottom": true,
3243 "urn:x-suika-fam-cx:css:text-top": true,
3244 "urn:x-suika-fam-cx:css:top": true
3245 }
3246 });
3247 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:visibility"] =
3248 new cx.fam.suika.y2005.CSS.Property.Definition_Keyword ({
3249 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3250 ("urn:x-suika-fam-cx:css:", null, "visible"),
3251 validKeyword: {
3252 "urn:x-suika-fam-cx:css:collapse": true,
3253 "urn:x-suika-fam-cx:css:hidden": true,
3254 "urn:x-suika-fam-cx:css:visible": true
3255 }
3256 });
3257 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:widows"]
3258 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:orphans"];
3259 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:width"]
3260 = cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:height"];
3261 cx.fam.suika.y2005.CSS.Property.Definition["urn:x-suika-fam-cx:css:z-index"] =
3262 new cx.fam.suika.y2005.CSS.Property.Definition_Length ({
3263 /* Introduced in CSS2 */
3264 initialValue: new cx.fam.suika.y2005.CSS.Value.IdentValue
3265 ("urn:x-suika-fam-cx:css:", null, "auto"),
3266 validKeyword: {
3267 "urn:x-suika-fam-cx:css:auto": true
3268 },
3269 validType: {
3270 "tag:manakai@suika.fam.cx,2005-11:integer": true
3271 }
3272 });
3273
3274 cx.fam.suika.y2005.CSS.Property.Definition
3275 ["http://suika.fam.cx/~wakaba/archive/2005/11/css.props.display"] =
3276 new cx.fam.suika.y2005.CSS.Property.Definition ({
3277 setComputedValue: function (namespaceURI, _1, localName,
3278 parentPropSet, propSet, _3, elementNode) {
3279 var displayVal = propSet.getSpecifiedPropertyValueNS
3280 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3281 "display-role");
3282 var displayURI = displayVal.getExpandedURI ();
3283 if (displayURI == "urn:x-suika-fam-cx:css:none") return;
3284 /* |position| and |float| do not apply */
3285 var positionVal = propSet.getSpecifiedPropertyValueNS
3286 ("urn:x-suika-fam-cx:css:", "position");
3287 switch (positionVal.getExpandedURI ()) {
3288 case "urn:x-suika-fam-cx:css:absolute":
3289 case "urn:x-suika-fam-cx:css:fixed":
3290 propSet.setPropertyValueNS
3291 ("urn:x-suika-fam-cx:css:", null, "float",
3292 new cx.fam.suika.y2005.CSS.Value.IdentValue
3293 ("urn:x-suika-fam-cx:css:", null, "none"));
3294 break;
3295 default:
3296 var floatVal = propSet.getSpecifiedPropertyValueNS
3297 ("urn:x-suika-fam-cx:css:", "float");
3298 if (floatVal.getExpandedURI () == "urn:x-suika-fam-cx:css:none" &&
3299 parentPropSet != null /* not root element */) {
3300 return;
3301 }
3302 break;
3303 }
3304
3305 switch (displayURI) {
3306 case "urn:x-suika-fam-cx:css:inline":
3307 case "urn:x-suika-fam-cx:css:run-in":
3308 propSet.setPropertyValueNS
3309 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3310 "manakai", "display-role",
3311 new cx.fam.suika.y2005.CSS.Value.IdentValue
3312 ("urn:x-suika-fam-cx:css:", null, "block"));
3313 var displayModel = propSet.getSpecifiedPropertyValueNS
3314 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3315 "display-model");
3316 if (displayModel.getExpandedURI ()
3317 == "http://suika.fam.cx/~wakaba/archive/2005/11/css.inline-inside") {
3318 propSet.setPropertyValueNS
3319 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3320 "manakai", "display-model",
3321 new cx.fam.suika.y2005.CSS.Value.IdentValue
3322 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3323 "manakai", "block-inside"));
3324 /*
3325 This rule, inserted for compatibility with CSS 2.1,
3326 prevents the root element's box being |inline-inside| by e.g.
3327 root {
3328 display: inline;
3329 -manakai-display-model: -manakai-inline-inside;
3330 }
3331 and some fix would be required when CSS3 module on visual formatting
3332 is revised.
3333 */
3334 }
3335 break;
3336 //case "urn:x-suika-fam-cx:css:inline-block":
3337 case "urn:x-suika-fam-cx:css:table-row-group":
3338 case "urn:x-suika-fam-cx:css:table-column":
3339 case "urn:x-suika-fam-cx:css:table-column-group":
3340 case "urn:x-suika-fam-cx:css:table-header-group":
3341 case "urn:x-suika-fam-cx:css:table-footer-group":
3342 case "urn:x-suika-fam-cx:css:table-row":
3343 case "urn:x-suika-fam-cx:css:table-cell":
3344 case "urn:x-suika-fam-cx:css:table-caption":
3345 propSet.setPropertyValueNS
3346 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3347 "manakai", "display-role",
3348 new cx.fam.suika.y2005.CSS.Value.IdentValue
3349 ("urn:x-suika-fam-cx:css:", null, "block"));
3350 propSet.setPropertyValueNS
3351 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3352 "manakai", "display-model",
3353 new cx.fam.suika.y2005.CSS.Value.IdentValue
3354 ("http://suika.fam.cx/~wakaba/archive/2005/11/css.",
3355 "manakai", "block-inside"));
3356 break;
3357 /*case "urn:x-suika-fam-cx:css:inline-table":
3358 propSet.setPropertyValueNS
3359 ("urn:x-suika-fam-cx:css:", null, "display",
3360 new cx.fam.suika.y2005.CSS.Value.IdentValue
3361 ("urn:x-suika-fam-cx:css:", null, "table"));
3362 break;*/
3363 }
3364 }
3365 });
3366
3367
3368 /* Revision: $Date: 2005/11/09 09:55:19 $ */
3369
3370 /* ***** BEGIN LICENSE BLOCK *****
3371 * Copyright 2005 Wakaba <w@suika.fam.cx>. All rights reserved.
3372 *
3373 * This program is free software; you can redistribute it and/or
3374 * modify it under the same terms as Perl itself.
3375 *
3376 * Alternatively, the contents of this file may be used
3377 * under the following terms (the "MPL/GPL/LGPL"),
3378 * in which case the provisions of the MPL/GPL/LGPL are applicable instead
3379 * of those above. If you wish to allow use of your version of this file only
3380 * under the terms of the MPL/GPL/LGPL, and not to allow others to
3381 * use your version of this file under the terms of the Perl, indicate your
3382 * decision by deleting the provisions above and replace them with the notice
3383 * and other provisions required by the MPL/GPL/LGPL. If you do not delete
3384 * the provisions above, a recipient may use your version of this file under
3385 * the terms of any one of the Perl or the MPL/GPL/LGPL.
3386 *
3387 * "MPL/GPL/LGPL":
3388 *
3389 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3390 *
3391 * The contents of this file are subject to the Mozilla Public License Version
3392 * 1.1 (the "License"); you may not use this file except in compliance with
3393 * the License. You may obtain a copy of the License at
3394 * <http://www.mozilla.org/MPL/>
3395 *
3396 * Software distributed under the License is distributed on an "AS IS" basis,
3397 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
3398 * for the specific language governing rights and limitations under the
3399 * License.
3400 *
3401 * The Original Code is BIDOM code.
3402 *
3403 * The Initial Developer of the Original Code is Wakaba.
3404 * Portions created by the Initial Developer are Copyright (C) 2005
3405 * the Initial Developer. All Rights Reserved.
3406 *
3407 * Contributor(s):
3408 * Wakaba <w@suika.fam.cx>
3409 *
3410 * Alternatively, the contents of this file may be used under the terms of
3411 * either the GNU General Public License Version 2 or later (the "GPL"), or
3412 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
3413 * in which case the provisions of the GPL or the LGPL are applicable instead
3414 * of those above. If you wish to allow use of your version of this file only
3415 * under the terms of either the GPL or the LGPL, and not to allow others to
3416 * use your version of this file under the terms of the MPL, indicate your
3417 * decision by deleting the provisions above and replace them with the notice
3418 * and other provisions required by the LGPL or the GPL. If you do not delete
3419 * the provisions above, a recipient may use your version of this file under
3420 * the terms of any one of the MPL, the GPL or the LGPL.
3421 *
3422 * ***** END LICENSE BLOCK ***** */

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24