This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
spec:at-rules-patterns [2012/09/13 13:07] – [At-Rules Patterns] Make the numbered list work tabatkins | spec:at-rules-patterns [2012/09/13 13:44] – [CSSOM] Rewrite with examples, fix an error. tabatkins | ||
---|---|---|---|
Line 33: | Line 33: | ||
===== CSSOM ===== | ===== CSSOM ===== | ||
- | All new at-rules need to add a few things to the CSSOM: | + | When creating a new at-rule, you need to add some CSSOM stuff as well: |
- | For category 1 rules, the interface | + | **A new constant** (coordinated at the [[CSSOM Constants]] page), added to the CSSRule |
- | For category 2 rules, the interface | + | partial |
+ | const unsigned short FOO_RULE = [number]; | ||
+ | }; | ||
- | For category 3 and 4 rules, the interface | + | **A new interface:** |
- | There is no need to define | + | For category 1 rules, |
- | If you don't understand how to write WebIDL for the interfaces, just ask. | + | interface CSSImportRule : CSSRule { |
+ | readonly attribute DOMString href; | ||
+ | readonly attribute MediaList media; | ||
+ | readonly attribute CSSStyleSheet styleSheet; | ||
+ | }; | ||
+ | For category 2 rules, the interface should inherit from CSSGroupingRule, | ||
+ | |||
+ | interface CSSMediaRule : CSSConditionRule { | ||
+ | readonly attribute MediaList media; | ||
+ | } | ||
+ | |||
+ | (CSSConditionRule inherits from CSSGroupingRule, | ||
+ | |||
+ | For category 3 and 4 rules, the interface should expose attributes for all the descriptors, | ||
+ | |||
+ | interface CSSCounterStyleRule : CSSRule { | ||
+ | readonly attribute DOMString name; | ||
+ | readonly attribute DOMString type; | ||
+ | readonly attribute DOMString symbols; | ||
+ | readonly attribute DOMString additiveSymbols; | ||
+ | readonly attribute DOMString negative; | ||
+ | readonly attribute DOMString prefix; | ||
+ | readonly attribute DOMString suffix; | ||
+ | readonly attribute DOMString range; | ||
+ | readonly attribute DOMString fallback; | ||
+ | } | ||
+ | |||
+ | If you don't understand how to write WebIDL for the interfaces, just ask. | ||
===== Grammar ===== | ===== Grammar ===== | ||
TODO | TODO |