Skip to main content

cdp_driver/protocol/
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//! Types, command parameters and event payloads for the `CSS`
15//! domain. The method-name constants for the same domain are in
16//! [`crate::methods`].
17//!
18//! This domain is experimental and may change without notice.
19
20use serde::{Deserialize, Serialize};
21
22/// Stylesheet type: "injected" for stylesheets injected via extension,
23/// "user-agent" for user-agent stylesheets, "inspector" for stylesheets
24/// created by the inspector (i.e. those holding the "via inspector" rules),
25/// "regular" for regular stylesheets.
26#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
27pub enum StyleSheetOrigin {
28    /// `injected`
29    #[serde(rename = "injected")]
30    Injected,
31    /// `user-agent`
32    #[serde(rename = "user-agent")]
33    UserAgent,
34    /// `inspector`
35    #[serde(rename = "inspector")]
36    Inspector,
37    /// `regular`
38    #[serde(rename = "regular")]
39    Regular,
40    /// A value this vendored schema does not list. Chrome adds values ahead of
41    /// the published protocol, so an unrecognised one is kept as it arrived
42    /// rather than failing the payload it came in.
43    #[serde(untagged)]
44    Unrecognized(String),
45}
46
47/// CSS rule collection for a single pseudo style.
48#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
49pub struct PseudoElementMatches {
50    /// Pseudo element type.
51    #[serde(rename = "pseudoType")]
52    pub pseudo_type: crate::protocol::dom::PseudoType,
53    /// Pseudo element custom ident.
54    #[serde(
55        rename = "pseudoIdentifier",
56        default,
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub pseudo_identifier: Option<String>,
60    /// Matches of CSS rules applicable to the pseudo style.
61    pub matches: Vec<RuleMatch>,
62}
63
64/// CSS style coming from animations with the name of the animation.
65#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
66pub struct CssAnimationStyle {
67    /// The name of the animation.
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub name: Option<String>,
70    /// The style coming from the animation.
71    pub style: CssStyle,
72}
73
74/// Inherited CSS rule collection from ancestor node.
75#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
76pub struct InheritedStyleEntry {
77    /// The ancestor node's inline style, if any, in the style inheritance chain.
78    #[serde(
79        rename = "inlineStyle",
80        default,
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub inline_style: Option<CssStyle>,
84    /// Matches of CSS rules matching the ancestor node in the style inheritance
85    /// chain.
86    #[serde(rename = "matchedCSSRules")]
87    pub matched_css_rules: Vec<RuleMatch>,
88}
89
90/// Inherited CSS style collection for animated styles from ancestor node.
91#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
92pub struct InheritedAnimatedStyleEntry {
93    /// Styles coming from the animations of the ancestor, if any, in the style
94    /// inheritance chain.
95    #[serde(
96        rename = "animationStyles",
97        default,
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub animation_styles: Option<Vec<CssAnimationStyle>>,
101    /// The style coming from the transitions of the ancestor, if any, in the
102    /// style inheritance chain.
103    #[serde(
104        rename = "transitionsStyle",
105        default,
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub transitions_style: Option<CssStyle>,
109}
110
111/// Inherited pseudo element matches from pseudos of an ancestor node.
112#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
113pub struct InheritedPseudoElementMatches {
114    /// Matches of pseudo styles from the pseudos of an ancestor node.
115    #[serde(rename = "pseudoElements")]
116    pub pseudo_elements: Vec<PseudoElementMatches>,
117}
118
119/// Match data for a CSS rule.
120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
121pub struct RuleMatch {
122    /// CSS rule in the match.
123    pub rule: CssRule,
124    /// Matching selector indices in the rule's selectorList selectors (0-based).
125    #[serde(rename = "matchingSelectors")]
126    pub matching_selectors: Vec<i64>,
127}
128
129/// Data for a simple selector (these are delimited by commas in a selector
130/// list).
131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
132pub struct Value {
133    /// Value text.
134    pub text: String,
135    /// Value range in the underlying resource (if available).
136    #[serde(default, skip_serializing_if = "Option::is_none")]
137    pub range: Option<SourceRange>,
138    /// Specificity of the selector.
139    ///
140    /// Experimental: may change without notice.
141    #[serde(default, skip_serializing_if = "Option::is_none")]
142    pub specificity: Option<Specificity>,
143}
144
145/// Contribution of an individual simple selector to specificity.
146///
147/// Experimental: may change without notice.
148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
149pub struct SpecificityComponent {
150    /// The simple selector text that contributes to specificity.
151    pub text: String,
152    /// The a component contribution.
153    pub a: i64,
154    /// The b component contribution.
155    pub b: i64,
156    /// The c component contribution.
157    pub c: i64,
158}
159
160/// Specificity: <https://drafts.csswg.org/selectors/#specificity-rules>
161///
162/// Experimental: may change without notice.
163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
164pub struct Specificity {
165    /// The a component, which represents the number of ID selectors.
166    pub a: i64,
167    /// The b component, which represents the number of class selectors,
168    /// attributes selectors, and pseudo-classes.
169    pub b: i64,
170    /// The c component, which represents the number of type selectors and
171    /// pseudo-elements.
172    pub c: i64,
173    /// Per-simple-selector contributions used to explain this specificity.
174    ///
175    /// Experimental: may change without notice.
176    #[serde(default, skip_serializing_if = "Option::is_none")]
177    pub components: Option<Vec<SpecificityComponent>>,
178}
179
180/// Selector list data.
181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
182pub struct SelectorList {
183    /// Selectors in the list.
184    pub selectors: Vec<Value>,
185    /// Rule selector text.
186    pub text: String,
187}
188
189/// CSS stylesheet metainformation.
190#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
191pub struct CssStyleSheetHeader {
192    /// The stylesheet identifier.
193    #[serde(rename = "styleSheetId")]
194    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
195    /// Owner frame identifier.
196    #[serde(rename = "frameId")]
197    pub frame_id: crate::protocol::page::FrameId,
198    /// Stylesheet resource URL. Empty if this is a constructed stylesheet created
199    /// using new CSSStyleSheet() (but non-empty if this is a constructed
200    /// stylesheet imported as a CSS module script).
201    #[serde(rename = "sourceURL")]
202    pub source_url: String,
203    /// URL of source map associated with the stylesheet (if any).
204    #[serde(
205        rename = "sourceMapURL",
206        default,
207        skip_serializing_if = "Option::is_none"
208    )]
209    pub source_map_url: Option<String>,
210    /// Stylesheet origin.
211    pub origin: StyleSheetOrigin,
212    /// Stylesheet title.
213    pub title: String,
214    /// The backend id for the owner node of the stylesheet.
215    #[serde(rename = "ownerNode", default, skip_serializing_if = "Option::is_none")]
216    pub owner_node: Option<crate::protocol::dom::BackendNodeId>,
217    /// Denotes whether the stylesheet is disabled.
218    pub disabled: bool,
219    /// Whether the sourceURL field value comes from the sourceURL comment.
220    #[serde(
221        rename = "hasSourceURL",
222        default,
223        skip_serializing_if = "Option::is_none"
224    )]
225    pub has_source_url: Option<bool>,
226    /// Whether this stylesheet is created for STYLE tag by parser. This flag is
227    /// not set for document.written STYLE tags.
228    #[serde(rename = "isInline")]
229    pub is_inline: bool,
230    /// Whether this stylesheet is mutable. Inline stylesheets become mutable
231    /// after they have been modified via CSSOM API. `\<link\>` element's
232    /// stylesheets become mutable only if DevTools modifies them. Constructed
233    /// stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
234    #[serde(rename = "isMutable")]
235    pub is_mutable: bool,
236    /// True if this stylesheet is created through new CSSStyleSheet() or imported
237    /// as a CSS module script.
238    #[serde(rename = "isConstructed")]
239    pub is_constructed: bool,
240    /// Line offset of the stylesheet within the resource (zero based).
241    #[serde(rename = "startLine")]
242    pub start_line: f64,
243    /// Column offset of the stylesheet within the resource (zero based).
244    #[serde(rename = "startColumn")]
245    pub start_column: f64,
246    /// Size of the content (in characters).
247    pub length: f64,
248    /// Line offset of the end of the stylesheet within the resource (zero based).
249    #[serde(rename = "endLine")]
250    pub end_line: f64,
251    /// Column offset of the end of the stylesheet within the resource (zero
252    /// based).
253    #[serde(rename = "endColumn")]
254    pub end_column: f64,
255    /// If the style sheet was loaded from a network resource, this indicates when
256    /// the resource failed to load
257    ///
258    /// Experimental: may change without notice.
259    #[serde(
260        rename = "loadingFailed",
261        default,
262        skip_serializing_if = "Option::is_none"
263    )]
264    pub loading_failed: Option<bool>,
265}
266
267/// CSS rule representation.
268#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
269pub struct CssRule {
270    /// The css style sheet identifier (absent for user agent stylesheet and
271    /// user-specified stylesheet rules) this rule came from.
272    #[serde(
273        rename = "styleSheetId",
274        default,
275        skip_serializing_if = "Option::is_none"
276    )]
277    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
278    /// Rule selector data.
279    #[serde(rename = "selectorList")]
280    pub selector_list: SelectorList,
281    /// Array of selectors from ancestor style rules, sorted by distance from the
282    /// current rule.
283    ///
284    /// Experimental: may change without notice.
285    #[serde(
286        rename = "nestingSelectors",
287        default,
288        skip_serializing_if = "Option::is_none"
289    )]
290    pub nesting_selectors: Option<Vec<String>>,
291    /// Parent stylesheet's origin.
292    pub origin: StyleSheetOrigin,
293    /// Associated style declaration.
294    pub style: CssStyle,
295    /// The BackendNodeId of the DOM node that constitutes the origin tree scope
296    /// of this rule.
297    ///
298    /// Experimental: may change without notice.
299    #[serde(
300        rename = "originTreeScopeNodeId",
301        default,
302        skip_serializing_if = "Option::is_none"
303    )]
304    pub origin_tree_scope_node_id: Option<crate::protocol::dom::BackendNodeId>,
305    /// Media list array (for rules involving media queries). The array enumerates
306    /// media queries starting with the innermost one, going outwards.
307    #[serde(default, skip_serializing_if = "Option::is_none")]
308    pub media: Option<Vec<CssMedia>>,
309    /// Container query list array (for rules involving container queries). The
310    /// array enumerates container queries starting with the innermost one, going
311    /// outwards.
312    ///
313    /// Experimental: may change without notice.
314    #[serde(
315        rename = "containerQueries",
316        default,
317        skip_serializing_if = "Option::is_none"
318    )]
319    pub container_queries: Option<Vec<CssContainerQuery>>,
320    /// @supports CSS at-rule array. The array enumerates @supports at-rules
321    /// starting with the innermost one, going outwards.
322    ///
323    /// Experimental: may change without notice.
324    #[serde(default, skip_serializing_if = "Option::is_none")]
325    pub supports: Option<Vec<CssSupports>>,
326    /// Cascade layer array. Contains the layer hierarchy that this rule belongs
327    /// to starting with the innermost layer and going outwards.
328    ///
329    /// Experimental: may change without notice.
330    #[serde(default, skip_serializing_if = "Option::is_none")]
331    pub layers: Option<Vec<CssLayer>>,
332    /// @scope CSS at-rule array. The array enumerates @scope at-rules starting
333    /// with the innermost one, going outwards.
334    ///
335    /// Experimental: may change without notice.
336    #[serde(default, skip_serializing_if = "Option::is_none")]
337    pub scopes: Option<Vec<CssScope>>,
338    /// The array keeps the types of ancestor CSSRules from the innermost going
339    /// outwards.
340    ///
341    /// Experimental: may change without notice.
342    #[serde(rename = "ruleTypes", default, skip_serializing_if = "Option::is_none")]
343    pub rule_types: Option<Vec<CssRuleType>>,
344    /// @starting-style CSS at-rule array. The array enumerates @starting-style
345    /// at-rules starting with the innermost one, going outwards.
346    ///
347    /// Experimental: may change without notice.
348    #[serde(
349        rename = "startingStyles",
350        default,
351        skip_serializing_if = "Option::is_none"
352    )]
353    pub starting_styles: Option<Vec<CssStartingStyle>>,
354    /// @navigation CSS at-rule array. The array enumerates @navigation at-rules
355    /// starting with the innermost one, going outwards.
356    ///
357    /// Experimental: may change without notice.
358    #[serde(default, skip_serializing_if = "Option::is_none")]
359    pub navigations: Option<Vec<CssNavigation>>,
360}
361
362/// Enum indicating the type of a CSS rule, used to represent the order of a
363/// style rule's ancestors. This list only contains rule types that are
364/// collected during the ancestor rule collection.
365///
366/// Experimental: may change without notice.
367#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
368pub enum CssRuleType {
369    /// `MediaRule`
370    MediaRule,
371    /// `SupportsRule`
372    SupportsRule,
373    /// `ContainerRule`
374    ContainerRule,
375    /// `LayerRule`
376    LayerRule,
377    /// `ScopeRule`
378    ScopeRule,
379    /// `StyleRule`
380    StyleRule,
381    /// `StartingStyleRule`
382    StartingStyleRule,
383    /// `NavigationRule`
384    NavigationRule,
385    /// A value this vendored schema does not list. Chrome adds values ahead of
386    /// the published protocol, so an unrecognised one is kept as it arrived
387    /// rather than failing the payload it came in.
388    #[serde(untagged)]
389    Unrecognized(String),
390}
391
392/// CSS coverage information.
393#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
394pub struct RuleUsage {
395    /// The css style sheet identifier (absent for user agent stylesheet and
396    /// user-specified stylesheet rules) this rule came from.
397    #[serde(rename = "styleSheetId")]
398    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
399    /// Offset of the start of the rule (including selector) from the beginning of
400    /// the stylesheet.
401    #[serde(rename = "startOffset")]
402    pub start_offset: f64,
403    /// Offset of the end of the rule body from the beginning of the stylesheet.
404    #[serde(rename = "endOffset")]
405    pub end_offset: f64,
406    /// Indicates whether the rule was actually used by some element in the page.
407    pub used: bool,
408}
409
410/// Text range within a resource. All numbers are zero-based.
411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
412pub struct SourceRange {
413    /// Start line of range.
414    #[serde(rename = "startLine")]
415    pub start_line: i64,
416    /// Start column of range (inclusive).
417    #[serde(rename = "startColumn")]
418    pub start_column: i64,
419    /// End line of range
420    #[serde(rename = "endLine")]
421    pub end_line: i64,
422    /// End column of range (exclusive).
423    #[serde(rename = "endColumn")]
424    pub end_column: i64,
425}
426
427#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
428pub struct ShorthandEntry {
429    /// Shorthand name.
430    pub name: String,
431    /// Shorthand value.
432    pub value: String,
433    /// Whether the property has "!important" annotation (implies `false` if
434    /// absent).
435    #[serde(default, skip_serializing_if = "Option::is_none")]
436    pub important: Option<bool>,
437}
438
439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
440pub struct CssComputedStyleProperty {
441    /// Computed style property name.
442    pub name: String,
443    /// Computed style property value.
444    pub value: String,
445}
446
447/// Experimental: may change without notice.
448#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
449pub struct ComputedStyleExtraFields {
450    /// Returns whether or not this node is being rendered with base appearance,
451    /// which happens when it has its appearance property set to base/base-select
452    /// or it is in the subtree of an element being rendered with base appearance.
453    #[serde(rename = "isAppearanceBase")]
454    pub is_appearance_base: bool,
455}
456
457/// CSS style representation.
458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
459pub struct CssStyle {
460    /// The css style sheet identifier (absent for user agent stylesheet and
461    /// user-specified stylesheet rules) this rule came from.
462    #[serde(
463        rename = "styleSheetId",
464        default,
465        skip_serializing_if = "Option::is_none"
466    )]
467    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
468    /// CSS properties in the style.
469    #[serde(rename = "cssProperties")]
470    pub css_properties: Vec<CssProperty>,
471    /// Computed values for all shorthands found in the style.
472    #[serde(rename = "shorthandEntries")]
473    pub shorthand_entries: Vec<ShorthandEntry>,
474    /// Style declaration text (if available).
475    #[serde(rename = "cssText", default, skip_serializing_if = "Option::is_none")]
476    pub css_text: Option<String>,
477    /// Style declaration range in the enclosing stylesheet (if available).
478    #[serde(default, skip_serializing_if = "Option::is_none")]
479    pub range: Option<SourceRange>,
480}
481
482/// CSS property declaration data.
483#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
484pub struct CssProperty {
485    /// The property name.
486    pub name: String,
487    /// The property value.
488    pub value: String,
489    /// Whether the property has "!important" annotation (implies `false` if
490    /// absent).
491    #[serde(default, skip_serializing_if = "Option::is_none")]
492    pub important: Option<bool>,
493    /// Whether the property is implicit (implies `false` if absent).
494    #[serde(default, skip_serializing_if = "Option::is_none")]
495    pub implicit: Option<bool>,
496    /// The full property text as specified in the style.
497    #[serde(default, skip_serializing_if = "Option::is_none")]
498    pub text: Option<String>,
499    /// Whether the property is understood by the browser (implies `true` if
500    /// absent).
501    #[serde(rename = "parsedOk", default, skip_serializing_if = "Option::is_none")]
502    pub parsed_ok: Option<bool>,
503    /// Whether the property is disabled by the user (present for source-based
504    /// properties only).
505    #[serde(default, skip_serializing_if = "Option::is_none")]
506    pub disabled: Option<bool>,
507    /// The entire property range in the enclosing style declaration (if
508    /// available).
509    #[serde(default, skip_serializing_if = "Option::is_none")]
510    pub range: Option<SourceRange>,
511    /// Parsed longhand components of this property if it is a shorthand. This
512    /// field will be empty if the given property is not a shorthand.
513    ///
514    /// Experimental: may change without notice.
515    #[serde(
516        rename = "longhandProperties",
517        default,
518        skip_serializing_if = "Option::is_none"
519    )]
520    pub longhand_properties: Option<Vec<CssProperty>>,
521}
522
523/// CSS media rule descriptor.
524#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
525pub struct CssMedia {
526    /// Media query text.
527    pub text: String,
528    /// Source of the media query: "mediaRule" if specified by a @media rule,
529    /// "importRule" if specified by an @import rule, "linkedSheet" if specified
530    /// by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if
531    /// specified by a "media" attribute in an inline stylesheet's STYLE tag.
532    pub source: CssMediaSource,
533    /// URL of the document containing the media query description.
534    #[serde(rename = "sourceURL", default, skip_serializing_if = "Option::is_none")]
535    pub source_url: Option<String>,
536    /// The associated rule (@media or @import) header range in the enclosing
537    /// stylesheet (if available).
538    #[serde(default, skip_serializing_if = "Option::is_none")]
539    pub range: Option<SourceRange>,
540    /// Identifier of the stylesheet containing this object (if exists).
541    #[serde(
542        rename = "styleSheetId",
543        default,
544        skip_serializing_if = "Option::is_none"
545    )]
546    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
547    /// Array of media queries.
548    #[serde(rename = "mediaList", default, skip_serializing_if = "Option::is_none")]
549    pub media_list: Option<Vec<MediaQuery>>,
550}
551
552/// The values `source` accepts on `CSSMedia`.
553#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
554pub enum CssMediaSource {
555    /// `mediaRule`
556    #[serde(rename = "mediaRule")]
557    MediaRule,
558    /// `importRule`
559    #[serde(rename = "importRule")]
560    ImportRule,
561    /// `linkedSheet`
562    #[serde(rename = "linkedSheet")]
563    LinkedSheet,
564    /// `inlineSheet`
565    #[serde(rename = "inlineSheet")]
566    InlineSheet,
567    /// A value this vendored schema does not list. Chrome adds values ahead of
568    /// the published protocol, so an unrecognised one is kept as it arrived
569    /// rather than failing the payload it came in.
570    #[serde(untagged)]
571    Unrecognized(String),
572}
573
574/// Media query descriptor.
575#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
576pub struct MediaQuery {
577    /// Array of media query expressions.
578    pub expressions: Vec<MediaQueryExpression>,
579    /// Whether the media query condition is satisfied.
580    pub active: bool,
581}
582
583/// Media query expression descriptor.
584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
585pub struct MediaQueryExpression {
586    /// Media query expression value.
587    pub value: f64,
588    /// Media query expression units.
589    pub unit: String,
590    /// Media query expression feature.
591    pub feature: String,
592    /// The associated range of the value text in the enclosing stylesheet (if
593    /// available).
594    #[serde(
595        rename = "valueRange",
596        default,
597        skip_serializing_if = "Option::is_none"
598    )]
599    pub value_range: Option<SourceRange>,
600    /// Computed length of media query expression (if applicable).
601    #[serde(
602        rename = "computedLength",
603        default,
604        skip_serializing_if = "Option::is_none"
605    )]
606    pub computed_length: Option<f64>,
607}
608
609/// CSS container query rule descriptor.
610///
611/// Experimental: may change without notice.
612#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
613pub struct CssContainerQuery {
614    /// Container query text. Contains the query part without the container name
615    /// for a single query. Deprecated in favor of conditionText which contains
616    /// the full prelude after @container.
617    ///
618    /// Deprecated in the protocol.
619    pub text: String,
620    /// The associated rule header range in the enclosing stylesheet (if
621    /// available).
622    #[serde(default, skip_serializing_if = "Option::is_none")]
623    pub range: Option<SourceRange>,
624    /// Identifier of the stylesheet containing this object (if exists).
625    #[serde(
626        rename = "styleSheetId",
627        default,
628        skip_serializing_if = "Option::is_none"
629    )]
630    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
631    /// Optional name for the container.
632    #[serde(default, skip_serializing_if = "Option::is_none")]
633    pub name: Option<String>,
634    /// Optional physical axes queried for the container.
635    #[serde(
636        rename = "physicalAxes",
637        default,
638        skip_serializing_if = "Option::is_none"
639    )]
640    pub physical_axes: Option<crate::protocol::dom::PhysicalAxes>,
641    /// Optional logical axes queried for the container.
642    #[serde(
643        rename = "logicalAxes",
644        default,
645        skip_serializing_if = "Option::is_none"
646    )]
647    pub logical_axes: Option<crate::protocol::dom::LogicalAxes>,
648    /// true if the query contains scroll-state() queries.
649    #[serde(
650        rename = "queriesScrollState",
651        default,
652        skip_serializing_if = "Option::is_none"
653    )]
654    pub queries_scroll_state: Option<bool>,
655    /// true if the query contains anchored() queries.
656    #[serde(
657        rename = "queriesAnchored",
658        default,
659        skip_serializing_if = "Option::is_none"
660    )]
661    pub queries_anchored: Option<bool>,
662    /// CSSContainerRule.conditionText
663    #[serde(rename = "conditionText")]
664    pub condition_text: String,
665}
666
667/// CSS Supports at-rule descriptor.
668///
669/// Experimental: may change without notice.
670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
671pub struct CssSupports {
672    /// Supports rule text.
673    pub text: String,
674    /// Whether the supports condition is satisfied.
675    pub active: bool,
676    /// The associated rule header range in the enclosing stylesheet (if
677    /// available).
678    #[serde(default, skip_serializing_if = "Option::is_none")]
679    pub range: Option<SourceRange>,
680    /// Identifier of the stylesheet containing this object (if exists).
681    #[serde(
682        rename = "styleSheetId",
683        default,
684        skip_serializing_if = "Option::is_none"
685    )]
686    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
687}
688
689/// CSS Navigation at-rule descriptor.
690///
691/// Experimental: may change without notice.
692#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
693pub struct CssNavigation {
694    /// Navigation rule text.
695    pub text: String,
696    /// Whether the navigation condition is satisfied.
697    #[serde(default, skip_serializing_if = "Option::is_none")]
698    pub active: Option<bool>,
699    /// The associated rule header range in the enclosing stylesheet (if
700    /// available).
701    #[serde(default, skip_serializing_if = "Option::is_none")]
702    pub range: Option<SourceRange>,
703    /// Identifier of the stylesheet containing this object (if exists).
704    #[serde(
705        rename = "styleSheetId",
706        default,
707        skip_serializing_if = "Option::is_none"
708    )]
709    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
710}
711
712/// CSS Scope at-rule descriptor.
713///
714/// Experimental: may change without notice.
715#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
716pub struct CssScope {
717    /// Scope rule text.
718    pub text: String,
719    /// The associated rule header range in the enclosing stylesheet (if
720    /// available).
721    #[serde(default, skip_serializing_if = "Option::is_none")]
722    pub range: Option<SourceRange>,
723    /// Identifier of the stylesheet containing this object (if exists).
724    #[serde(
725        rename = "styleSheetId",
726        default,
727        skip_serializing_if = "Option::is_none"
728    )]
729    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
730}
731
732/// CSS Layer at-rule descriptor.
733///
734/// Experimental: may change without notice.
735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
736pub struct CssLayer {
737    /// Layer name.
738    pub text: String,
739    /// The associated rule header range in the enclosing stylesheet (if
740    /// available).
741    #[serde(default, skip_serializing_if = "Option::is_none")]
742    pub range: Option<SourceRange>,
743    /// Identifier of the stylesheet containing this object (if exists).
744    #[serde(
745        rename = "styleSheetId",
746        default,
747        skip_serializing_if = "Option::is_none"
748    )]
749    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
750}
751
752/// CSS Starting Style at-rule descriptor.
753///
754/// Experimental: may change without notice.
755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
756pub struct CssStartingStyle {
757    /// The associated rule header range in the enclosing stylesheet (if
758    /// available).
759    #[serde(default, skip_serializing_if = "Option::is_none")]
760    pub range: Option<SourceRange>,
761    /// Identifier of the stylesheet containing this object (if exists).
762    #[serde(
763        rename = "styleSheetId",
764        default,
765        skip_serializing_if = "Option::is_none"
766    )]
767    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
768}
769
770/// CSS Layer data.
771///
772/// Experimental: may change without notice.
773#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
774pub struct CssLayerData {
775    /// Layer name.
776    pub name: String,
777    /// Direct sub-layers
778    #[serde(rename = "subLayers", default, skip_serializing_if = "Option::is_none")]
779    pub sub_layers: Option<Vec<CssLayerData>>,
780    /// Layer order. The order determines the order of the layer in the cascade
781    /// order. A higher number has higher priority in the cascade order.
782    pub order: f64,
783}
784
785/// Information about amount of glyphs that were rendered with given font.
786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
787pub struct PlatformFontUsage {
788    /// Font's family name reported by platform.
789    #[serde(rename = "familyName")]
790    pub family_name: String,
791    /// Font's PostScript name reported by platform.
792    #[serde(rename = "postScriptName")]
793    pub post_script_name: String,
794    /// Indicates if the font was downloaded or resolved locally.
795    #[serde(rename = "isCustomFont")]
796    pub is_custom_font: bool,
797    /// Amount of glyphs that were rendered with this font.
798    #[serde(rename = "glyphCount")]
799    pub glyph_count: f64,
800}
801
802/// Information about font variation axes for variable fonts
803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
804pub struct FontVariationAxis {
805    /// The font-variation-setting tag (a.k.a. "axis tag").
806    pub tag: String,
807    /// Human-readable variation name in the default language (normally, "en").
808    pub name: String,
809    /// The minimum value (inclusive) the font supports for this tag.
810    #[serde(rename = "minValue")]
811    pub min_value: f64,
812    /// The maximum value (inclusive) the font supports for this tag.
813    #[serde(rename = "maxValue")]
814    pub max_value: f64,
815    /// The default value.
816    #[serde(rename = "defaultValue")]
817    pub default_value: f64,
818}
819
820/// Properties of a web font:
821/// <https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions>
822/// and additional information such as platformFontFamily and
823/// fontVariationAxes.
824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
825pub struct FontFace {
826    /// The font-family.
827    #[serde(rename = "fontFamily")]
828    pub font_family: String,
829    /// The font-style.
830    #[serde(rename = "fontStyle")]
831    pub font_style: String,
832    /// The font-variant.
833    #[serde(rename = "fontVariant")]
834    pub font_variant: String,
835    /// The font-weight.
836    #[serde(rename = "fontWeight")]
837    pub font_weight: String,
838    /// The font-stretch.
839    #[serde(rename = "fontStretch")]
840    pub font_stretch: String,
841    /// The font-display.
842    #[serde(rename = "fontDisplay")]
843    pub font_display: String,
844    /// The unicode-range.
845    #[serde(rename = "unicodeRange")]
846    pub unicode_range: String,
847    /// The src.
848    pub src: String,
849    /// The resolved platform font family
850    #[serde(rename = "platformFontFamily")]
851    pub platform_font_family: String,
852    /// Available variation settings (a.k.a. "axes").
853    #[serde(
854        rename = "fontVariationAxes",
855        default,
856        skip_serializing_if = "Option::is_none"
857    )]
858    pub font_variation_axes: Option<Vec<FontVariationAxis>>,
859}
860
861/// CSS try rule representation.
862#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
863pub struct CssTryRule {
864    /// The css style sheet identifier (absent for user agent stylesheet and
865    /// user-specified stylesheet rules) this rule came from.
866    #[serde(
867        rename = "styleSheetId",
868        default,
869        skip_serializing_if = "Option::is_none"
870    )]
871    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
872    /// Parent stylesheet's origin.
873    pub origin: StyleSheetOrigin,
874    /// Associated style declaration.
875    pub style: CssStyle,
876}
877
878/// CSS @position-try rule representation.
879#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
880pub struct CssPositionTryRule {
881    /// The prelude dashed-ident name
882    pub name: Value,
883    /// The css style sheet identifier (absent for user agent stylesheet and
884    /// user-specified stylesheet rules) this rule came from.
885    #[serde(
886        rename = "styleSheetId",
887        default,
888        skip_serializing_if = "Option::is_none"
889    )]
890    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
891    /// Parent stylesheet's origin.
892    pub origin: StyleSheetOrigin,
893    /// Associated style declaration.
894    pub style: CssStyle,
895    pub active: bool,
896}
897
898/// CSS keyframes rule representation.
899#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
900pub struct CssKeyframesRule {
901    /// Animation name.
902    #[serde(rename = "animationName")]
903    pub animation_name: Value,
904    /// List of keyframes.
905    pub keyframes: Vec<CssKeyframeRule>,
906}
907
908/// Representation of a custom property registration through
909/// CSS.registerProperty
910#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
911pub struct CssPropertyRegistration {
912    #[serde(rename = "propertyName")]
913    pub property_name: String,
914    #[serde(
915        rename = "initialValue",
916        default,
917        skip_serializing_if = "Option::is_none"
918    )]
919    pub initial_value: Option<Value>,
920    pub inherits: bool,
921    pub syntax: String,
922}
923
924/// CSS generic @rule representation.
925#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
926pub struct CssAtRule {
927    /// Type of at-rule.
928    pub r#type: CssAtRuleType,
929    /// Subsection of font-feature-values, if this is a subsection.
930    #[serde(default, skip_serializing_if = "Option::is_none")]
931    pub subsection: Option<CssAtRuleSubsection>,
932    /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType)
933    /// Associated name, if applicable.
934    #[serde(default, skip_serializing_if = "Option::is_none")]
935    pub name: Option<Value>,
936    /// The css style sheet identifier (absent for user agent stylesheet and
937    /// user-specified stylesheet rules) this rule came from.
938    #[serde(
939        rename = "styleSheetId",
940        default,
941        skip_serializing_if = "Option::is_none"
942    )]
943    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
944    /// Parent stylesheet's origin.
945    pub origin: StyleSheetOrigin,
946    /// Associated style declaration.
947    pub style: CssStyle,
948}
949
950/// The values `type` accepts on `CSSAtRule`.
951#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
952pub enum CssAtRuleType {
953    /// `font-face`
954    #[serde(rename = "font-face")]
955    FontFace,
956    /// `font-feature-values`
957    #[serde(rename = "font-feature-values")]
958    FontFeatureValues,
959    /// `font-palette-values`
960    #[serde(rename = "font-palette-values")]
961    FontPaletteValues,
962    /// `counter-style`
963    #[serde(rename = "counter-style")]
964    CounterStyle,
965    /// A value this vendored schema does not list. Chrome adds values ahead of
966    /// the published protocol, so an unrecognised one is kept as it arrived
967    /// rather than failing the payload it came in.
968    #[serde(untagged)]
969    Unrecognized(String),
970}
971
972/// The values `subsection` accepts on `CSSAtRule`.
973#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
974pub enum CssAtRuleSubsection {
975    /// `swash`
976    #[serde(rename = "swash")]
977    Swash,
978    /// `annotation`
979    #[serde(rename = "annotation")]
980    Annotation,
981    /// `ornaments`
982    #[serde(rename = "ornaments")]
983    Ornaments,
984    /// `stylistic`
985    #[serde(rename = "stylistic")]
986    Stylistic,
987    /// `styleset`
988    #[serde(rename = "styleset")]
989    Styleset,
990    /// `character-variant`
991    #[serde(rename = "character-variant")]
992    CharacterVariant,
993    /// A value this vendored schema does not list. Chrome adds values ahead of
994    /// the published protocol, so an unrecognised one is kept as it arrived
995    /// rather than failing the payload it came in.
996    #[serde(untagged)]
997    Unrecognized(String),
998}
999
1000/// CSS property at-rule representation.
1001#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1002pub struct CssPropertyRule {
1003    /// The css style sheet identifier (absent for user agent stylesheet and
1004    /// user-specified stylesheet rules) this rule came from.
1005    #[serde(
1006        rename = "styleSheetId",
1007        default,
1008        skip_serializing_if = "Option::is_none"
1009    )]
1010    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
1011    /// Parent stylesheet's origin.
1012    pub origin: StyleSheetOrigin,
1013    /// Associated property name.
1014    #[serde(rename = "propertyName")]
1015    pub property_name: Value,
1016    /// Associated style declaration.
1017    pub style: CssStyle,
1018}
1019
1020/// CSS function argument representation.
1021#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1022pub struct CssFunctionParameter {
1023    /// The parameter name.
1024    pub name: String,
1025    /// The parameter type.
1026    pub r#type: String,
1027}
1028
1029/// CSS function conditional block representation.
1030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1031pub struct CssFunctionConditionNode {
1032    /// Media query for this conditional block. Only one type of condition should
1033    /// be set.
1034    #[serde(default, skip_serializing_if = "Option::is_none")]
1035    pub media: Option<CssMedia>,
1036    /// Container query for this conditional block. Only one type of condition
1037    /// should be set.
1038    #[serde(
1039        rename = "containerQueries",
1040        default,
1041        skip_serializing_if = "Option::is_none"
1042    )]
1043    pub container_queries: Option<CssContainerQuery>,
1044    /// @supports CSS at-rule condition. Only one type of condition should be set.
1045    #[serde(default, skip_serializing_if = "Option::is_none")]
1046    pub supports: Option<CssSupports>,
1047    /// @navigation condition. Only one type of condition should be set.
1048    #[serde(default, skip_serializing_if = "Option::is_none")]
1049    pub navigation: Option<CssNavigation>,
1050    /// Block body.
1051    pub children: Vec<CssFunctionNode>,
1052    /// The condition text.
1053    #[serde(rename = "conditionText")]
1054    pub condition_text: String,
1055}
1056
1057/// Section of the body of a CSS function rule.
1058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1059pub struct CssFunctionNode {
1060    /// A conditional block. If set, style should not be set.
1061    #[serde(default, skip_serializing_if = "Option::is_none")]
1062    pub condition: Option<CssFunctionConditionNode>,
1063    /// Values set by this node. If set, condition should not be set.
1064    #[serde(default, skip_serializing_if = "Option::is_none")]
1065    pub style: Option<CssStyle>,
1066}
1067
1068/// CSS function at-rule representation.
1069#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1070pub struct CssFunctionRule {
1071    /// Name of the function.
1072    pub name: Value,
1073    /// The css style sheet identifier (absent for user agent stylesheet and
1074    /// user-specified stylesheet rules) this rule came from.
1075    #[serde(
1076        rename = "styleSheetId",
1077        default,
1078        skip_serializing_if = "Option::is_none"
1079    )]
1080    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
1081    /// Parent stylesheet's origin.
1082    pub origin: StyleSheetOrigin,
1083    /// List of parameters.
1084    pub parameters: Vec<CssFunctionParameter>,
1085    /// Function body.
1086    pub children: Vec<CssFunctionNode>,
1087    /// The BackendNodeId of the DOM node that constitutes the origin tree scope
1088    /// of this rule.
1089    ///
1090    /// Experimental: may change without notice.
1091    #[serde(
1092        rename = "originTreeScopeNodeId",
1093        default,
1094        skip_serializing_if = "Option::is_none"
1095    )]
1096    pub origin_tree_scope_node_id: Option<crate::protocol::dom::BackendNodeId>,
1097}
1098
1099/// CSS keyframe rule representation.
1100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1101pub struct CssKeyframeRule {
1102    /// The css style sheet identifier (absent for user agent stylesheet and
1103    /// user-specified stylesheet rules) this rule came from.
1104    #[serde(
1105        rename = "styleSheetId",
1106        default,
1107        skip_serializing_if = "Option::is_none"
1108    )]
1109    pub style_sheet_id: Option<crate::protocol::dom::StyleSheetId>,
1110    /// Parent stylesheet's origin.
1111    pub origin: StyleSheetOrigin,
1112    /// Associated key text.
1113    #[serde(rename = "keyText")]
1114    pub key_text: Value,
1115    /// Associated style declaration.
1116    pub style: CssStyle,
1117}
1118
1119/// A descriptor of operation to mutate style declaration text.
1120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1121pub struct StyleDeclarationEdit {
1122    /// The css style sheet identifier.
1123    #[serde(rename = "styleSheetId")]
1124    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1125    /// The range of the style text in the enclosing stylesheet.
1126    pub range: SourceRange,
1127    /// New style text.
1128    pub text: String,
1129}
1130
1131/// Inserts a new rule with the given `ruleText` in a stylesheet with given
1132/// `styleSheetId`, at the position specified by `location`.
1133///
1134/// Parameters of `CSS.addRule`.
1135#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1136pub struct AddRuleParams {
1137    /// The css style sheet identifier where a new rule should be inserted.
1138    #[serde(rename = "styleSheetId")]
1139    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1140    /// The text of a new rule.
1141    #[serde(rename = "ruleText")]
1142    pub rule_text: String,
1143    /// Text position of a new rule in the target style sheet.
1144    pub location: SourceRange,
1145    /// NodeId for the DOM node in whose context custom property declarations for
1146    /// registered properties should be validated. If omitted, declarations in the
1147    /// new rule text can only be validated statically, which may produce
1148    /// incorrect results if the declaration contains a var() for example.
1149    ///
1150    /// Experimental: may change without notice.
1151    #[serde(
1152        rename = "nodeForPropertySyntaxValidation",
1153        default,
1154        skip_serializing_if = "Option::is_none"
1155    )]
1156    pub node_for_property_syntax_validation: Option<crate::protocol::dom::NodeId>,
1157}
1158
1159/// What `CSS.addRule` answers with.
1160#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1161pub struct AddRuleReturns {
1162    /// The newly created rule.
1163    pub rule: CssRule,
1164}
1165
1166impl crate::typed::Command for AddRuleParams {
1167    const METHOD: &'static str = "CSS.addRule";
1168    type Returns = AddRuleReturns;
1169}
1170
1171/// Returns all class names from specified stylesheet.
1172///
1173/// Parameters of `CSS.collectClassNames`.
1174#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1175pub struct CollectClassNamesParams {
1176    #[serde(rename = "styleSheetId")]
1177    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1178}
1179
1180/// What `CSS.collectClassNames` answers with.
1181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1182pub struct CollectClassNamesReturns {
1183    /// Class name list.
1184    #[serde(rename = "classNames")]
1185    pub class_names: Vec<String>,
1186}
1187
1188impl crate::typed::Command for CollectClassNamesParams {
1189    const METHOD: &'static str = "CSS.collectClassNames";
1190    type Returns = CollectClassNamesReturns;
1191}
1192
1193/// Creates a new special "via-inspector" stylesheet in the frame with given
1194/// `frameId`.
1195///
1196/// Parameters of `CSS.createStyleSheet`.
1197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1198pub struct CreateStyleSheetParams {
1199    /// Identifier of the frame where "via-inspector" stylesheet should be
1200    /// created.
1201    #[serde(rename = "frameId")]
1202    pub frame_id: crate::protocol::page::FrameId,
1203    /// If true, creates a new stylesheet for every call. If false, returns a
1204    /// stylesheet previously created by a call with force=false for the frame's
1205    /// document if it exists or creates a new stylesheet (default: false).
1206    #[serde(default, skip_serializing_if = "Option::is_none")]
1207    pub force: Option<bool>,
1208}
1209
1210/// What `CSS.createStyleSheet` answers with.
1211#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1212pub struct CreateStyleSheetReturns {
1213    /// Identifier of the created "via-inspector" stylesheet.
1214    #[serde(rename = "styleSheetId")]
1215    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1216}
1217
1218impl crate::typed::Command for CreateStyleSheetParams {
1219    const METHOD: &'static str = "CSS.createStyleSheet";
1220    type Returns = CreateStyleSheetReturns;
1221}
1222
1223/// Disables the CSS agent for the given page.
1224///
1225/// Parameters of `CSS.disable`.
1226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1227pub struct DisableParams {}
1228
1229impl crate::typed::Command for DisableParams {
1230    const METHOD: &'static str = "CSS.disable";
1231    type Returns = crate::typed::NoReturns;
1232}
1233
1234/// Enables the CSS agent for the given page. Clients should not assume that
1235/// the CSS agent has been enabled until the result of this command is
1236/// received.
1237///
1238/// Parameters of `CSS.enable`.
1239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1240pub struct EnableParams {}
1241
1242impl crate::typed::Command for EnableParams {
1243    const METHOD: &'static str = "CSS.enable";
1244    type Returns = crate::typed::NoReturns;
1245}
1246
1247/// Ensures that the given node will have specified pseudo-classes whenever
1248/// its style is computed by the browser.
1249///
1250/// Parameters of `CSS.forcePseudoState`.
1251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1252pub struct ForcePseudoStateParams {
1253    /// The element id for which to force the pseudo state.
1254    #[serde(rename = "nodeId")]
1255    pub node_id: crate::protocol::dom::NodeId,
1256    /// Element pseudo classes to force when computing the element's style.
1257    #[serde(rename = "forcedPseudoClasses")]
1258    pub forced_pseudo_classes: Vec<String>,
1259}
1260
1261impl crate::typed::Command for ForcePseudoStateParams {
1262    const METHOD: &'static str = "CSS.forcePseudoState";
1263    type Returns = crate::typed::NoReturns;
1264}
1265
1266/// Ensures that the given node is in its starting-style state.
1267///
1268/// Parameters of `CSS.forceStartingStyle`.
1269#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1270pub struct ForceStartingStyleParams {
1271    /// The element id for which to force the starting-style state.
1272    #[serde(rename = "nodeId")]
1273    pub node_id: crate::protocol::dom::NodeId,
1274    /// Boolean indicating if this is on or off.
1275    pub forced: bool,
1276}
1277
1278impl crate::typed::Command for ForceStartingStyleParams {
1279    const METHOD: &'static str = "CSS.forceStartingStyle";
1280    type Returns = crate::typed::NoReturns;
1281}
1282
1283/// Forces a position-try option for the given node.
1284///
1285/// Parameters of `CSS.forcePositionTryOption`.
1286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1287pub struct ForcePositionTryOptionParams {
1288    /// The element id for which to force the position-try option.
1289    #[serde(rename = "nodeId")]
1290    pub node_id: crate::protocol::dom::NodeId,
1291    /// The 1-based index of the position-try fallback option, 0 for base position
1292    /// (no fallback), or omitted to clear the forced state.
1293    #[serde(default, skip_serializing_if = "Option::is_none")]
1294    pub index: Option<i64>,
1295}
1296
1297impl crate::typed::Command for ForcePositionTryOptionParams {
1298    const METHOD: &'static str = "CSS.forcePositionTryOption";
1299    type Returns = crate::typed::NoReturns;
1300}
1301
1302/// Parameters of `CSS.getBackgroundColors`.
1303#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1304pub struct GetBackgroundColorsParams {
1305    /// Id of the node to get background colors for.
1306    #[serde(rename = "nodeId")]
1307    pub node_id: crate::protocol::dom::NodeId,
1308}
1309
1310/// What `CSS.getBackgroundColors` answers with.
1311#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1312pub struct GetBackgroundColorsReturns {
1313    /// The range of background colors behind this element, if it contains any
1314    /// visible text. If no visible text is present, this will be undefined. In
1315    /// the case of a flat background color, this will consist of simply that
1316    /// color. In the case of a gradient, this will consist of each of the color
1317    /// stops. For anything more complicated, this will be an empty array. Images
1318    /// will be ignored (as if the image had failed to load).
1319    #[serde(
1320        rename = "backgroundColors",
1321        default,
1322        skip_serializing_if = "Option::is_none"
1323    )]
1324    pub background_colors: Option<Vec<String>>,
1325    /// The computed font size for this node, as a CSS computed value string (e.g.
1326    /// '12px').
1327    #[serde(
1328        rename = "computedFontSize",
1329        default,
1330        skip_serializing_if = "Option::is_none"
1331    )]
1332    pub computed_font_size: Option<String>,
1333    /// The computed font weight for this node, as a CSS computed value string
1334    /// (e.g. 'normal' or '100').
1335    #[serde(
1336        rename = "computedFontWeight",
1337        default,
1338        skip_serializing_if = "Option::is_none"
1339    )]
1340    pub computed_font_weight: Option<String>,
1341}
1342
1343impl crate::typed::Command for GetBackgroundColorsParams {
1344    const METHOD: &'static str = "CSS.getBackgroundColors";
1345    type Returns = GetBackgroundColorsReturns;
1346}
1347
1348/// Returns the computed style for a DOM node identified by `nodeId`.
1349///
1350/// Parameters of `CSS.getComputedStyleForNode`.
1351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1352pub struct GetComputedStyleForNodeParams {
1353    #[serde(rename = "nodeId")]
1354    pub node_id: crate::protocol::dom::NodeId,
1355}
1356
1357/// What `CSS.getComputedStyleForNode` answers with.
1358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1359pub struct GetComputedStyleForNodeReturns {
1360    /// Computed style for the specified DOM node.
1361    #[serde(rename = "computedStyle")]
1362    pub computed_style: Vec<CssComputedStyleProperty>,
1363    /// A list of non-standard "extra fields" which blink stores alongside each
1364    /// computed style.
1365    ///
1366    /// Experimental: may change without notice.
1367    #[serde(rename = "extraFields")]
1368    pub extra_fields: ComputedStyleExtraFields,
1369}
1370
1371impl crate::typed::Command for GetComputedStyleForNodeParams {
1372    const METHOD: &'static str = "CSS.getComputedStyleForNode";
1373    type Returns = GetComputedStyleForNodeReturns;
1374}
1375
1376/// Resolve the specified values in the context of the provided element. For
1377/// example, a value of '1em' is evaluated according to the computed
1378/// 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved
1379/// to '3px'. If the `propertyName` was specified the `values` are resolved as
1380/// if they were property's declaration. If a value cannot be parsed according
1381/// to the provided property syntax, the value is parsed using combined syntax
1382/// as if null `propertyName` was provided. If the value cannot be resolved
1383/// even then, return the provided value without any changes. Note: this
1384/// function currently does not resolve CSS random() function, it returns
1385/// unmodified random() function parts.`
1386///
1387/// Experimental: may change without notice.
1388///
1389/// Parameters of `CSS.resolveValues`.
1390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1391pub struct ResolveValuesParams {
1392    /// Cascade-dependent keywords (revert/revert-layer) do not work.
1393    pub values: Vec<String>,
1394    /// Id of the node in whose context the expression is evaluated
1395    #[serde(rename = "nodeId")]
1396    pub node_id: crate::protocol::dom::NodeId,
1397    /// Only longhands and custom property names are accepted.
1398    #[serde(
1399        rename = "propertyName",
1400        default,
1401        skip_serializing_if = "Option::is_none"
1402    )]
1403    pub property_name: Option<String>,
1404    /// Pseudo element type, only works for pseudo elements that generate elements
1405    /// in the tree, such as ::before and ::after.
1406    #[serde(
1407        rename = "pseudoType",
1408        default,
1409        skip_serializing_if = "Option::is_none"
1410    )]
1411    pub pseudo_type: Option<crate::protocol::dom::PseudoType>,
1412    /// Pseudo element custom ident.
1413    #[serde(
1414        rename = "pseudoIdentifier",
1415        default,
1416        skip_serializing_if = "Option::is_none"
1417    )]
1418    pub pseudo_identifier: Option<String>,
1419}
1420
1421/// What `CSS.resolveValues` answers with.
1422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1423pub struct ResolveValuesReturns {
1424    pub results: Vec<String>,
1425}
1426
1427impl crate::typed::Command for ResolveValuesParams {
1428    const METHOD: &'static str = "CSS.resolveValues";
1429    type Returns = ResolveValuesReturns;
1430}
1431
1432/// Experimental: may change without notice.
1433///
1434/// Parameters of `CSS.getLonghandProperties`.
1435#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1436pub struct GetLonghandPropertiesParams {
1437    #[serde(rename = "shorthandName")]
1438    pub shorthand_name: String,
1439    pub value: String,
1440}
1441
1442/// What `CSS.getLonghandProperties` answers with.
1443#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1444pub struct GetLonghandPropertiesReturns {
1445    #[serde(rename = "longhandProperties")]
1446    pub longhand_properties: Vec<CssProperty>,
1447}
1448
1449impl crate::typed::Command for GetLonghandPropertiesParams {
1450    const METHOD: &'static str = "CSS.getLonghandProperties";
1451    type Returns = GetLonghandPropertiesReturns;
1452}
1453
1454/// Returns the styles defined inline (explicitly in the "style" attribute and
1455/// implicitly, using DOM attributes) for a DOM node identified by `nodeId`.
1456///
1457/// Parameters of `CSS.getInlineStylesForNode`.
1458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1459pub struct GetInlineStylesForNodeParams {
1460    #[serde(rename = "nodeId")]
1461    pub node_id: crate::protocol::dom::NodeId,
1462}
1463
1464/// What `CSS.getInlineStylesForNode` answers with.
1465#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1466pub struct GetInlineStylesForNodeReturns {
1467    /// Inline style for the specified DOM node.
1468    #[serde(
1469        rename = "inlineStyle",
1470        default,
1471        skip_serializing_if = "Option::is_none"
1472    )]
1473    pub inline_style: Option<CssStyle>,
1474    /// Attribute-defined element style (e.g. resulting from "width=20
1475    /// height=100%").
1476    #[serde(
1477        rename = "attributesStyle",
1478        default,
1479        skip_serializing_if = "Option::is_none"
1480    )]
1481    pub attributes_style: Option<CssStyle>,
1482}
1483
1484impl crate::typed::Command for GetInlineStylesForNodeParams {
1485    const METHOD: &'static str = "CSS.getInlineStylesForNode";
1486    type Returns = GetInlineStylesForNodeReturns;
1487}
1488
1489/// Returns the styles coming from animations & transitions including the
1490/// animation & transition styles coming from inheritance chain.
1491///
1492/// Experimental: may change without notice.
1493///
1494/// Parameters of `CSS.getAnimatedStylesForNode`.
1495#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1496pub struct GetAnimatedStylesForNodeParams {
1497    #[serde(rename = "nodeId")]
1498    pub node_id: crate::protocol::dom::NodeId,
1499}
1500
1501/// What `CSS.getAnimatedStylesForNode` answers with.
1502#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1503pub struct GetAnimatedStylesForNodeReturns {
1504    /// Styles coming from animations.
1505    #[serde(
1506        rename = "animationStyles",
1507        default,
1508        skip_serializing_if = "Option::is_none"
1509    )]
1510    pub animation_styles: Option<Vec<CssAnimationStyle>>,
1511    /// Style coming from transitions.
1512    #[serde(
1513        rename = "transitionsStyle",
1514        default,
1515        skip_serializing_if = "Option::is_none"
1516    )]
1517    pub transitions_style: Option<CssStyle>,
1518    /// Inherited style entries for animationsStyle and transitionsStyle from the
1519    /// inheritance chain of the element.
1520    #[serde(default, skip_serializing_if = "Option::is_none")]
1521    pub inherited: Option<Vec<InheritedAnimatedStyleEntry>>,
1522}
1523
1524impl crate::typed::Command for GetAnimatedStylesForNodeParams {
1525    const METHOD: &'static str = "CSS.getAnimatedStylesForNode";
1526    type Returns = GetAnimatedStylesForNodeReturns;
1527}
1528
1529/// Returns requested styles for a DOM node identified by `nodeId`.
1530///
1531/// Parameters of `CSS.getMatchedStylesForNode`.
1532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1533pub struct GetMatchedStylesForNodeParams {
1534    #[serde(rename = "nodeId")]
1535    pub node_id: crate::protocol::dom::NodeId,
1536}
1537
1538/// What `CSS.getMatchedStylesForNode` answers with.
1539#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1540pub struct GetMatchedStylesForNodeReturns {
1541    /// Inline style for the specified DOM node.
1542    #[serde(
1543        rename = "inlineStyle",
1544        default,
1545        skip_serializing_if = "Option::is_none"
1546    )]
1547    pub inline_style: Option<CssStyle>,
1548    /// Attribute-defined element style (e.g. resulting from "width=20
1549    /// height=100%").
1550    #[serde(
1551        rename = "attributesStyle",
1552        default,
1553        skip_serializing_if = "Option::is_none"
1554    )]
1555    pub attributes_style: Option<CssStyle>,
1556    /// CSS rules matching this node, from all applicable stylesheets.
1557    #[serde(
1558        rename = "matchedCSSRules",
1559        default,
1560        skip_serializing_if = "Option::is_none"
1561    )]
1562    pub matched_css_rules: Option<Vec<RuleMatch>>,
1563    /// Pseudo style matches for this node.
1564    #[serde(
1565        rename = "pseudoElements",
1566        default,
1567        skip_serializing_if = "Option::is_none"
1568    )]
1569    pub pseudo_elements: Option<Vec<PseudoElementMatches>>,
1570    /// A chain of inherited styles (from the immediate node parent up to the DOM
1571    /// tree root).
1572    #[serde(default, skip_serializing_if = "Option::is_none")]
1573    pub inherited: Option<Vec<InheritedStyleEntry>>,
1574    /// A chain of inherited pseudo element styles (from the immediate node parent
1575    /// up to the DOM tree root).
1576    #[serde(
1577        rename = "inheritedPseudoElements",
1578        default,
1579        skip_serializing_if = "Option::is_none"
1580    )]
1581    pub inherited_pseudo_elements: Option<Vec<InheritedPseudoElementMatches>>,
1582    /// A list of CSS keyframed animations matching this node.
1583    #[serde(
1584        rename = "cssKeyframesRules",
1585        default,
1586        skip_serializing_if = "Option::is_none"
1587    )]
1588    pub css_keyframes_rules: Option<Vec<CssKeyframesRule>>,
1589    /// A list of CSS @position-try rules matching this node, based on the
1590    /// position-try-fallbacks property.
1591    #[serde(
1592        rename = "cssPositionTryRules",
1593        default,
1594        skip_serializing_if = "Option::is_none"
1595    )]
1596    pub css_position_try_rules: Option<Vec<CssPositionTryRule>>,
1597    /// Index of the active fallback in the applied position-try-fallback
1598    /// property, will not be set if there is no active position-try fallback.
1599    #[serde(
1600        rename = "activePositionFallbackIndex",
1601        default,
1602        skip_serializing_if = "Option::is_none"
1603    )]
1604    pub active_position_fallback_index: Option<i64>,
1605    /// A list of CSS at-property rules matching this node.
1606    #[serde(
1607        rename = "cssPropertyRules",
1608        default,
1609        skip_serializing_if = "Option::is_none"
1610    )]
1611    pub css_property_rules: Option<Vec<CssPropertyRule>>,
1612    /// A list of CSS property registrations matching this node.
1613    #[serde(
1614        rename = "cssPropertyRegistrations",
1615        default,
1616        skip_serializing_if = "Option::is_none"
1617    )]
1618    pub css_property_registrations: Option<Vec<CssPropertyRegistration>>,
1619    /// A list of simple @rules matching this node or its pseudo-elements.
1620    #[serde(
1621        rename = "cssAtRules",
1622        default,
1623        skip_serializing_if = "Option::is_none"
1624    )]
1625    pub css_at_rules: Option<Vec<CssAtRule>>,
1626    /// Id of the first parent element that does not have display: contents.
1627    ///
1628    /// Experimental: may change without notice.
1629    #[serde(
1630        rename = "parentLayoutNodeId",
1631        default,
1632        skip_serializing_if = "Option::is_none"
1633    )]
1634    pub parent_layout_node_id: Option<crate::protocol::dom::NodeId>,
1635    /// A list of CSS at-function rules referenced by styles of this node.
1636    ///
1637    /// Experimental: may change without notice.
1638    #[serde(
1639        rename = "cssFunctionRules",
1640        default,
1641        skip_serializing_if = "Option::is_none"
1642    )]
1643    pub css_function_rules: Option<Vec<CssFunctionRule>>,
1644}
1645
1646impl crate::typed::Command for GetMatchedStylesForNodeParams {
1647    const METHOD: &'static str = "CSS.getMatchedStylesForNode";
1648    type Returns = GetMatchedStylesForNodeReturns;
1649}
1650
1651/// Returns the values of the default UA-defined environment variables used in
1652/// env()
1653///
1654/// Experimental: may change without notice.
1655///
1656/// Parameters of `CSS.getEnvironmentVariables`.
1657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1658pub struct GetEnvironmentVariablesParams {}
1659
1660/// What `CSS.getEnvironmentVariables` answers with.
1661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1662pub struct GetEnvironmentVariablesReturns {
1663    #[serde(rename = "environmentVariables")]
1664    pub environment_variables: serde_json::Value,
1665}
1666
1667impl crate::typed::Command for GetEnvironmentVariablesParams {
1668    const METHOD: &'static str = "CSS.getEnvironmentVariables";
1669    type Returns = GetEnvironmentVariablesReturns;
1670}
1671
1672/// Returns all media queries parsed by the rendering engine.
1673///
1674/// Parameters of `CSS.getMediaQueries`.
1675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1676pub struct GetMediaQueriesParams {}
1677
1678/// What `CSS.getMediaQueries` answers with.
1679#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1680pub struct GetMediaQueriesReturns {
1681    pub medias: Vec<CssMedia>,
1682}
1683
1684impl crate::typed::Command for GetMediaQueriesParams {
1685    const METHOD: &'static str = "CSS.getMediaQueries";
1686    type Returns = GetMediaQueriesReturns;
1687}
1688
1689/// Requests information about platform fonts which we used to render child
1690/// TextNodes in the given node.
1691///
1692/// Parameters of `CSS.getPlatformFontsForNode`.
1693#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1694pub struct GetPlatformFontsForNodeParams {
1695    #[serde(rename = "nodeId")]
1696    pub node_id: crate::protocol::dom::NodeId,
1697}
1698
1699/// What `CSS.getPlatformFontsForNode` answers with.
1700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1701pub struct GetPlatformFontsForNodeReturns {
1702    /// Usage statistics for every employed platform font.
1703    pub fonts: Vec<PlatformFontUsage>,
1704}
1705
1706impl crate::typed::Command for GetPlatformFontsForNodeParams {
1707    const METHOD: &'static str = "CSS.getPlatformFontsForNode";
1708    type Returns = GetPlatformFontsForNodeReturns;
1709}
1710
1711/// Returns the current textual content for a stylesheet.
1712///
1713/// Parameters of `CSS.getStyleSheetText`.
1714#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1715pub struct GetStyleSheetTextParams {
1716    #[serde(rename = "styleSheetId")]
1717    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1718}
1719
1720/// What `CSS.getStyleSheetText` answers with.
1721#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1722pub struct GetStyleSheetTextReturns {
1723    /// The stylesheet text.
1724    pub text: String,
1725}
1726
1727impl crate::typed::Command for GetStyleSheetTextParams {
1728    const METHOD: &'static str = "CSS.getStyleSheetText";
1729    type Returns = GetStyleSheetTextReturns;
1730}
1731
1732/// Returns all layers parsed by the rendering engine for the tree scope of a
1733/// node. Given a DOM element identified by nodeId, getLayersForNode returns
1734/// the root layer for the nearest ancestor document or shadow root. The layer
1735/// root contains the full layer tree for the tree scope and their ordering.
1736///
1737/// Experimental: may change without notice.
1738///
1739/// Parameters of `CSS.getLayersForNode`.
1740#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1741pub struct GetLayersForNodeParams {
1742    #[serde(rename = "nodeId")]
1743    pub node_id: crate::protocol::dom::NodeId,
1744}
1745
1746/// What `CSS.getLayersForNode` answers with.
1747#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1748pub struct GetLayersForNodeReturns {
1749    #[serde(rename = "rootLayer")]
1750    pub root_layer: CssLayerData,
1751}
1752
1753impl crate::typed::Command for GetLayersForNodeParams {
1754    const METHOD: &'static str = "CSS.getLayersForNode";
1755    type Returns = GetLayersForNodeReturns;
1756}
1757
1758/// Given a CSS selector text and a style sheet ID, getLocationForSelector
1759/// returns an array of locations of the CSS selector in the style sheet.
1760///
1761/// Experimental: may change without notice.
1762///
1763/// Parameters of `CSS.getLocationForSelector`.
1764#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1765pub struct GetLocationForSelectorParams {
1766    #[serde(rename = "styleSheetId")]
1767    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1768    #[serde(rename = "selectorText")]
1769    pub selector_text: String,
1770}
1771
1772/// What `CSS.getLocationForSelector` answers with.
1773#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1774pub struct GetLocationForSelectorReturns {
1775    pub ranges: Vec<SourceRange>,
1776}
1777
1778impl crate::typed::Command for GetLocationForSelectorParams {
1779    const METHOD: &'static str = "CSS.getLocationForSelector";
1780    type Returns = GetLocationForSelectorReturns;
1781}
1782
1783/// Starts tracking the given node for the computed style updates and whenever
1784/// the computed style is updated for node, it queues a `computedStyleUpdated`
1785/// event with throttling. There can only be 1 node tracked for computed style
1786/// updates so passing a new node id removes tracking from the previous node.
1787/// Pass `undefined` to disable tracking.
1788///
1789/// Experimental: may change without notice.
1790///
1791/// Parameters of `CSS.trackComputedStyleUpdatesForNode`.
1792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1793pub struct TrackComputedStyleUpdatesForNodeParams {
1794    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
1795    pub node_id: Option<crate::protocol::dom::NodeId>,
1796}
1797
1798impl crate::typed::Command for TrackComputedStyleUpdatesForNodeParams {
1799    const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode";
1800    type Returns = crate::typed::NoReturns;
1801}
1802
1803/// Starts tracking the given computed styles for updates. The specified array
1804/// of properties replaces the one previously specified. Pass empty array to
1805/// disable tracking. Use takeComputedStyleUpdates to retrieve the list of
1806/// nodes that had properties modified. The changes to computed style
1807/// properties are only tracked for nodes pushed to the front-end by the DOM
1808/// agent. If no changes to the tracked properties occur after the node has
1809/// been pushed to the front-end, no updates will be issued for the node.
1810///
1811/// Experimental: may change without notice.
1812///
1813/// Parameters of `CSS.trackComputedStyleUpdates`.
1814#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1815pub struct TrackComputedStyleUpdatesParams {
1816    #[serde(rename = "propertiesToTrack")]
1817    pub properties_to_track: Vec<CssComputedStyleProperty>,
1818}
1819
1820impl crate::typed::Command for TrackComputedStyleUpdatesParams {
1821    const METHOD: &'static str = "CSS.trackComputedStyleUpdates";
1822    type Returns = crate::typed::NoReturns;
1823}
1824
1825/// Polls the next batch of computed style updates.
1826///
1827/// Experimental: may change without notice.
1828///
1829/// Parameters of `CSS.takeComputedStyleUpdates`.
1830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1831pub struct TakeComputedStyleUpdatesParams {}
1832
1833/// What `CSS.takeComputedStyleUpdates` answers with.
1834#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1835pub struct TakeComputedStyleUpdatesReturns {
1836    /// The list of node Ids that have their tracked computed styles updated.
1837    #[serde(rename = "nodeIds")]
1838    pub node_ids: Vec<crate::protocol::dom::NodeId>,
1839}
1840
1841impl crate::typed::Command for TakeComputedStyleUpdatesParams {
1842    const METHOD: &'static str = "CSS.takeComputedStyleUpdates";
1843    type Returns = TakeComputedStyleUpdatesReturns;
1844}
1845
1846/// Find a rule with the given active property for the given node and set the
1847/// new value for this property
1848///
1849/// Parameters of `CSS.setEffectivePropertyValueForNode`.
1850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1851pub struct SetEffectivePropertyValueForNodeParams {
1852    /// The element id for which to set property.
1853    #[serde(rename = "nodeId")]
1854    pub node_id: crate::protocol::dom::NodeId,
1855    #[serde(rename = "propertyName")]
1856    pub property_name: String,
1857    pub value: String,
1858}
1859
1860impl crate::typed::Command for SetEffectivePropertyValueForNodeParams {
1861    const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode";
1862    type Returns = crate::typed::NoReturns;
1863}
1864
1865/// Modifies the property rule property name.
1866///
1867/// Parameters of `CSS.setPropertyRulePropertyName`.
1868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1869pub struct SetPropertyRulePropertyNameParams {
1870    #[serde(rename = "styleSheetId")]
1871    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1872    pub range: SourceRange,
1873    #[serde(rename = "propertyName")]
1874    pub property_name: String,
1875}
1876
1877/// What `CSS.setPropertyRulePropertyName` answers with.
1878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1879pub struct SetPropertyRulePropertyNameReturns {
1880    /// The resulting key text after modification.
1881    #[serde(rename = "propertyName")]
1882    pub property_name: Value,
1883}
1884
1885impl crate::typed::Command for SetPropertyRulePropertyNameParams {
1886    const METHOD: &'static str = "CSS.setPropertyRulePropertyName";
1887    type Returns = SetPropertyRulePropertyNameReturns;
1888}
1889
1890/// Modifies the keyframe rule key text.
1891///
1892/// Parameters of `CSS.setKeyframeKey`.
1893#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1894pub struct SetKeyframeKeyParams {
1895    #[serde(rename = "styleSheetId")]
1896    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1897    pub range: SourceRange,
1898    #[serde(rename = "keyText")]
1899    pub key_text: String,
1900}
1901
1902/// What `CSS.setKeyframeKey` answers with.
1903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1904pub struct SetKeyframeKeyReturns {
1905    /// The resulting key text after modification.
1906    #[serde(rename = "keyText")]
1907    pub key_text: Value,
1908}
1909
1910impl crate::typed::Command for SetKeyframeKeyParams {
1911    const METHOD: &'static str = "CSS.setKeyframeKey";
1912    type Returns = SetKeyframeKeyReturns;
1913}
1914
1915/// Modifies the rule selector.
1916///
1917/// Parameters of `CSS.setMediaText`.
1918#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1919pub struct SetMediaTextParams {
1920    #[serde(rename = "styleSheetId")]
1921    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1922    pub range: SourceRange,
1923    pub text: String,
1924}
1925
1926/// What `CSS.setMediaText` answers with.
1927#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1928pub struct SetMediaTextReturns {
1929    /// The resulting CSS media rule after modification.
1930    pub media: CssMedia,
1931}
1932
1933impl crate::typed::Command for SetMediaTextParams {
1934    const METHOD: &'static str = "CSS.setMediaText";
1935    type Returns = SetMediaTextReturns;
1936}
1937
1938/// Modifies the expression of a container query. Deprecated. Use
1939/// setContainerQueryConditionText instead.
1940///
1941/// Deprecated in the protocol.
1942///
1943/// Experimental: may change without notice.
1944///
1945/// Parameters of `CSS.setContainerQueryText`.
1946#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1947pub struct SetContainerQueryTextParams {
1948    #[serde(rename = "styleSheetId")]
1949    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1950    pub range: SourceRange,
1951    pub text: String,
1952}
1953
1954/// What `CSS.setContainerQueryText` answers with.
1955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1956pub struct SetContainerQueryTextReturns {
1957    /// The resulting CSS container query rule after modification.
1958    #[serde(rename = "containerQuery")]
1959    pub container_query: CssContainerQuery,
1960}
1961
1962impl crate::typed::Command for SetContainerQueryTextParams {
1963    const METHOD: &'static str = "CSS.setContainerQueryText";
1964    type Returns = SetContainerQueryTextReturns;
1965}
1966
1967/// Experimental: may change without notice.
1968///
1969/// Parameters of `CSS.setContainerQueryConditionText`.
1970#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1971pub struct SetContainerQueryConditionTextParams {
1972    #[serde(rename = "styleSheetId")]
1973    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
1974    pub range: SourceRange,
1975    pub text: String,
1976}
1977
1978/// What `CSS.setContainerQueryConditionText` answers with.
1979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1980pub struct SetContainerQueryConditionTextReturns {
1981    /// The resulting CSS container query rule after modification.
1982    #[serde(rename = "containerQuery")]
1983    pub container_query: CssContainerQuery,
1984}
1985
1986impl crate::typed::Command for SetContainerQueryConditionTextParams {
1987    const METHOD: &'static str = "CSS.setContainerQueryConditionText";
1988    type Returns = SetContainerQueryConditionTextReturns;
1989}
1990
1991/// Modifies the expression of a supports at-rule.
1992///
1993/// Experimental: may change without notice.
1994///
1995/// Parameters of `CSS.setSupportsText`.
1996#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1997pub struct SetSupportsTextParams {
1998    #[serde(rename = "styleSheetId")]
1999    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2000    pub range: SourceRange,
2001    pub text: String,
2002}
2003
2004/// What `CSS.setSupportsText` answers with.
2005#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2006pub struct SetSupportsTextReturns {
2007    /// The resulting CSS Supports rule after modification.
2008    pub supports: CssSupports,
2009}
2010
2011impl crate::typed::Command for SetSupportsTextParams {
2012    const METHOD: &'static str = "CSS.setSupportsText";
2013    type Returns = SetSupportsTextReturns;
2014}
2015
2016/// Modifies the expression of a navigation at-rule.
2017///
2018/// Experimental: may change without notice.
2019///
2020/// Parameters of `CSS.setNavigationText`.
2021#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2022pub struct SetNavigationTextParams {
2023    #[serde(rename = "styleSheetId")]
2024    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2025    pub range: SourceRange,
2026    pub text: String,
2027}
2028
2029/// What `CSS.setNavigationText` answers with.
2030#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2031pub struct SetNavigationTextReturns {
2032    /// The resulting CSS Navigation rule after modification.
2033    pub navigation: CssNavigation,
2034}
2035
2036impl crate::typed::Command for SetNavigationTextParams {
2037    const METHOD: &'static str = "CSS.setNavigationText";
2038    type Returns = SetNavigationTextReturns;
2039}
2040
2041/// Modifies the expression of a scope at-rule.
2042///
2043/// Experimental: may change without notice.
2044///
2045/// Parameters of `CSS.setScopeText`.
2046#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2047pub struct SetScopeTextParams {
2048    #[serde(rename = "styleSheetId")]
2049    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2050    pub range: SourceRange,
2051    pub text: String,
2052}
2053
2054/// What `CSS.setScopeText` answers with.
2055#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2056pub struct SetScopeTextReturns {
2057    /// The resulting CSS Scope rule after modification.
2058    pub scope: CssScope,
2059}
2060
2061impl crate::typed::Command for SetScopeTextParams {
2062    const METHOD: &'static str = "CSS.setScopeText";
2063    type Returns = SetScopeTextReturns;
2064}
2065
2066/// Modifies the rule selector.
2067///
2068/// Parameters of `CSS.setRuleSelector`.
2069#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2070pub struct SetRuleSelectorParams {
2071    #[serde(rename = "styleSheetId")]
2072    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2073    pub range: SourceRange,
2074    pub selector: String,
2075}
2076
2077/// What `CSS.setRuleSelector` answers with.
2078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2079pub struct SetRuleSelectorReturns {
2080    /// The resulting selector list after modification.
2081    #[serde(rename = "selectorList")]
2082    pub selector_list: SelectorList,
2083}
2084
2085impl crate::typed::Command for SetRuleSelectorParams {
2086    const METHOD: &'static str = "CSS.setRuleSelector";
2087    type Returns = SetRuleSelectorReturns;
2088}
2089
2090/// Sets the new stylesheet text.
2091///
2092/// Parameters of `CSS.setStyleSheetText`.
2093#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2094pub struct SetStyleSheetTextParams {
2095    #[serde(rename = "styleSheetId")]
2096    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2097    pub text: String,
2098}
2099
2100/// What `CSS.setStyleSheetText` answers with.
2101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2102pub struct SetStyleSheetTextReturns {
2103    /// URL of source map associated with script (if any).
2104    #[serde(
2105        rename = "sourceMapURL",
2106        default,
2107        skip_serializing_if = "Option::is_none"
2108    )]
2109    pub source_map_url: Option<String>,
2110}
2111
2112impl crate::typed::Command for SetStyleSheetTextParams {
2113    const METHOD: &'static str = "CSS.setStyleSheetText";
2114    type Returns = SetStyleSheetTextReturns;
2115}
2116
2117/// Applies specified style edits one after another in the given order.
2118///
2119/// Parameters of `CSS.setStyleTexts`.
2120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2121pub struct SetStyleTextsParams {
2122    pub edits: Vec<StyleDeclarationEdit>,
2123    /// NodeId for the DOM node in whose context custom property declarations for
2124    /// registered properties should be validated. If omitted, declarations in the
2125    /// new rule text can only be validated statically, which may produce
2126    /// incorrect results if the declaration contains a var() for example.
2127    ///
2128    /// Experimental: may change without notice.
2129    #[serde(
2130        rename = "nodeForPropertySyntaxValidation",
2131        default,
2132        skip_serializing_if = "Option::is_none"
2133    )]
2134    pub node_for_property_syntax_validation: Option<crate::protocol::dom::NodeId>,
2135}
2136
2137/// What `CSS.setStyleTexts` answers with.
2138#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2139pub struct SetStyleTextsReturns {
2140    /// The resulting styles after modification.
2141    pub styles: Vec<CssStyle>,
2142}
2143
2144impl crate::typed::Command for SetStyleTextsParams {
2145    const METHOD: &'static str = "CSS.setStyleTexts";
2146    type Returns = SetStyleTextsReturns;
2147}
2148
2149/// Enables the selector recording.
2150///
2151/// Parameters of `CSS.startRuleUsageTracking`.
2152#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2153pub struct StartRuleUsageTrackingParams {}
2154
2155impl crate::typed::Command for StartRuleUsageTrackingParams {
2156    const METHOD: &'static str = "CSS.startRuleUsageTracking";
2157    type Returns = crate::typed::NoReturns;
2158}
2159
2160/// Stop tracking rule usage and return the list of rules that were used since
2161/// last call to `takeCoverageDelta` (or since start of coverage
2162/// instrumentation).
2163///
2164/// Parameters of `CSS.stopRuleUsageTracking`.
2165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2166pub struct StopRuleUsageTrackingParams {}
2167
2168/// What `CSS.stopRuleUsageTracking` answers with.
2169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2170pub struct StopRuleUsageTrackingReturns {
2171    #[serde(rename = "ruleUsage")]
2172    pub rule_usage: Vec<RuleUsage>,
2173}
2174
2175impl crate::typed::Command for StopRuleUsageTrackingParams {
2176    const METHOD: &'static str = "CSS.stopRuleUsageTracking";
2177    type Returns = StopRuleUsageTrackingReturns;
2178}
2179
2180/// Obtain list of rules that became used since last call to this method (or
2181/// since start of coverage instrumentation).
2182///
2183/// Parameters of `CSS.takeCoverageDelta`.
2184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2185pub struct TakeCoverageDeltaParams {}
2186
2187/// What `CSS.takeCoverageDelta` answers with.
2188#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2189pub struct TakeCoverageDeltaReturns {
2190    pub coverage: Vec<RuleUsage>,
2191    /// Monotonically increasing time, in seconds.
2192    pub timestamp: f64,
2193}
2194
2195impl crate::typed::Command for TakeCoverageDeltaParams {
2196    const METHOD: &'static str = "CSS.takeCoverageDelta";
2197    type Returns = TakeCoverageDeltaReturns;
2198}
2199
2200/// Enables/disables rendering of local CSS fonts (enabled by default).
2201///
2202/// Experimental: may change without notice.
2203///
2204/// Parameters of `CSS.setLocalFontsEnabled`.
2205#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2206pub struct SetLocalFontsEnabledParams {
2207    /// Whether rendering of local fonts is enabled.
2208    pub enabled: bool,
2209}
2210
2211impl crate::typed::Command for SetLocalFontsEnabledParams {
2212    const METHOD: &'static str = "CSS.setLocalFontsEnabled";
2213    type Returns = crate::typed::NoReturns;
2214}
2215
2216/// Fires whenever a web font is updated. A non-empty font parameter indicates
2217/// a successfully loaded web font.
2218///
2219/// Payload of the `CSS.fontsUpdated` event.
2220#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2221pub struct FontsUpdatedEvent {
2222    /// The web font that has loaded.
2223    #[serde(default, skip_serializing_if = "Option::is_none")]
2224    pub font: Option<FontFace>,
2225}
2226
2227impl crate::typed::Event for FontsUpdatedEvent {
2228    const METHOD: &'static str = "CSS.fontsUpdated";
2229}
2230
2231/// Fires whenever a MediaQuery result changes (for example, after a browser
2232/// window has been resized.) The current implementation considers only
2233/// viewport-dependent media features.
2234///
2235/// Payload of the `CSS.mediaQueryResultChanged` event.
2236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2237pub struct MediaQueryResultChangedEvent {}
2238
2239impl crate::typed::Event for MediaQueryResultChangedEvent {
2240    const METHOD: &'static str = "CSS.mediaQueryResultChanged";
2241}
2242
2243/// Fired whenever an active document stylesheet is added.
2244///
2245/// Payload of the `CSS.styleSheetAdded` event.
2246#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2247pub struct StyleSheetAddedEvent {
2248    /// Added stylesheet metainfo.
2249    pub header: CssStyleSheetHeader,
2250}
2251
2252impl crate::typed::Event for StyleSheetAddedEvent {
2253    const METHOD: &'static str = "CSS.styleSheetAdded";
2254}
2255
2256/// Fired whenever a stylesheet is changed as a result of the client
2257/// operation.
2258///
2259/// Payload of the `CSS.styleSheetChanged` event.
2260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2261pub struct StyleSheetChangedEvent {
2262    #[serde(rename = "styleSheetId")]
2263    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2264}
2265
2266impl crate::typed::Event for StyleSheetChangedEvent {
2267    const METHOD: &'static str = "CSS.styleSheetChanged";
2268}
2269
2270/// Fired whenever an active document stylesheet is removed.
2271///
2272/// Payload of the `CSS.styleSheetRemoved` event.
2273#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2274pub struct StyleSheetRemovedEvent {
2275    /// Identifier of the removed stylesheet.
2276    #[serde(rename = "styleSheetId")]
2277    pub style_sheet_id: crate::protocol::dom::StyleSheetId,
2278}
2279
2280impl crate::typed::Event for StyleSheetRemovedEvent {
2281    const METHOD: &'static str = "CSS.styleSheetRemoved";
2282}
2283
2284/// Experimental: may change without notice.
2285///
2286/// Payload of the `CSS.computedStyleUpdated` event.
2287#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2288pub struct ComputedStyleUpdatedEvent {
2289    /// The node id that has updated computed styles.
2290    #[serde(rename = "nodeId")]
2291    pub node_id: crate::protocol::dom::NodeId,
2292}
2293
2294impl crate::typed::Event for ComputedStyleUpdatedEvent {
2295    const METHOD: &'static str = "CSS.computedStyleUpdated";
2296}