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 : CSSGroupingRule {
13 attribute UTF8String selectorText;
14 [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
16 [ChromeOnly] readonly attribute unsigned long selectorCount;
17 [ChromeOnly] UTF8String selectorTextAt(unsigned long index, optional boolean desugared = false);
18 [ChromeOnly] unsigned long long selectorSpecificityAt(unsigned long index, optional boolean desugared = false);
19 [ChromeOnly] boolean selectorMatchesElement(
20 unsigned long selectorIndex,
22 optional [LegacyNullToEmptyString] DOMString pseudo = "",
23 optional boolean includeVisitedStyle = false);
24 [ChromeOnly] sequence<SelectorWarning> getSelectorWarnings();
25 // Get elements on the page matching the rule's selectors. This is helpful for DevTools
26 // so we can avoid computing a desugared selector, which can be very expensive on deeply
28 [ChromeOnly] NodeList querySelectorAll(Node root);
31 enum SelectorWarningKind {
35 dictionary SelectorWarning {
36 required unsigned long index;
37 required SelectorWarningKind kind;