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 * https://drafts.csswg.org/cssom/#the-cssstylerule-interface
10 // https://drafts.csswg.org/cssom/#the-cssstylerule-interface
12 interface CSSStyleRule : CSSRule {
13 attribute UTF8String selectorText;
14 [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
16 // https://drafts.csswg.org/css-nesting/#cssom-style
17 // FIXME: Ideally CSSStyleRule should inherit from CSSGroupingRule instead,
18 // see https://github.com/w3c/csswg-drafts/issues/8940
19 [Pref="layout.css.nesting.enabled", SameObject] readonly attribute CSSRuleList cssRules;
20 [Pref="layout.css.nesting.enabled", Throws] unsigned long insertRule(UTF8String rule, optional unsigned long index = 0);
21 [Pref="layout.css.nesting.enabled", Throws] undefined deleteRule(unsigned long index);
23 [ChromeOnly] readonly attribute unsigned long selectorCount;
24 [ChromeOnly] UTF8String selectorTextAt(unsigned long index, optional boolean desugared = false);
25 [ChromeOnly] unsigned long long selectorSpecificityAt(unsigned long index, optional boolean desugared = false);
26 [ChromeOnly] boolean selectorMatchesElement(
27 unsigned long selectorIndex,
29 optional [LegacyNullToEmptyString] DOMString pseudo = "",
30 optional boolean includeVisitedStyle = false);