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