1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * http://dev.w3.org/csswg/cssom/
8 * https://wicg.github.io/construct-stylesheets/
11 enum CSSStyleSheetParsingMode {
17 dictionary CSSStyleSheetInit {
18 (MediaList or UTF8String) media = "";
19 boolean disabled = false;
24 interface CSSStyleSheet : StyleSheet {
26 constructor(optional CSSStyleSheetInit options = {});
27 [Pure, BinaryName="DOMOwnerRule"]
28 readonly attribute CSSRule? ownerRule;
29 [Throws, NeedsSubjectPrincipal]
30 readonly attribute CSSRuleList cssRules;
31 [ChromeOnly, BinaryName="parsingModeDOM"]
32 readonly attribute CSSStyleSheetParsingMode parsingMode;
33 [Throws, NeedsSubjectPrincipal]
34 unsigned long insertRule(UTF8String rule, optional unsigned long index = 0);
35 [Throws, NeedsSubjectPrincipal]
36 undefined deleteRule(unsigned long index);
38 Promise<CSSStyleSheet> replace(UTF8String text);
40 undefined replaceSync(UTF8String text);
42 // Non-standard WebKit things.
43 [Throws, NeedsSubjectPrincipal, BinaryName="cssRules"]
44 readonly attribute CSSRuleList rules;
45 [Throws, NeedsSubjectPrincipal, BinaryName="deleteRule"]
46 undefined removeRule(optional unsigned long index = 0);
47 [Throws, NeedsSubjectPrincipal]
48 long addRule(optional UTF8String selector = "undefined", optional UTF8String style = "undefined", optional unsigned long index);