Bug 1945643 - Update to mozilla-nimbus-schemas 2025.1.1 r=chumphreys
[gecko.git] / dom / webidl / CSSStyleRule.webidl
blobc48e7f79fac7bb2b6b256b6f8328494fdb8a8c77
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/.
5  *
6  * The origin of this IDL file is
7  * https://drafts.csswg.org/cssom/#the-cssstylerule-interface
8  */
10 // https://drafts.csswg.org/cssom/#the-cssstylerule-interface
11 [Exposed=Window]
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,
21     Element element,
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
27   // nested rules.
28   [ChromeOnly] NodeList querySelectorAll(Node root);
31 enum SelectorWarningKind {
32   "UnconstrainedHas",
35 dictionary SelectorWarning {
36   required unsigned long index;
37   required SelectorWarningKind kind;