summaryrefslogtreecommitdiffstats
path: root/dom/chrome-webidl/InspectorUtils.webidl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/chrome-webidl/InspectorUtils.webidl
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/chrome-webidl/InspectorUtils.webidl')
-rw-r--r--dom/chrome-webidl/InspectorUtils.webidl36
1 files changed, 32 insertions, 4 deletions
diff --git a/dom/chrome-webidl/InspectorUtils.webidl b/dom/chrome-webidl/InspectorUtils.webidl
index e3ca8a3b51..64cd610804 100644
--- a/dom/chrome-webidl/InspectorUtils.webidl
+++ b/dom/chrome-webidl/InspectorUtils.webidl
@@ -23,16 +23,17 @@ namespace InspectorUtils {
unsigned long getRelativeRuleLine(CSSRule rule);
sequence<unsigned long> getRuleIndex(CSSRule rule);
boolean hasRulesModifiedByCSSOM(CSSStyleSheet sheet);
- // Get a flat list of all rules (including nested ones) of a given stylesheet.
- // Useful for DevTools as this is faster than in JS where we'd have a lot of
- // proxy access overhead building the same list.
- sequence<CSSRule> getAllStyleSheetCSSStyleRules(CSSStyleSheet sheet);
+ // Get a flat list of specific at-rules (including nested ones) of a given stylesheet.
+ // Useful for DevTools (StyleEditor at-rules sidebar) as this is faster than in JS
+ // where we'd have a lot of proxy access overhead building the same list.
+ InspectorStyleSheetRuleCountAndAtRulesResult getStyleSheetRuleCountAndAtRules(CSSStyleSheet sheet);
boolean isInheritedProperty(Document document, UTF8String property);
sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options = {});
sequence<PropertyPref> getCSSPropertyPrefs();
[Throws] sequence<DOMString> getCSSValuesForProperty(UTF8String property);
UTF8String rgbToColorName(octet r, octet g, octet b);
InspectorRGBATuple? colorToRGBA(UTF8String colorString, optional Document? doc = null);
+ InspectorColorToResult? colorTo(UTF8String fromColor, UTF8String toColorSpace);
boolean isValidCSSColor(UTF8String colorString);
[Throws] sequence<DOMString> getSubpropertiesForCSSProperty(UTF8String property);
[Throws] boolean cssPropertyIsShorthand(UTF8String property);
@@ -87,6 +88,17 @@ namespace InspectorUtils {
[NewObject] NodeList getOverflowingChildrenOfElement(Element element);
sequence<DOMString> getRegisteredCssHighlights(Document document, optional boolean activeOnly = false);
sequence<InspectorCSSPropertyDefinition> getCSSRegisteredProperties(Document document);
+
+ // Get the start and end offsets of the first rule body within initialText
+ // Consider the following example:
+ // p {
+ // line-height: 2em;
+ // color: blue;
+ // }
+ // Calling the function with the whole text above would return offsets we can use to
+ // get "line-height: 2em; color: blue;"
+ // Returns null when opening curly bracket wasn't found in initialText
+ InspectorGetRuleBodyTextResult? getRuleBodyTextOffsets(UTF8String initialText);
};
dictionary SupportsOptions {
@@ -119,6 +131,12 @@ dictionary InspectorRGBATuple {
double a = 1;
};
+dictionary InspectorColorToResult {
+ required DOMString color;
+ required sequence<float> components;
+ required boolean adjusted;
+};
+
// Any update to this enum should probably also update
// devtools/shared/css/constants.js
enum InspectorPropertyType {
@@ -159,6 +177,16 @@ dictionary InspectorCSSPropertyDefinition {
required boolean fromJS;
};
+dictionary InspectorGetRuleBodyTextResult {
+ required double startOffset;
+ required double endOffset;
+};
+
+dictionary InspectorStyleSheetRuleCountAndAtRulesResult {
+ required sequence<CSSRule> atRules;
+ required unsigned long ruleCount;
+};
+
[Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled",
Exposed=Window]
interface InspectorFontFace {