|
1 | 1 | unit module CSS::Grammar::Defs;
|
2 | 2 |
|
3 |
| - # These tables map AST types to standard W3C component definitions. |
| 3 | +# These tables map AST types to standard W3C component definitions. |
4 | 4 |
|
5 |
| - # CSS object definitions based on http://dev.w3.org/csswg/cssom/ |
6 |
| - # for example 6.4.1 CSSRuleList maps to CSSObject::RuleList |
7 |
| - our Str enum CSSObject is export(:CSSObject) « |
8 |
| - :AtRule<at-rule> |
9 |
| - :Priority<prio> |
10 |
| - :RuleSet<ruleset> |
11 |
| - :RuleList<rule-list> |
12 |
| - :StyleDeclaration<style> |
13 |
| - :StyleRule<style-rule> |
14 |
| - :StyleSheet<stylesheet> |
15 |
| - »; |
| 5 | +# CSS object definitions based on http://dev.w3.org/csswg/cssom/ |
| 6 | +# for example 6.4.1 CSSRuleList maps to CSSObject::RuleList |
| 7 | +our Str enum CSSObject is export(:CSSObject) « |
| 8 | + :AtRule<at-rule> |
| 9 | + :Priority<prio> |
| 10 | + :RuleSet<ruleset> |
| 11 | + :RuleList<rule-list> |
| 12 | + :StyleDeclaration<style> |
| 13 | + :StyleRule<style-rule> |
| 14 | + :StyleSheet<stylesheet> |
| 15 | + »; |
16 | 16 |
|
17 |
| - # CSS value types based on http://dev.w3.org/csswg/cssom-values/ |
18 |
| - # for example 3.3 CSSStyleDeclarationValue maps to CSSValue::StyleDeclaration |
19 |
| - our Str enum CSSValue is export(:CSSValue) « |
20 |
| - :ColorComponent<color> |
21 |
| - :Component<value> |
22 |
| - :IdentifierComponent<ident> |
23 |
| - :KeywordComponent<keyw> |
24 |
| - :LengthComponent<length> |
25 |
| - :Map<map> |
26 |
| - :PercentageComponent<percent> |
27 |
| - :Property<property> |
28 |
| - :PropertyList<declarations> |
29 |
| - :StringComponent<string> |
30 |
| - :URLComponent<url> |
| 17 | +# CSS value types based on http://dev.w3.org/csswg/cssom-values/ |
| 18 | +# for example 3.3 CSSStyleDeclarationValue maps to CSSValue::StyleDeclaration |
| 19 | +our Str enum CSSValue is export(:CSSValue) « |
| 20 | + :ColorComponent<color> |
| 21 | + :Component<value> |
| 22 | + :IdentifierComponent<ident> |
| 23 | + :KeywordComponent<keyw> |
| 24 | + :LengthComponent<length> |
| 25 | + :Map<map> |
| 26 | + :PercentageComponent<percent> |
| 27 | + :Property<property> |
| 28 | + :PropertyList<declarations> |
| 29 | + :StringComponent<string> |
| 30 | + :URLComponent<url> |
31 | 31 |
|
32 |
| - :NameComponent<name> |
33 |
| - :NumberComponent<num> |
34 |
| - :IntegerComponent<int> |
35 |
| - :AngleComponent<angle> |
36 |
| - :FrequencyComponent<freq> |
37 |
| - :FunctionComponent<func> |
38 |
| - :ResolutionComponent<resolution> |
39 |
| - :TimeComponent<time> |
40 |
| - :QnameComponent<qname> |
41 |
| - :OtherUnitComponent<units> |
42 |
| - :NamespacePrefixComponent<ns-prefix> |
43 |
| - :ElementNameComponent<element-name> |
44 |
| - :OperatorComponent<op> |
45 |
| - :ExpressionComponent<expr> |
46 |
| - :ArgumentListComponent<args> |
47 |
| - :AtKeywordComponent<at-keyw> |
48 |
| - :UnicodeRangeComponent<unicode-range> |
49 |
| - »; |
| 32 | + :NameComponent<name> |
| 33 | + :NumberComponent<num> |
| 34 | + :IntegerComponent<int> |
| 35 | + :AngleComponent<angle> |
| 36 | + :FrequencyComponent<freq> |
| 37 | + :FunctionComponent<func> |
| 38 | + :ResolutionComponent<resolution> |
| 39 | + :TimeComponent<time> |
| 40 | + :QnameComponent<qname> |
| 41 | + :OtherUnitComponent<units> |
| 42 | + :NamespacePrefixComponent<ns-prefix> |
| 43 | + :ElementNameComponent<element-name> |
| 44 | + :OperatorComponent<op> |
| 45 | + :ExpressionComponent<expr> |
| 46 | + :ArgumentListComponent<args> |
| 47 | + :AtKeywordComponent<at-keyw> |
| 48 | + :UnicodeRangeComponent<unicode-range> |
| 49 | +»; |
50 | 50 |
|
51 |
| - our Str enum CSSSelector is export(:CSSSelector) « |
52 |
| - :AttributeSelector<attrib> |
53 |
| - :Class<class> |
54 |
| - :Id<id> |
55 |
| - :MediaList<media-list> |
56 |
| - :MediaQuery<media-query> |
57 |
| - :PseudoClass<pseudo-class> |
58 |
| - :PseudoElement<pseudo-elem> |
59 |
| - :PseudoFunction<pseudo-func> |
60 |
| - :SelectorList<selectors> |
61 |
| - :Selector<selector> |
62 |
| - :SelectorComponent<simple-selector> |
63 |
| - »; |
| 51 | +our Str enum CSSSelector is export(:CSSSelector) « |
| 52 | + :AttributeSelector<attrib> |
| 53 | + :Class<class> |
| 54 | + :Id<id> |
| 55 | + :MediaList<media-list> |
| 56 | + :MediaQuery<media-query> |
| 57 | + :PseudoClass<pseudo-class> |
| 58 | + :PseudoElement<pseudo-elem> |
| 59 | + :PseudoFunction<pseudo-func> |
| 60 | + :SelectorList<selectors> |
| 61 | + :Selector<selector> |
| 62 | + :SelectorComponent<simple-selector> |
| 63 | +»; |
64 | 64 |
|
65 |
| - # an enumerated list of all unit types for validation purposes. |
66 |
| - # Adapted from the out-of-date http://www.w3.org/TR/DOM-Level-2-Style/css.html |
| 65 | +# an enumerated list of all unit types for validation purposes. |
| 66 | +# Adapted from the out-of-date http://www.w3.org/TR/DOM-Level-2-Style/css.html |
67 | 67 |
|
68 |
| - our Str enum CSSUnits is export(:CSSUnits) « |
69 |
| - :ems<length> :exs<length> :px<length> :cm<length> :mm<length> :in<length> :pt<length> :pc<length> |
70 |
| - :em<length> :ex<length> :rem<length> :ch<length> :vw<length> :vh<length> :vmin<length> :vmax<length> |
71 |
| - :dpi<resolution> :dpcm<resolution> :dppx<resolution> |
72 |
| - :deg<angle> :rad<angle> :grad<angle> :turn<angle> |
73 |
| - :ms<time> :s<time> |
74 |
| - :hz<freq> :khz<freq> |
75 |
| - :rgb<color> :rgba<color> :hsl<color> :hsla<color> |
76 |
| - »; |
| 68 | +our Str enum CSSUnits is export(:CSSUnits) « |
| 69 | + :ems<length> :exs<length> :px<length> :cm<length> :mm<length> :in<length> :pt<length> :pc<length> |
| 70 | + :em<length> :ex<length> :rem<length> :ch<length> :vw<length> :vh<length> :vmin<length> :vmax<length> |
| 71 | + :dpi<resolution> :dpcm<resolution> :dppx<resolution> |
| 72 | + :deg<angle> :rad<angle> :grad<angle> :turn<angle> |
| 73 | + :ms<time> :s<time> |
| 74 | + :hz<freq> :khz<freq> |
| 75 | + :rgb<color> :rgba<color> :hsl<color> :hsla<color> |
| 76 | +»; |
77 | 77 |
|
78 |
| - # from http://dev.w3.org/csswg/cssom-view/ |
79 |
| - our Str enum CSSTrait is export(:CSSTrait) «:Box<box>»; |
| 78 | +# from http://dev.w3.org/csswg/cssom-view/ |
| 79 | +our Str enum CSSTrait is export(:CSSTrait) «:Box<box>»; |
80 | 80 |
|
0 commit comments