CSSStyleSheet.idl 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #import <CSS/CSSRule.idl>
  2. #import <CSS/CSSRuleList.idl>
  3. #import <CSS/MediaList.idl>
  4. #import <CSS/StyleSheet.idl>
  5. // https://drafts.csswg.org/cssom/#cssstylesheet
  6. [Exposed=Window]
  7. interface CSSStyleSheet : StyleSheet {
  8. constructor(optional CSSStyleSheetInit options = {});
  9. readonly attribute CSSRule? ownerRule;
  10. [SameObject] readonly attribute CSSRuleList cssRules;
  11. unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
  12. undefined deleteRule(unsigned long index);
  13. Promise<CSSStyleSheet> replace(USVString text);
  14. undefined replaceSync(USVString text);
  15. // https://drafts.csswg.org/cssom/#legacy-css-style-sheet-members
  16. [SameObject, ImplementedAs=css_rules] readonly attribute CSSRuleList rules;
  17. long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
  18. undefined removeRule(optional unsigned long index);
  19. };
  20. dictionary CSSStyleSheetInit {
  21. DOMString baseURL = null;
  22. (MediaList or DOMString) media = "";
  23. boolean disabled = false;
  24. };