2018-09-13 20:04:55 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2017-01-13 15:41:03 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* https://drafts.csswg.org/cssom/#the-cssstylerule-interface
|
|
|
|
*/
|
|
|
|
|
|
|
|
// https://drafts.csswg.org/cssom/#the-cssstylerule-interface
|
2019-09-27 15:26:14 +00:00
|
|
|
[Exposed=Window]
|
2023-08-01 09:01:54 +00:00
|
|
|
interface CSSStyleRule : CSSGroupingRule {
|
2020-12-17 14:04:35 +00:00
|
|
|
attribute UTF8String selectorText;
|
2017-01-13 15:41:03 +00:00
|
|
|
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
|
2023-06-14 09:36:22 +00:00
|
|
|
|
2023-06-21 07:14:57 +00:00
|
|
|
[ChromeOnly] readonly attribute unsigned long selectorCount;
|
|
|
|
[ChromeOnly] UTF8String selectorTextAt(unsigned long index, optional boolean desugared = false);
|
|
|
|
[ChromeOnly] unsigned long long selectorSpecificityAt(unsigned long index, optional boolean desugared = false);
|
|
|
|
[ChromeOnly] boolean selectorMatchesElement(
|
|
|
|
unsigned long selectorIndex,
|
|
|
|
Element element,
|
|
|
|
optional [LegacyNullToEmptyString] DOMString pseudo = "",
|
|
|
|
optional boolean includeVisitedStyle = false);
|
2023-11-02 15:29:12 +00:00
|
|
|
[ChromeOnly] sequence<SelectorWarning> getSelectorWarnings();
|
2024-04-29 06:43:23 +00:00
|
|
|
// Get elements on the page matching the rule's selectors. This is helpful for DevTools
|
|
|
|
// so we can avoid computing a desugared selector, which can be very expensive on deeply
|
|
|
|
// nested rules.
|
|
|
|
[ChromeOnly] NodeList querySelectorAll(Node root);
|
2023-11-02 15:29:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum SelectorWarningKind {
|
|
|
|
"UnconstrainedHas",
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary SelectorWarning {
|
|
|
|
required unsigned long index;
|
|
|
|
required SelectorWarningKind kind;
|
2017-01-13 15:41:03 +00:00
|
|
|
};
|