cdp_driver/methods/css.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! This domain exposes CSS read/write operations. All CSS objects
5//! (stylesheets, rules, and styles) have an associated `id` used in
6//! subsequent operations on the related object. Each object type has a
7//! specific `id` structure, and those are not interchangeable between objects
8//! of different kinds. CSS objects can be loaded using the `get*ForNode()`
9//! calls (which accept a DOM node id). A client can also keep track of
10//! stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and
11//! subsequently load the required stylesheet contents using the
12//! `getStyleSheet\[Text\]()` methods.
13//!
14//! Method names for the `CSS` domain, for use with
15//! [`CdpClient::call`](crate::CdpClient::call).
16//!
17//! This domain is experimental and may change without notice.
18
19/// Inserts a new rule with the given `ruleText` in a stylesheet with given
20/// `styleSheetId`, at the position specified by `location`.
21///
22/// Parameters:
23/// - `styleSheetId`: DOM.StyleSheetId
24/// - `ruleText`: string
25/// - `location`: SourceRange
26/// - `nodeForPropertySyntaxValidation`: DOM.NodeId (optional)
27///
28/// Returns: `rule`
29pub const ADD_RULE: &str = "CSS.addRule";
30
31/// Returns all class names from specified stylesheet.
32///
33/// Parameters:
34/// - `styleSheetId`: DOM.StyleSheetId
35///
36/// Returns: `classNames`
37pub const COLLECT_CLASS_NAMES: &str = "CSS.collectClassNames";
38
39/// Creates a new special "via-inspector" stylesheet in the frame with given
40/// `frameId`.
41///
42/// Parameters:
43/// - `frameId`: Page.FrameId
44/// - `force`: boolean (optional)
45///
46/// Returns: `styleSheetId`
47pub const CREATE_STYLE_SHEET: &str = "CSS.createStyleSheet";
48
49/// Disables the CSS agent for the given page.
50pub const DISABLE: &str = "CSS.disable";
51
52/// Enables the CSS agent for the given page. Clients should not assume that
53/// the CSS agent has been enabled until the result of this command is
54/// received.
55pub const ENABLE: &str = "CSS.enable";
56
57/// Ensures that the given node will have specified pseudo-classes whenever
58/// its style is computed by the browser.
59///
60/// Parameters:
61/// - `nodeId`: DOM.NodeId
62/// - `forcedPseudoClasses`: array
63pub const FORCE_PSEUDO_STATE: &str = "CSS.forcePseudoState";
64
65/// Ensures that the given node is in its starting-style state.
66///
67/// Parameters:
68/// - `nodeId`: DOM.NodeId
69/// - `forced`: boolean
70pub const FORCE_STARTING_STYLE: &str = "CSS.forceStartingStyle";
71
72/// `CSS.getBackgroundColors`
73///
74/// Parameters:
75/// - `nodeId`: DOM.NodeId
76///
77/// Returns: `backgroundColors`, `computedFontSize`, `computedFontWeight`
78pub const GET_BACKGROUND_COLORS: &str = "CSS.getBackgroundColors";
79
80/// Returns the computed style for a DOM node identified by `nodeId`.
81///
82/// Parameters:
83/// - `nodeId`: DOM.NodeId
84///
85/// Returns: `computedStyle`, `extraFields`
86pub const GET_COMPUTED_STYLE_FOR_NODE: &str = "CSS.getComputedStyleForNode";
87
88/// Resolve the specified values in the context of the provided element. For
89/// example, a value of '1em' is evaluated according to the computed
90/// 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved
91/// to '3px'. If the `propertyName` was specified the `values` are resolved as
92/// if they were property's declaration. If a value cannot be parsed according
93/// to the provided property syntax, the value is parsed using combined syntax
94/// as if null `propertyName` was provided. If the value cannot be resolved
95/// even then, return the provided value without any changes. Note: this
96/// function currently does not resolve CSS random() function, it returns
97/// unmodified random() function parts.`
98///
99/// Experimental: may change without notice.
100///
101/// Parameters:
102/// - `values`: array
103/// - `nodeId`: DOM.NodeId
104/// - `propertyName`: string (optional)
105/// - `pseudoType`: DOM.PseudoType (optional)
106/// - `pseudoIdentifier`: string (optional)
107///
108/// Returns: `results`
109pub const RESOLVE_VALUES: &str = "CSS.resolveValues";
110
111/// `CSS.getLonghandProperties`
112///
113/// Experimental: may change without notice.
114///
115/// Parameters:
116/// - `shorthandName`: string
117/// - `value`: string
118///
119/// Returns: `longhandProperties`
120pub const GET_LONGHAND_PROPERTIES: &str = "CSS.getLonghandProperties";
121
122/// Returns the styles defined inline (explicitly in the "style" attribute and
123/// implicitly, using DOM attributes) for a DOM node identified by `nodeId`.
124///
125/// Parameters:
126/// - `nodeId`: DOM.NodeId
127///
128/// Returns: `inlineStyle`, `attributesStyle`
129pub const GET_INLINE_STYLES_FOR_NODE: &str = "CSS.getInlineStylesForNode";
130
131/// Returns the styles coming from animations & transitions including the
132/// animation & transition styles coming from inheritance chain.
133///
134/// Experimental: may change without notice.
135///
136/// Parameters:
137/// - `nodeId`: DOM.NodeId
138///
139/// Returns: `animationStyles`, `transitionsStyle`, `inherited`
140pub const GET_ANIMATED_STYLES_FOR_NODE: &str = "CSS.getAnimatedStylesForNode";
141
142/// Returns requested styles for a DOM node identified by `nodeId`.
143///
144/// Parameters:
145/// - `nodeId`: DOM.NodeId
146///
147/// Returns: `inlineStyle`, `attributesStyle`, `matchedCSSRules`, `pseudoElements`, `inherited`, `inheritedPseudoElements`, `cssKeyframesRules`, `cssPositionTryRules`, `activePositionFallbackIndex`, `cssPropertyRules`, `cssPropertyRegistrations`, `cssAtRules`, `parentLayoutNodeId`, `cssFunctionRules`
148pub const GET_MATCHED_STYLES_FOR_NODE: &str = "CSS.getMatchedStylesForNode";
149
150/// Returns the values of the default UA-defined environment variables used in
151/// env()
152///
153/// Experimental: may change without notice.
154///
155/// Returns: `environmentVariables`
156pub const GET_ENVIRONMENT_VARIABLES: &str = "CSS.getEnvironmentVariables";
157
158/// Returns all media queries parsed by the rendering engine.
159///
160/// Returns: `medias`
161pub const GET_MEDIA_QUERIES: &str = "CSS.getMediaQueries";
162
163/// Requests information about platform fonts which we used to render child
164/// TextNodes in the given node.
165///
166/// Parameters:
167/// - `nodeId`: DOM.NodeId
168///
169/// Returns: `fonts`
170pub const GET_PLATFORM_FONTS_FOR_NODE: &str = "CSS.getPlatformFontsForNode";
171
172/// Returns the current textual content for a stylesheet.
173///
174/// Parameters:
175/// - `styleSheetId`: DOM.StyleSheetId
176///
177/// Returns: `text`
178pub const GET_STYLE_SHEET_TEXT: &str = "CSS.getStyleSheetText";
179
180/// Returns all layers parsed by the rendering engine for the tree scope of a
181/// node. Given a DOM element identified by nodeId, getLayersForNode returns
182/// the root layer for the nearest ancestor document or shadow root. The layer
183/// root contains the full layer tree for the tree scope and their ordering.
184///
185/// Experimental: may change without notice.
186///
187/// Parameters:
188/// - `nodeId`: DOM.NodeId
189///
190/// Returns: `rootLayer`
191pub const GET_LAYERS_FOR_NODE: &str = "CSS.getLayersForNode";
192
193/// Given a CSS selector text and a style sheet ID, getLocationForSelector
194/// returns an array of locations of the CSS selector in the style sheet.
195///
196/// Experimental: may change without notice.
197///
198/// Parameters:
199/// - `styleSheetId`: DOM.StyleSheetId
200/// - `selectorText`: string
201///
202/// Returns: `ranges`
203pub const GET_LOCATION_FOR_SELECTOR: &str = "CSS.getLocationForSelector";
204
205/// Starts tracking the given node for the computed style updates and whenever
206/// the computed style is updated for node, it queues a `computedStyleUpdated`
207/// event with throttling. There can only be 1 node tracked for computed style
208/// updates so passing a new node id removes tracking from the previous node.
209/// Pass `undefined` to disable tracking.
210///
211/// Experimental: may change without notice.
212///
213/// Parameters:
214/// - `nodeId`: DOM.NodeId (optional)
215pub const TRACK_COMPUTED_STYLE_UPDATES_FOR_NODE: &str = "CSS.trackComputedStyleUpdatesForNode";
216
217/// Starts tracking the given computed styles for updates. The specified array
218/// of properties replaces the one previously specified. Pass empty array to
219/// disable tracking. Use takeComputedStyleUpdates to retrieve the list of
220/// nodes that had properties modified. The changes to computed style
221/// properties are only tracked for nodes pushed to the front-end by the DOM
222/// agent. If no changes to the tracked properties occur after the node has
223/// been pushed to the front-end, no updates will be issued for the node.
224///
225/// Experimental: may change without notice.
226///
227/// Parameters:
228/// - `propertiesToTrack`: array
229pub const TRACK_COMPUTED_STYLE_UPDATES: &str = "CSS.trackComputedStyleUpdates";
230
231/// Polls the next batch of computed style updates.
232///
233/// Experimental: may change without notice.
234///
235/// Returns: `nodeIds`
236pub const TAKE_COMPUTED_STYLE_UPDATES: &str = "CSS.takeComputedStyleUpdates";
237
238/// Find a rule with the given active property for the given node and set the
239/// new value for this property
240///
241/// Parameters:
242/// - `nodeId`: DOM.NodeId
243/// - `propertyName`: string
244/// - `value`: string
245pub const SET_EFFECTIVE_PROPERTY_VALUE_FOR_NODE: &str = "CSS.setEffectivePropertyValueForNode";
246
247/// Modifies the property rule property name.
248///
249/// Parameters:
250/// - `styleSheetId`: DOM.StyleSheetId
251/// - `range`: SourceRange
252/// - `propertyName`: string
253///
254/// Returns: `propertyName`
255pub const SET_PROPERTY_RULE_PROPERTY_NAME: &str = "CSS.setPropertyRulePropertyName";
256
257/// Modifies the keyframe rule key text.
258///
259/// Parameters:
260/// - `styleSheetId`: DOM.StyleSheetId
261/// - `range`: SourceRange
262/// - `keyText`: string
263///
264/// Returns: `keyText`
265pub const SET_KEYFRAME_KEY: &str = "CSS.setKeyframeKey";
266
267/// Modifies the rule selector.
268///
269/// Parameters:
270/// - `styleSheetId`: DOM.StyleSheetId
271/// - `range`: SourceRange
272/// - `text`: string
273///
274/// Returns: `media`
275pub const SET_MEDIA_TEXT: &str = "CSS.setMediaText";
276
277/// Modifies the expression of a container query. Deprecated. Use
278/// setContainerQueryConditionText instead.
279///
280/// Deprecated in the protocol.
281/// Experimental: may change without notice.
282///
283/// Parameters:
284/// - `styleSheetId`: DOM.StyleSheetId
285/// - `range`: SourceRange
286/// - `text`: string
287///
288/// Returns: `containerQuery`
289pub const SET_CONTAINER_QUERY_TEXT: &str = "CSS.setContainerQueryText";
290
291/// `CSS.setContainerQueryConditionText`
292///
293/// Experimental: may change without notice.
294///
295/// Parameters:
296/// - `styleSheetId`: DOM.StyleSheetId
297/// - `range`: SourceRange
298/// - `text`: string
299///
300/// Returns: `containerQuery`
301pub const SET_CONTAINER_QUERY_CONDITION_TEXT: &str = "CSS.setContainerQueryConditionText";
302
303/// Modifies the expression of a supports at-rule.
304///
305/// Experimental: may change without notice.
306///
307/// Parameters:
308/// - `styleSheetId`: DOM.StyleSheetId
309/// - `range`: SourceRange
310/// - `text`: string
311///
312/// Returns: `supports`
313pub const SET_SUPPORTS_TEXT: &str = "CSS.setSupportsText";
314
315/// Modifies the expression of a navigation at-rule.
316///
317/// Experimental: may change without notice.
318///
319/// Parameters:
320/// - `styleSheetId`: DOM.StyleSheetId
321/// - `range`: SourceRange
322/// - `text`: string
323///
324/// Returns: `navigation`
325pub const SET_NAVIGATION_TEXT: &str = "CSS.setNavigationText";
326
327/// Modifies the expression of a scope at-rule.
328///
329/// Experimental: may change without notice.
330///
331/// Parameters:
332/// - `styleSheetId`: DOM.StyleSheetId
333/// - `range`: SourceRange
334/// - `text`: string
335///
336/// Returns: `scope`
337pub const SET_SCOPE_TEXT: &str = "CSS.setScopeText";
338
339/// Modifies the rule selector.
340///
341/// Parameters:
342/// - `styleSheetId`: DOM.StyleSheetId
343/// - `range`: SourceRange
344/// - `selector`: string
345///
346/// Returns: `selectorList`
347pub const SET_RULE_SELECTOR: &str = "CSS.setRuleSelector";
348
349/// Sets the new stylesheet text.
350///
351/// Parameters:
352/// - `styleSheetId`: DOM.StyleSheetId
353/// - `text`: string
354///
355/// Returns: `sourceMapURL`
356pub const SET_STYLE_SHEET_TEXT: &str = "CSS.setStyleSheetText";
357
358/// Applies specified style edits one after another in the given order.
359///
360/// Parameters:
361/// - `edits`: array
362/// - `nodeForPropertySyntaxValidation`: DOM.NodeId (optional)
363///
364/// Returns: `styles`
365pub const SET_STYLE_TEXTS: &str = "CSS.setStyleTexts";
366
367/// Enables the selector recording.
368pub const START_RULE_USAGE_TRACKING: &str = "CSS.startRuleUsageTracking";
369
370/// Stop tracking rule usage and return the list of rules that were used since
371/// last call to `takeCoverageDelta` (or since start of coverage
372/// instrumentation).
373///
374/// Returns: `ruleUsage`
375pub const STOP_RULE_USAGE_TRACKING: &str = "CSS.stopRuleUsageTracking";
376
377/// Obtain list of rules that became used since last call to this method (or
378/// since start of coverage instrumentation).
379///
380/// Returns: `coverage`, `timestamp`
381pub const TAKE_COVERAGE_DELTA: &str = "CSS.takeCoverageDelta";
382
383/// Enables/disables rendering of local CSS fonts (enabled by default).
384///
385/// Experimental: may change without notice.
386///
387/// Parameters:
388/// - `enabled`: boolean
389pub const SET_LOCAL_FONTS_ENABLED: &str = "CSS.setLocalFontsEnabled";