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:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/chrome-webidl/InspectorUtils.webidl
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/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 {