Skip to main content

browser_protocol/css/
mod.rs

1//! This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)
2//! have an associated 'id' used in subsequent operations on the related object. Each object type has
3//! a specific 'id' structure, and those are not interchangeable between objects of different kinds.
4//! CSS objects can be loaded using the 'get*ForNode()' calls (which accept a DOM node id). A client
5//! can also keep track of stylesheets via the 'styleSheetAdded'/'styleSheetRemoved' events and
6//! subsequently load the required stylesheet contents using the 'getStyleSheet\[Text\]()' methods.
7
8
9use serde::{Serialize, Deserialize};
10use serde_json::Value as JsonValue;
11use std::borrow::Cow;
12
13/// Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent
14/// stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via
15/// inspector" rules), "regular" for regular stylesheets.
16
17#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
18pub enum StyleSheetOrigin {
19    #[default]
20    #[serde(rename = "injected")]
21    Injected,
22    #[serde(rename = "user-agent")]
23    UserAgent,
24    #[serde(rename = "inspector")]
25    Inspector,
26    #[serde(rename = "regular")]
27    Regular,
28}
29
30/// CSS rule collection for a single pseudo style.
31
32#[derive(Debug, Clone, Serialize, Deserialize, Default)]
33#[serde(rename_all = "camelCase")]
34pub struct PseudoElementMatches<'a> {
35    /// Pseudo element type.
36    #[serde(rename = "pseudoType")]
37    pseudo_type: crate::dom::PseudoType,
38    /// Pseudo element custom ident.
39    #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
40    pseudo_identifier: Option<Cow<'a, str>>,
41    /// Matches of CSS rules applicable to the pseudo style.
42    matches: Vec<RuleMatch<'a>>,
43}
44
45impl<'a> PseudoElementMatches<'a> {
46    /// Creates a builder for this type with the required parameters:
47    /// * `pseudo_type`: Pseudo element type.
48    /// * `matches`: Matches of CSS rules applicable to the pseudo style.
49    pub fn builder(pseudo_type: crate::dom::PseudoType, matches: Vec<RuleMatch<'a>>) -> PseudoElementMatchesBuilder<'a> {
50        PseudoElementMatchesBuilder {
51            pseudo_type: pseudo_type,
52            pseudo_identifier: None,
53            matches: matches,
54        }
55    }
56    /// Pseudo element type.
57    pub fn pseudo_type(&self) -> &crate::dom::PseudoType { &self.pseudo_type }
58    /// Pseudo element custom ident.
59    pub fn pseudo_identifier(&self) -> Option<&str> { self.pseudo_identifier.as_deref() }
60    /// Matches of CSS rules applicable to the pseudo style.
61    pub fn matches(&self) -> &[RuleMatch<'a>] { &self.matches }
62}
63
64
65pub struct PseudoElementMatchesBuilder<'a> {
66    pseudo_type: crate::dom::PseudoType,
67    pseudo_identifier: Option<Cow<'a, str>>,
68    matches: Vec<RuleMatch<'a>>,
69}
70
71impl<'a> PseudoElementMatchesBuilder<'a> {
72    /// Pseudo element custom ident.
73    pub fn pseudo_identifier(mut self, pseudo_identifier: impl Into<Cow<'a, str>>) -> Self { self.pseudo_identifier = Some(pseudo_identifier.into()); self }
74    pub fn build(self) -> PseudoElementMatches<'a> {
75        PseudoElementMatches {
76            pseudo_type: self.pseudo_type,
77            pseudo_identifier: self.pseudo_identifier,
78            matches: self.matches,
79        }
80    }
81}
82
83/// CSS style coming from animations with the name of the animation.
84
85#[derive(Debug, Clone, Serialize, Deserialize, Default)]
86#[serde(rename_all = "camelCase")]
87pub struct CSSAnimationStyle<'a> {
88    /// The name of the animation.
89    #[serde(skip_serializing_if = "Option::is_none")]
90    name: Option<Cow<'a, str>>,
91    /// The style coming from the animation.
92    style: CSSStyle<'a>,
93}
94
95impl<'a> CSSAnimationStyle<'a> {
96    /// Creates a builder for this type with the required parameters:
97    /// * `style`: The style coming from the animation.
98    pub fn builder(style: CSSStyle<'a>) -> CSSAnimationStyleBuilder<'a> {
99        CSSAnimationStyleBuilder {
100            name: None,
101            style: style,
102        }
103    }
104    /// The name of the animation.
105    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
106    /// The style coming from the animation.
107    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
108}
109
110
111pub struct CSSAnimationStyleBuilder<'a> {
112    name: Option<Cow<'a, str>>,
113    style: CSSStyle<'a>,
114}
115
116impl<'a> CSSAnimationStyleBuilder<'a> {
117    /// The name of the animation.
118    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
119    pub fn build(self) -> CSSAnimationStyle<'a> {
120        CSSAnimationStyle {
121            name: self.name,
122            style: self.style,
123        }
124    }
125}
126
127/// Inherited CSS rule collection from ancestor node.
128
129#[derive(Debug, Clone, Serialize, Deserialize, Default)]
130#[serde(rename_all = "camelCase")]
131pub struct InheritedStyleEntry<'a> {
132    /// The ancestor node's inline style, if any, in the style inheritance chain.
133    #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
134    inline_style: Option<CSSStyle<'a>>,
135    /// Matches of CSS rules matching the ancestor node in the style inheritance chain.
136    #[serde(rename = "matchedCSSRules")]
137    matched_css_rules: Vec<RuleMatch<'a>>,
138}
139
140impl<'a> InheritedStyleEntry<'a> {
141    /// Creates a builder for this type with the required parameters:
142    /// * `matched_css_rules`: Matches of CSS rules matching the ancestor node in the style inheritance chain.
143    pub fn builder(matched_css_rules: Vec<RuleMatch<'a>>) -> InheritedStyleEntryBuilder<'a> {
144        InheritedStyleEntryBuilder {
145            inline_style: None,
146            matched_css_rules: matched_css_rules,
147        }
148    }
149    /// The ancestor node's inline style, if any, in the style inheritance chain.
150    pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
151    /// Matches of CSS rules matching the ancestor node in the style inheritance chain.
152    pub fn matched_css_rules(&self) -> &[RuleMatch<'a>] { &self.matched_css_rules }
153}
154
155
156pub struct InheritedStyleEntryBuilder<'a> {
157    inline_style: Option<CSSStyle<'a>>,
158    matched_css_rules: Vec<RuleMatch<'a>>,
159}
160
161impl<'a> InheritedStyleEntryBuilder<'a> {
162    /// The ancestor node's inline style, if any, in the style inheritance chain.
163    pub fn inline_style(mut self, inline_style: CSSStyle<'a>) -> Self { self.inline_style = Some(inline_style); self }
164    pub fn build(self) -> InheritedStyleEntry<'a> {
165        InheritedStyleEntry {
166            inline_style: self.inline_style,
167            matched_css_rules: self.matched_css_rules,
168        }
169    }
170}
171
172/// Inherited CSS style collection for animated styles from ancestor node.
173
174#[derive(Debug, Clone, Serialize, Deserialize, Default)]
175#[serde(rename_all = "camelCase")]
176pub struct InheritedAnimatedStyleEntry<'a> {
177    /// Styles coming from the animations of the ancestor, if any, in the style inheritance chain.
178    #[serde(skip_serializing_if = "Option::is_none", rename = "animationStyles")]
179    animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
180    /// The style coming from the transitions of the ancestor, if any, in the style inheritance chain.
181    #[serde(skip_serializing_if = "Option::is_none", rename = "transitionsStyle")]
182    transitions_style: Option<CSSStyle<'a>>,
183}
184
185impl<'a> InheritedAnimatedStyleEntry<'a> {
186    /// Creates a builder for this type.
187    pub fn builder() -> InheritedAnimatedStyleEntryBuilder<'a> {
188        InheritedAnimatedStyleEntryBuilder {
189            animation_styles: None,
190            transitions_style: None,
191        }
192    }
193    /// Styles coming from the animations of the ancestor, if any, in the style inheritance chain.
194    pub fn animation_styles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animation_styles.as_deref() }
195    /// The style coming from the transitions of the ancestor, if any, in the style inheritance chain.
196    pub fn transitions_style(&self) -> Option<&CSSStyle<'a>> { self.transitions_style.as_ref() }
197}
198
199#[derive(Default)]
200pub struct InheritedAnimatedStyleEntryBuilder<'a> {
201    animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
202    transitions_style: Option<CSSStyle<'a>>,
203}
204
205impl<'a> InheritedAnimatedStyleEntryBuilder<'a> {
206    /// Styles coming from the animations of the ancestor, if any, in the style inheritance chain.
207    pub fn animation_styles(mut self, animation_styles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animation_styles = Some(animation_styles); self }
208    /// The style coming from the transitions of the ancestor, if any, in the style inheritance chain.
209    pub fn transitions_style(mut self, transitions_style: CSSStyle<'a>) -> Self { self.transitions_style = Some(transitions_style); self }
210    pub fn build(self) -> InheritedAnimatedStyleEntry<'a> {
211        InheritedAnimatedStyleEntry {
212            animation_styles: self.animation_styles,
213            transitions_style: self.transitions_style,
214        }
215    }
216}
217
218/// Inherited pseudo element matches from pseudos of an ancestor node.
219
220#[derive(Debug, Clone, Serialize, Deserialize, Default)]
221#[serde(rename_all = "camelCase")]
222pub struct InheritedPseudoElementMatches<'a> {
223    /// Matches of pseudo styles from the pseudos of an ancestor node.
224    #[serde(rename = "pseudoElements")]
225    pseudo_elements: Vec<PseudoElementMatches<'a>>,
226}
227
228impl<'a> InheritedPseudoElementMatches<'a> {
229    /// Creates a builder for this type with the required parameters:
230    /// * `pseudo_elements`: Matches of pseudo styles from the pseudos of an ancestor node.
231    pub fn builder(pseudo_elements: Vec<PseudoElementMatches<'a>>) -> InheritedPseudoElementMatchesBuilder<'a> {
232        InheritedPseudoElementMatchesBuilder {
233            pseudo_elements: pseudo_elements,
234        }
235    }
236    /// Matches of pseudo styles from the pseudos of an ancestor node.
237    pub fn pseudo_elements(&self) -> &[PseudoElementMatches<'a>] { &self.pseudo_elements }
238}
239
240
241pub struct InheritedPseudoElementMatchesBuilder<'a> {
242    pseudo_elements: Vec<PseudoElementMatches<'a>>,
243}
244
245impl<'a> InheritedPseudoElementMatchesBuilder<'a> {
246    pub fn build(self) -> InheritedPseudoElementMatches<'a> {
247        InheritedPseudoElementMatches {
248            pseudo_elements: self.pseudo_elements,
249        }
250    }
251}
252
253/// Match data for a CSS rule.
254
255#[derive(Debug, Clone, Serialize, Deserialize, Default)]
256#[serde(rename_all = "camelCase")]
257pub struct RuleMatch<'a> {
258    /// CSS rule in the match.
259    rule: CSSRule<'a>,
260    /// Matching selector indices in the rule's selectorList selectors (0-based).
261    #[serde(rename = "matchingSelectors")]
262    matching_selectors: Vec<i64>,
263}
264
265impl<'a> RuleMatch<'a> {
266    /// Creates a builder for this type with the required parameters:
267    /// * `rule`: CSS rule in the match.
268    /// * `matching_selectors`: Matching selector indices in the rule's selectorList selectors (0-based).
269    pub fn builder(rule: CSSRule<'a>, matching_selectors: Vec<i64>) -> RuleMatchBuilder<'a> {
270        RuleMatchBuilder {
271            rule: rule,
272            matching_selectors: matching_selectors,
273        }
274    }
275    /// CSS rule in the match.
276    pub fn rule(&self) -> &CSSRule<'a> { &self.rule }
277    /// Matching selector indices in the rule's selectorList selectors (0-based).
278    pub fn matching_selectors(&self) -> &[i64] { &self.matching_selectors }
279}
280
281
282pub struct RuleMatchBuilder<'a> {
283    rule: CSSRule<'a>,
284    matching_selectors: Vec<i64>,
285}
286
287impl<'a> RuleMatchBuilder<'a> {
288    pub fn build(self) -> RuleMatch<'a> {
289        RuleMatch {
290            rule: self.rule,
291            matching_selectors: self.matching_selectors,
292        }
293    }
294}
295
296/// Data for a simple selector (these are delimited by commas in a selector list).
297
298#[derive(Debug, Clone, Serialize, Deserialize, Default)]
299#[serde(rename_all = "camelCase")]
300pub struct ProtocolValue<'a> {
301    /// Value text.
302    text: Cow<'a, str>,
303    /// Value range in the underlying resource (if available).
304    #[serde(skip_serializing_if = "Option::is_none")]
305    range: Option<SourceRange>,
306    /// Specificity of the selector.
307    #[serde(skip_serializing_if = "Option::is_none")]
308    specificity: Option<Specificity>,
309}
310
311impl<'a> ProtocolValue<'a> {
312    /// Creates a builder for this type with the required parameters:
313    /// * `text`: Value text.
314    pub fn builder(text: impl Into<Cow<'a, str>>) -> ProtocolValueBuilder<'a> {
315        ProtocolValueBuilder {
316            text: text.into(),
317            range: None,
318            specificity: None,
319        }
320    }
321    /// Value text.
322    pub fn text(&self) -> &str { self.text.as_ref() }
323    /// Value range in the underlying resource (if available).
324    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
325    /// Specificity of the selector.
326    pub fn specificity(&self) -> Option<&Specificity> { self.specificity.as_ref() }
327}
328
329
330pub struct ProtocolValueBuilder<'a> {
331    text: Cow<'a, str>,
332    range: Option<SourceRange>,
333    specificity: Option<Specificity>,
334}
335
336impl<'a> ProtocolValueBuilder<'a> {
337    /// Value range in the underlying resource (if available).
338    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
339    /// Specificity of the selector.
340    pub fn specificity(mut self, specificity: Specificity) -> Self { self.specificity = Some(specificity); self }
341    pub fn build(self) -> ProtocolValue<'a> {
342        ProtocolValue {
343            text: self.text,
344            range: self.range,
345            specificity: self.specificity,
346        }
347    }
348}
349
350/// Specificity:
351/// <https://drafts.csswg.org/selectors/#specificity-rules>
352
353#[derive(Debug, Clone, Serialize, Deserialize, Default)]
354#[serde(rename_all = "camelCase")]
355pub struct Specificity {
356    /// The a component, which represents the number of ID selectors.
357    a: i64,
358    /// The b component, which represents the number of class selectors, attributes selectors, and
359    /// pseudo-classes.
360    b: i64,
361    /// The c component, which represents the number of type selectors and pseudo-elements.
362    c: i64,
363}
364
365impl Specificity {
366    /// Creates a builder for this type with the required parameters:
367    /// * `a`: The a component, which represents the number of ID selectors.
368    /// * `b`: The b component, which represents the number of class selectors, attributes selectors, and pseudo-classes.
369    /// * `c`: The c component, which represents the number of type selectors and pseudo-elements.
370    pub fn builder(a: i64, b: i64, c: i64) -> SpecificityBuilder {
371        SpecificityBuilder {
372            a: a,
373            b: b,
374            c: c,
375        }
376    }
377    /// The a component, which represents the number of ID selectors.
378    pub fn a(&self) -> i64 { self.a }
379    /// The b component, which represents the number of class selectors, attributes selectors, and
380    /// pseudo-classes.
381    pub fn b(&self) -> i64 { self.b }
382    /// The c component, which represents the number of type selectors and pseudo-elements.
383    pub fn c(&self) -> i64 { self.c }
384}
385
386
387pub struct SpecificityBuilder {
388    a: i64,
389    b: i64,
390    c: i64,
391}
392
393impl SpecificityBuilder {
394    pub fn build(self) -> Specificity {
395        Specificity {
396            a: self.a,
397            b: self.b,
398            c: self.c,
399        }
400    }
401}
402
403/// Selector list data.
404
405#[derive(Debug, Clone, Serialize, Deserialize, Default)]
406#[serde(rename_all = "camelCase")]
407pub struct SelectorList<'a> {
408    /// Selectors in the list.
409    selectors: Vec<ProtocolValue<'a>>,
410    /// Rule selector text.
411    text: Cow<'a, str>,
412}
413
414impl<'a> SelectorList<'a> {
415    /// Creates a builder for this type with the required parameters:
416    /// * `selectors`: Selectors in the list.
417    /// * `text`: Rule selector text.
418    pub fn builder(selectors: Vec<ProtocolValue<'a>>, text: impl Into<Cow<'a, str>>) -> SelectorListBuilder<'a> {
419        SelectorListBuilder {
420            selectors: selectors,
421            text: text.into(),
422        }
423    }
424    /// Selectors in the list.
425    pub fn selectors(&self) -> &[ProtocolValue<'a>] { &self.selectors }
426    /// Rule selector text.
427    pub fn text(&self) -> &str { self.text.as_ref() }
428}
429
430
431pub struct SelectorListBuilder<'a> {
432    selectors: Vec<ProtocolValue<'a>>,
433    text: Cow<'a, str>,
434}
435
436impl<'a> SelectorListBuilder<'a> {
437    pub fn build(self) -> SelectorList<'a> {
438        SelectorList {
439            selectors: self.selectors,
440            text: self.text,
441        }
442    }
443}
444
445/// CSS stylesheet metainformation.
446
447#[derive(Debug, Clone, Serialize, Deserialize, Default)]
448#[serde(rename_all = "camelCase")]
449pub struct CSSStyleSheetHeader<'a> {
450    /// The stylesheet identifier.
451    #[serde(rename = "styleSheetId")]
452    style_sheet_id: crate::dom::StyleSheetId<'a>,
453    /// Owner frame identifier.
454    #[serde(rename = "frameId")]
455    frame_id: crate::page::FrameId<'a>,
456    /// Stylesheet resource URL. Empty if this is a constructed stylesheet created using
457    /// new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported
458    /// as a CSS module script).
459    #[serde(rename = "sourceURL")]
460    source_url: Cow<'a, str>,
461    /// URL of source map associated with the stylesheet (if any).
462    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceMapURL")]
463    source_map_url: Option<Cow<'a, str>>,
464    /// Stylesheet origin.
465    origin: StyleSheetOrigin,
466    /// Stylesheet title.
467    title: Cow<'a, str>,
468    /// The backend id for the owner node of the stylesheet.
469    #[serde(skip_serializing_if = "Option::is_none", rename = "ownerNode")]
470    owner_node: Option<crate::dom::BackendNodeId>,
471    /// Denotes whether the stylesheet is disabled.
472    disabled: bool,
473    /// Whether the sourceURL field value comes from the sourceURL comment.
474    #[serde(skip_serializing_if = "Option::is_none", rename = "hasSourceURL")]
475    has_source_url: Option<bool>,
476    /// Whether this stylesheet is created for STYLE tag by parser. This flag is not set for
477    /// document.written STYLE tags.
478    #[serde(rename = "isInline")]
479    is_inline: bool,
480    /// Whether this stylesheet is mutable. Inline stylesheets become mutable
481    /// after they have been modified via CSSOM API.
482    /// '\<link\>' element's stylesheets become mutable only if DevTools modifies them.
483    /// Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
484    #[serde(rename = "isMutable")]
485    is_mutable: bool,
486    /// True if this stylesheet is created through new CSSStyleSheet() or imported as a
487    /// CSS module script.
488    #[serde(rename = "isConstructed")]
489    is_constructed: bool,
490    /// Line offset of the stylesheet within the resource (zero based).
491    #[serde(rename = "startLine")]
492    start_line: f64,
493    /// Column offset of the stylesheet within the resource (zero based).
494    #[serde(rename = "startColumn")]
495    start_column: f64,
496    /// Size of the content (in characters).
497    length: f64,
498    /// Line offset of the end of the stylesheet within the resource (zero based).
499    #[serde(rename = "endLine")]
500    end_line: f64,
501    /// Column offset of the end of the stylesheet within the resource (zero based).
502    #[serde(rename = "endColumn")]
503    end_column: f64,
504    /// If the style sheet was loaded from a network resource, this indicates when the resource failed to load
505    #[serde(skip_serializing_if = "Option::is_none", rename = "loadingFailed")]
506    loading_failed: Option<bool>,
507}
508
509impl<'a> CSSStyleSheetHeader<'a> {
510    /// Creates a builder for this type with the required parameters:
511    /// * `style_sheet_id`: The stylesheet identifier.
512    /// * `frame_id`: Owner frame identifier.
513    /// * `source_url`: Stylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported as a CSS module script).
514    /// * `origin`: Stylesheet origin.
515    /// * `title`: Stylesheet title.
516    /// * `disabled`: Denotes whether the stylesheet is disabled.
517    /// * `is_inline`: Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
518    /// * `is_mutable`: Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. `\<link\>` element's stylesheets become mutable only if DevTools modifies them. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
519    /// * `is_constructed`: True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script.
520    /// * `start_line`: Line offset of the stylesheet within the resource (zero based).
521    /// * `start_column`: Column offset of the stylesheet within the resource (zero based).
522    /// * `length`: Size of the content (in characters).
523    /// * `end_line`: Line offset of the end of the stylesheet within the resource (zero based).
524    /// * `end_column`: Column offset of the end of the stylesheet within the resource (zero based).
525    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, frame_id: crate::page::FrameId<'a>, source_url: impl Into<Cow<'a, str>>, origin: impl Into<StyleSheetOrigin>, title: impl Into<Cow<'a, str>>, disabled: bool, is_inline: bool, is_mutable: bool, is_constructed: bool, start_line: f64, start_column: f64, length: f64, end_line: f64, end_column: f64) -> CSSStyleSheetHeaderBuilder<'a> {
526        CSSStyleSheetHeaderBuilder {
527            style_sheet_id: style_sheet_id,
528            frame_id: frame_id,
529            source_url: source_url.into(),
530            source_map_url: None,
531            origin: origin.into(),
532            title: title.into(),
533            owner_node: None,
534            disabled: disabled,
535            has_source_url: None,
536            is_inline: is_inline,
537            is_mutable: is_mutable,
538            is_constructed: is_constructed,
539            start_line: start_line,
540            start_column: start_column,
541            length: length,
542            end_line: end_line,
543            end_column: end_column,
544            loading_failed: None,
545        }
546    }
547    /// The stylesheet identifier.
548    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
549    /// Owner frame identifier.
550    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
551    /// Stylesheet resource URL. Empty if this is a constructed stylesheet created using
552    /// new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported
553    /// as a CSS module script).
554    pub fn source_url(&self) -> &str { self.source_url.as_ref() }
555    /// URL of source map associated with the stylesheet (if any).
556    pub fn source_map_url(&self) -> Option<&str> { self.source_map_url.as_deref() }
557    /// Stylesheet origin.
558    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
559    /// Stylesheet title.
560    pub fn title(&self) -> &str { self.title.as_ref() }
561    /// The backend id for the owner node of the stylesheet.
562    pub fn owner_node(&self) -> Option<&crate::dom::BackendNodeId> { self.owner_node.as_ref() }
563    /// Denotes whether the stylesheet is disabled.
564    pub fn disabled(&self) -> bool { self.disabled }
565    /// Whether the sourceURL field value comes from the sourceURL comment.
566    pub fn has_source_url(&self) -> Option<bool> { self.has_source_url }
567    /// Whether this stylesheet is created for STYLE tag by parser. This flag is not set for
568    /// document.written STYLE tags.
569    pub fn is_inline(&self) -> bool { self.is_inline }
570    /// Whether this stylesheet is mutable. Inline stylesheets become mutable
571    /// after they have been modified via CSSOM API.
572    /// '\<link\>' element's stylesheets become mutable only if DevTools modifies them.
573    /// Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
574    pub fn is_mutable(&self) -> bool { self.is_mutable }
575    /// True if this stylesheet is created through new CSSStyleSheet() or imported as a
576    /// CSS module script.
577    pub fn is_constructed(&self) -> bool { self.is_constructed }
578    /// Line offset of the stylesheet within the resource (zero based).
579    pub fn start_line(&self) -> f64 { self.start_line }
580    /// Column offset of the stylesheet within the resource (zero based).
581    pub fn start_column(&self) -> f64 { self.start_column }
582    /// Size of the content (in characters).
583    pub fn length(&self) -> f64 { self.length }
584    /// Line offset of the end of the stylesheet within the resource (zero based).
585    pub fn end_line(&self) -> f64 { self.end_line }
586    /// Column offset of the end of the stylesheet within the resource (zero based).
587    pub fn end_column(&self) -> f64 { self.end_column }
588    /// If the style sheet was loaded from a network resource, this indicates when the resource failed to load
589    pub fn loading_failed(&self) -> Option<bool> { self.loading_failed }
590}
591
592
593pub struct CSSStyleSheetHeaderBuilder<'a> {
594    style_sheet_id: crate::dom::StyleSheetId<'a>,
595    frame_id: crate::page::FrameId<'a>,
596    source_url: Cow<'a, str>,
597    source_map_url: Option<Cow<'a, str>>,
598    origin: StyleSheetOrigin,
599    title: Cow<'a, str>,
600    owner_node: Option<crate::dom::BackendNodeId>,
601    disabled: bool,
602    has_source_url: Option<bool>,
603    is_inline: bool,
604    is_mutable: bool,
605    is_constructed: bool,
606    start_line: f64,
607    start_column: f64,
608    length: f64,
609    end_line: f64,
610    end_column: f64,
611    loading_failed: Option<bool>,
612}
613
614impl<'a> CSSStyleSheetHeaderBuilder<'a> {
615    /// URL of source map associated with the stylesheet (if any).
616    pub fn source_map_url(mut self, source_map_url: impl Into<Cow<'a, str>>) -> Self { self.source_map_url = Some(source_map_url.into()); self }
617    /// The backend id for the owner node of the stylesheet.
618    pub fn owner_node(mut self, owner_node: crate::dom::BackendNodeId) -> Self { self.owner_node = Some(owner_node); self }
619    /// Whether the sourceURL field value comes from the sourceURL comment.
620    pub fn has_source_url(mut self, has_source_url: bool) -> Self { self.has_source_url = Some(has_source_url); self }
621    /// If the style sheet was loaded from a network resource, this indicates when the resource failed to load
622    pub fn loading_failed(mut self, loading_failed: bool) -> Self { self.loading_failed = Some(loading_failed); self }
623    pub fn build(self) -> CSSStyleSheetHeader<'a> {
624        CSSStyleSheetHeader {
625            style_sheet_id: self.style_sheet_id,
626            frame_id: self.frame_id,
627            source_url: self.source_url,
628            source_map_url: self.source_map_url,
629            origin: self.origin,
630            title: self.title,
631            owner_node: self.owner_node,
632            disabled: self.disabled,
633            has_source_url: self.has_source_url,
634            is_inline: self.is_inline,
635            is_mutable: self.is_mutable,
636            is_constructed: self.is_constructed,
637            start_line: self.start_line,
638            start_column: self.start_column,
639            length: self.length,
640            end_line: self.end_line,
641            end_column: self.end_column,
642            loading_failed: self.loading_failed,
643        }
644    }
645}
646
647/// CSS rule representation.
648
649#[derive(Debug, Clone, Serialize, Deserialize, Default)]
650#[serde(rename_all = "camelCase")]
651pub struct CSSRule<'a> {
652    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
653    /// stylesheet rules) this rule came from.
654    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
655    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
656    /// Rule selector data.
657    #[serde(rename = "selectorList")]
658    selector_list: SelectorList<'a>,
659    /// Array of selectors from ancestor style rules, sorted by distance from the current rule.
660    #[serde(skip_serializing_if = "Option::is_none", rename = "nestingSelectors")]
661    nesting_selectors: Option<Vec<Cow<'a, str>>>,
662    /// Parent stylesheet's origin.
663    origin: StyleSheetOrigin,
664    /// Associated style declaration.
665    style: CSSStyle<'a>,
666    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
667    #[serde(skip_serializing_if = "Option::is_none", rename = "originTreeScopeNodeId")]
668    origin_tree_scope_node_id: Option<crate::dom::BackendNodeId>,
669    /// Media list array (for rules involving media queries). The array enumerates media queries
670    /// starting with the innermost one, going outwards.
671    #[serde(skip_serializing_if = "Option::is_none")]
672    media: Option<Vec<CSSMedia<'a>>>,
673    /// Container query list array (for rules involving container queries).
674    /// The array enumerates container queries starting with the innermost one, going outwards.
675    #[serde(skip_serializing_if = "Option::is_none", rename = "containerQueries")]
676    container_queries: Option<Vec<CSSContainerQuery<'a>>>,
677    /// @supports CSS at-rule array.
678    /// The array enumerates @supports at-rules starting with the innermost one, going outwards.
679    #[serde(skip_serializing_if = "Option::is_none")]
680    supports: Option<Vec<CSSSupports<'a>>>,
681    /// Cascade layer array. Contains the layer hierarchy that this rule belongs to starting
682    /// with the innermost layer and going outwards.
683    #[serde(skip_serializing_if = "Option::is_none")]
684    layers: Option<Vec<CSSLayer<'a>>>,
685    /// @scope CSS at-rule array.
686    /// The array enumerates @scope at-rules starting with the innermost one, going outwards.
687    #[serde(skip_serializing_if = "Option::is_none")]
688    scopes: Option<Vec<CSSScope<'a>>>,
689    /// The array keeps the types of ancestor CSSRules from the innermost going outwards.
690    #[serde(skip_serializing_if = "Option::is_none", rename = "ruleTypes")]
691    rule_types: Option<Vec<CSSRuleType>>,
692    /// @starting-style CSS at-rule array.
693    /// The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
694    #[serde(skip_serializing_if = "Option::is_none", rename = "startingStyles")]
695    starting_styles: Option<Vec<CSSStartingStyle<'a>>>,
696    /// @navigation CSS at-rule array.
697    /// The array enumerates @navigation at-rules starting with the innermost one, going outwards.
698    #[serde(skip_serializing_if = "Option::is_none")]
699    navigations: Option<Vec<CSSNavigation<'a>>>,
700}
701
702impl<'a> CSSRule<'a> {
703    /// Creates a builder for this type with the required parameters:
704    /// * `selector_list`: Rule selector data.
705    /// * `origin`: Parent stylesheet's origin.
706    /// * `style`: Associated style declaration.
707    pub fn builder(selector_list: SelectorList<'a>, origin: impl Into<StyleSheetOrigin>, style: CSSStyle<'a>) -> CSSRuleBuilder<'a> {
708        CSSRuleBuilder {
709            style_sheet_id: None,
710            selector_list: selector_list,
711            nesting_selectors: None,
712            origin: origin.into(),
713            style: style,
714            origin_tree_scope_node_id: None,
715            media: None,
716            container_queries: None,
717            supports: None,
718            layers: None,
719            scopes: None,
720            rule_types: None,
721            starting_styles: None,
722            navigations: None,
723        }
724    }
725    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
726    /// stylesheet rules) this rule came from.
727    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
728    /// Rule selector data.
729    pub fn selector_list(&self) -> &SelectorList<'a> { &self.selector_list }
730    /// Array of selectors from ancestor style rules, sorted by distance from the current rule.
731    pub fn nesting_selectors(&self) -> Option<&[Cow<'a, str>]> { self.nesting_selectors.as_deref() }
732    /// Parent stylesheet's origin.
733    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
734    /// Associated style declaration.
735    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
736    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
737    pub fn origin_tree_scope_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.origin_tree_scope_node_id.as_ref() }
738    /// Media list array (for rules involving media queries). The array enumerates media queries
739    /// starting with the innermost one, going outwards.
740    pub fn media(&self) -> Option<&[CSSMedia<'a>]> { self.media.as_deref() }
741    /// Container query list array (for rules involving container queries).
742    /// The array enumerates container queries starting with the innermost one, going outwards.
743    pub fn container_queries(&self) -> Option<&[CSSContainerQuery<'a>]> { self.container_queries.as_deref() }
744    /// @supports CSS at-rule array.
745    /// The array enumerates @supports at-rules starting with the innermost one, going outwards.
746    pub fn supports(&self) -> Option<&[CSSSupports<'a>]> { self.supports.as_deref() }
747    /// Cascade layer array. Contains the layer hierarchy that this rule belongs to starting
748    /// with the innermost layer and going outwards.
749    pub fn layers(&self) -> Option<&[CSSLayer<'a>]> { self.layers.as_deref() }
750    /// @scope CSS at-rule array.
751    /// The array enumerates @scope at-rules starting with the innermost one, going outwards.
752    pub fn scopes(&self) -> Option<&[CSSScope<'a>]> { self.scopes.as_deref() }
753    /// The array keeps the types of ancestor CSSRules from the innermost going outwards.
754    pub fn rule_types(&self) -> Option<&[CSSRuleType]> { self.rule_types.as_deref() }
755    /// @starting-style CSS at-rule array.
756    /// The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
757    pub fn starting_styles(&self) -> Option<&[CSSStartingStyle<'a>]> { self.starting_styles.as_deref() }
758    /// @navigation CSS at-rule array.
759    /// The array enumerates @navigation at-rules starting with the innermost one, going outwards.
760    pub fn navigations(&self) -> Option<&[CSSNavigation<'a>]> { self.navigations.as_deref() }
761}
762
763
764pub struct CSSRuleBuilder<'a> {
765    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
766    selector_list: SelectorList<'a>,
767    nesting_selectors: Option<Vec<Cow<'a, str>>>,
768    origin: StyleSheetOrigin,
769    style: CSSStyle<'a>,
770    origin_tree_scope_node_id: Option<crate::dom::BackendNodeId>,
771    media: Option<Vec<CSSMedia<'a>>>,
772    container_queries: Option<Vec<CSSContainerQuery<'a>>>,
773    supports: Option<Vec<CSSSupports<'a>>>,
774    layers: Option<Vec<CSSLayer<'a>>>,
775    scopes: Option<Vec<CSSScope<'a>>>,
776    rule_types: Option<Vec<CSSRuleType>>,
777    starting_styles: Option<Vec<CSSStartingStyle<'a>>>,
778    navigations: Option<Vec<CSSNavigation<'a>>>,
779}
780
781impl<'a> CSSRuleBuilder<'a> {
782    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
783    /// stylesheet rules) this rule came from.
784    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
785    /// Array of selectors from ancestor style rules, sorted by distance from the current rule.
786    pub fn nesting_selectors(mut self, nesting_selectors: Vec<Cow<'a, str>>) -> Self { self.nesting_selectors = Some(nesting_selectors); self }
787    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
788    pub fn origin_tree_scope_node_id(mut self, origin_tree_scope_node_id: crate::dom::BackendNodeId) -> Self { self.origin_tree_scope_node_id = Some(origin_tree_scope_node_id); self }
789    /// Media list array (for rules involving media queries). The array enumerates media queries
790    /// starting with the innermost one, going outwards.
791    pub fn media(mut self, media: Vec<CSSMedia<'a>>) -> Self { self.media = Some(media); self }
792    /// Container query list array (for rules involving container queries).
793    /// The array enumerates container queries starting with the innermost one, going outwards.
794    pub fn container_queries(mut self, container_queries: Vec<CSSContainerQuery<'a>>) -> Self { self.container_queries = Some(container_queries); self }
795    /// @supports CSS at-rule array.
796    /// The array enumerates @supports at-rules starting with the innermost one, going outwards.
797    pub fn supports(mut self, supports: Vec<CSSSupports<'a>>) -> Self { self.supports = Some(supports); self }
798    /// Cascade layer array. Contains the layer hierarchy that this rule belongs to starting
799    /// with the innermost layer and going outwards.
800    pub fn layers(mut self, layers: Vec<CSSLayer<'a>>) -> Self { self.layers = Some(layers); self }
801    /// @scope CSS at-rule array.
802    /// The array enumerates @scope at-rules starting with the innermost one, going outwards.
803    pub fn scopes(mut self, scopes: Vec<CSSScope<'a>>) -> Self { self.scopes = Some(scopes); self }
804    /// The array keeps the types of ancestor CSSRules from the innermost going outwards.
805    pub fn rule_types(mut self, rule_types: Vec<CSSRuleType>) -> Self { self.rule_types = Some(rule_types); self }
806    /// @starting-style CSS at-rule array.
807    /// The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
808    pub fn starting_styles(mut self, starting_styles: Vec<CSSStartingStyle<'a>>) -> Self { self.starting_styles = Some(starting_styles); self }
809    /// @navigation CSS at-rule array.
810    /// The array enumerates @navigation at-rules starting with the innermost one, going outwards.
811    pub fn navigations(mut self, navigations: Vec<CSSNavigation<'a>>) -> Self { self.navigations = Some(navigations); self }
812    pub fn build(self) -> CSSRule<'a> {
813        CSSRule {
814            style_sheet_id: self.style_sheet_id,
815            selector_list: self.selector_list,
816            nesting_selectors: self.nesting_selectors,
817            origin: self.origin,
818            style: self.style,
819            origin_tree_scope_node_id: self.origin_tree_scope_node_id,
820            media: self.media,
821            container_queries: self.container_queries,
822            supports: self.supports,
823            layers: self.layers,
824            scopes: self.scopes,
825            rule_types: self.rule_types,
826            starting_styles: self.starting_styles,
827            navigations: self.navigations,
828        }
829    }
830}
831
832/// Enum indicating the type of a CSS rule, used to represent the order of a style rule's ancestors.
833/// This list only contains rule types that are collected during the ancestor rule collection.
834
835#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
836pub enum CSSRuleType {
837    #[default]
838    #[serde(rename = "MediaRule")]
839    MediaRule,
840    #[serde(rename = "SupportsRule")]
841    SupportsRule,
842    #[serde(rename = "ContainerRule")]
843    ContainerRule,
844    #[serde(rename = "LayerRule")]
845    LayerRule,
846    #[serde(rename = "ScopeRule")]
847    ScopeRule,
848    #[serde(rename = "StyleRule")]
849    StyleRule,
850    #[serde(rename = "StartingStyleRule")]
851    StartingStyleRule,
852    #[serde(rename = "NavigationRule")]
853    NavigationRule,
854}
855
856/// CSS coverage information.
857
858#[derive(Debug, Clone, Serialize, Deserialize, Default)]
859#[serde(rename_all = "camelCase")]
860pub struct RuleUsage<'a> {
861    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
862    /// stylesheet rules) this rule came from.
863    #[serde(rename = "styleSheetId")]
864    style_sheet_id: crate::dom::StyleSheetId<'a>,
865    /// Offset of the start of the rule (including selector) from the beginning of the stylesheet.
866    #[serde(rename = "startOffset")]
867    start_offset: f64,
868    /// Offset of the end of the rule body from the beginning of the stylesheet.
869    #[serde(rename = "endOffset")]
870    end_offset: f64,
871    /// Indicates whether the rule was actually used by some element in the page.
872    used: bool,
873}
874
875impl<'a> RuleUsage<'a> {
876    /// Creates a builder for this type with the required parameters:
877    /// * `style_sheet_id`: The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
878    /// * `start_offset`: Offset of the start of the rule (including selector) from the beginning of the stylesheet.
879    /// * `end_offset`: Offset of the end of the rule body from the beginning of the stylesheet.
880    /// * `used`: Indicates whether the rule was actually used by some element in the page.
881    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, start_offset: f64, end_offset: f64, used: bool) -> RuleUsageBuilder<'a> {
882        RuleUsageBuilder {
883            style_sheet_id: style_sheet_id,
884            start_offset: start_offset,
885            end_offset: end_offset,
886            used: used,
887        }
888    }
889    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
890    /// stylesheet rules) this rule came from.
891    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
892    /// Offset of the start of the rule (including selector) from the beginning of the stylesheet.
893    pub fn start_offset(&self) -> f64 { self.start_offset }
894    /// Offset of the end of the rule body from the beginning of the stylesheet.
895    pub fn end_offset(&self) -> f64 { self.end_offset }
896    /// Indicates whether the rule was actually used by some element in the page.
897    pub fn used(&self) -> bool { self.used }
898}
899
900
901pub struct RuleUsageBuilder<'a> {
902    style_sheet_id: crate::dom::StyleSheetId<'a>,
903    start_offset: f64,
904    end_offset: f64,
905    used: bool,
906}
907
908impl<'a> RuleUsageBuilder<'a> {
909    pub fn build(self) -> RuleUsage<'a> {
910        RuleUsage {
911            style_sheet_id: self.style_sheet_id,
912            start_offset: self.start_offset,
913            end_offset: self.end_offset,
914            used: self.used,
915        }
916    }
917}
918
919/// Text range within a resource. All numbers are zero-based.
920
921#[derive(Debug, Clone, Serialize, Deserialize, Default)]
922#[serde(rename_all = "camelCase")]
923pub struct SourceRange {
924    /// Start line of range.
925    #[serde(rename = "startLine")]
926    start_line: i64,
927    /// Start column of range (inclusive).
928    #[serde(rename = "startColumn")]
929    start_column: i64,
930    /// End line of range
931    #[serde(rename = "endLine")]
932    end_line: i64,
933    /// End column of range (exclusive).
934    #[serde(rename = "endColumn")]
935    end_column: i64,
936}
937
938impl SourceRange {
939    /// Creates a builder for this type with the required parameters:
940    /// * `start_line`: Start line of range.
941    /// * `start_column`: Start column of range (inclusive).
942    /// * `end_line`: End line of range
943    /// * `end_column`: End column of range (exclusive).
944    pub fn builder(start_line: i64, start_column: i64, end_line: i64, end_column: i64) -> SourceRangeBuilder {
945        SourceRangeBuilder {
946            start_line: start_line,
947            start_column: start_column,
948            end_line: end_line,
949            end_column: end_column,
950        }
951    }
952    /// Start line of range.
953    pub fn start_line(&self) -> i64 { self.start_line }
954    /// Start column of range (inclusive).
955    pub fn start_column(&self) -> i64 { self.start_column }
956    /// End line of range
957    pub fn end_line(&self) -> i64 { self.end_line }
958    /// End column of range (exclusive).
959    pub fn end_column(&self) -> i64 { self.end_column }
960}
961
962
963pub struct SourceRangeBuilder {
964    start_line: i64,
965    start_column: i64,
966    end_line: i64,
967    end_column: i64,
968}
969
970impl SourceRangeBuilder {
971    pub fn build(self) -> SourceRange {
972        SourceRange {
973            start_line: self.start_line,
974            start_column: self.start_column,
975            end_line: self.end_line,
976            end_column: self.end_column,
977        }
978    }
979}
980
981
982#[derive(Debug, Clone, Serialize, Deserialize, Default)]
983#[serde(rename_all = "camelCase")]
984pub struct ShorthandEntry<'a> {
985    /// Shorthand name.
986    name: Cow<'a, str>,
987    /// Shorthand value.
988    value: Cow<'a, str>,
989    /// Whether the property has "!important" annotation (implies 'false' if absent).
990    #[serde(skip_serializing_if = "Option::is_none")]
991    important: Option<bool>,
992}
993
994impl<'a> ShorthandEntry<'a> {
995    /// Creates a builder for this type with the required parameters:
996    /// * `name`: Shorthand name.
997    /// * `value`: Shorthand value.
998    pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> ShorthandEntryBuilder<'a> {
999        ShorthandEntryBuilder {
1000            name: name.into(),
1001            value: value.into(),
1002            important: None,
1003        }
1004    }
1005    /// Shorthand name.
1006    pub fn name(&self) -> &str { self.name.as_ref() }
1007    /// Shorthand value.
1008    pub fn value(&self) -> &str { self.value.as_ref() }
1009    /// Whether the property has "!important" annotation (implies 'false' if absent).
1010    pub fn important(&self) -> Option<bool> { self.important }
1011}
1012
1013
1014pub struct ShorthandEntryBuilder<'a> {
1015    name: Cow<'a, str>,
1016    value: Cow<'a, str>,
1017    important: Option<bool>,
1018}
1019
1020impl<'a> ShorthandEntryBuilder<'a> {
1021    /// Whether the property has "!important" annotation (implies 'false' if absent).
1022    pub fn important(mut self, important: bool) -> Self { self.important = Some(important); self }
1023    pub fn build(self) -> ShorthandEntry<'a> {
1024        ShorthandEntry {
1025            name: self.name,
1026            value: self.value,
1027            important: self.important,
1028        }
1029    }
1030}
1031
1032
1033#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1034#[serde(rename_all = "camelCase")]
1035pub struct CSSComputedStyleProperty<'a> {
1036    /// Computed style property name.
1037    name: Cow<'a, str>,
1038    /// Computed style property value.
1039    value: Cow<'a, str>,
1040}
1041
1042impl<'a> CSSComputedStyleProperty<'a> {
1043    /// Creates a builder for this type with the required parameters:
1044    /// * `name`: Computed style property name.
1045    /// * `value`: Computed style property value.
1046    pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSComputedStylePropertyBuilder<'a> {
1047        CSSComputedStylePropertyBuilder {
1048            name: name.into(),
1049            value: value.into(),
1050        }
1051    }
1052    /// Computed style property name.
1053    pub fn name(&self) -> &str { self.name.as_ref() }
1054    /// Computed style property value.
1055    pub fn value(&self) -> &str { self.value.as_ref() }
1056}
1057
1058
1059pub struct CSSComputedStylePropertyBuilder<'a> {
1060    name: Cow<'a, str>,
1061    value: Cow<'a, str>,
1062}
1063
1064impl<'a> CSSComputedStylePropertyBuilder<'a> {
1065    pub fn build(self) -> CSSComputedStyleProperty<'a> {
1066        CSSComputedStyleProperty {
1067            name: self.name,
1068            value: self.value,
1069        }
1070    }
1071}
1072
1073
1074#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1075#[serde(rename_all = "camelCase")]
1076pub struct ComputedStyleExtraFields {
1077    /// Returns whether or not this node is being rendered with base appearance,
1078    /// which happens when it has its appearance property set to base/base-select
1079    /// or it is in the subtree of an element being rendered with base appearance.
1080    #[serde(rename = "isAppearanceBase")]
1081    is_appearance_base: bool,
1082}
1083
1084impl ComputedStyleExtraFields {
1085    /// Creates a builder for this type with the required parameters:
1086    /// * `is_appearance_base`: Returns whether or not this node is being rendered with base appearance, which happens when it has its appearance property set to base/base-select or it is in the subtree of an element being rendered with base appearance.
1087    pub fn builder(is_appearance_base: bool) -> ComputedStyleExtraFieldsBuilder {
1088        ComputedStyleExtraFieldsBuilder {
1089            is_appearance_base: is_appearance_base,
1090        }
1091    }
1092    /// Returns whether or not this node is being rendered with base appearance,
1093    /// which happens when it has its appearance property set to base/base-select
1094    /// or it is in the subtree of an element being rendered with base appearance.
1095    pub fn is_appearance_base(&self) -> bool { self.is_appearance_base }
1096}
1097
1098
1099pub struct ComputedStyleExtraFieldsBuilder {
1100    is_appearance_base: bool,
1101}
1102
1103impl ComputedStyleExtraFieldsBuilder {
1104    pub fn build(self) -> ComputedStyleExtraFields {
1105        ComputedStyleExtraFields {
1106            is_appearance_base: self.is_appearance_base,
1107        }
1108    }
1109}
1110
1111/// CSS style representation.
1112
1113#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1114#[serde(rename_all = "camelCase")]
1115pub struct CSSStyle<'a> {
1116    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
1117    /// stylesheet rules) this rule came from.
1118    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1119    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1120    /// CSS properties in the style.
1121    #[serde(rename = "cssProperties")]
1122    css_properties: Vec<CSSProperty<'a>>,
1123    /// Computed values for all shorthands found in the style.
1124    #[serde(rename = "shorthandEntries")]
1125    shorthand_entries: Vec<ShorthandEntry<'a>>,
1126    /// Style declaration text (if available).
1127    #[serde(skip_serializing_if = "Option::is_none", rename = "cssText")]
1128    css_text: Option<Cow<'a, str>>,
1129    /// Style declaration range in the enclosing stylesheet (if available).
1130    #[serde(skip_serializing_if = "Option::is_none")]
1131    range: Option<SourceRange>,
1132}
1133
1134impl<'a> CSSStyle<'a> {
1135    /// Creates a builder for this type with the required parameters:
1136    /// * `css_properties`: CSS properties in the style.
1137    /// * `shorthand_entries`: Computed values for all shorthands found in the style.
1138    pub fn builder(css_properties: Vec<CSSProperty<'a>>, shorthand_entries: Vec<ShorthandEntry<'a>>) -> CSSStyleBuilder<'a> {
1139        CSSStyleBuilder {
1140            style_sheet_id: None,
1141            css_properties: css_properties,
1142            shorthand_entries: shorthand_entries,
1143            css_text: None,
1144            range: None,
1145        }
1146    }
1147    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
1148    /// stylesheet rules) this rule came from.
1149    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1150    /// CSS properties in the style.
1151    pub fn css_properties(&self) -> &[CSSProperty<'a>] { &self.css_properties }
1152    /// Computed values for all shorthands found in the style.
1153    pub fn shorthand_entries(&self) -> &[ShorthandEntry<'a>] { &self.shorthand_entries }
1154    /// Style declaration text (if available).
1155    pub fn css_text(&self) -> Option<&str> { self.css_text.as_deref() }
1156    /// Style declaration range in the enclosing stylesheet (if available).
1157    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1158}
1159
1160
1161pub struct CSSStyleBuilder<'a> {
1162    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1163    css_properties: Vec<CSSProperty<'a>>,
1164    shorthand_entries: Vec<ShorthandEntry<'a>>,
1165    css_text: Option<Cow<'a, str>>,
1166    range: Option<SourceRange>,
1167}
1168
1169impl<'a> CSSStyleBuilder<'a> {
1170    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
1171    /// stylesheet rules) this rule came from.
1172    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1173    /// Style declaration text (if available).
1174    pub fn css_text(mut self, css_text: impl Into<Cow<'a, str>>) -> Self { self.css_text = Some(css_text.into()); self }
1175    /// Style declaration range in the enclosing stylesheet (if available).
1176    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1177    pub fn build(self) -> CSSStyle<'a> {
1178        CSSStyle {
1179            style_sheet_id: self.style_sheet_id,
1180            css_properties: self.css_properties,
1181            shorthand_entries: self.shorthand_entries,
1182            css_text: self.css_text,
1183            range: self.range,
1184        }
1185    }
1186}
1187
1188/// CSS property declaration data.
1189
1190#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1191#[serde(rename_all = "camelCase")]
1192pub struct CSSProperty<'a> {
1193    /// The property name.
1194    name: Cow<'a, str>,
1195    /// The property value.
1196    value: Cow<'a, str>,
1197    /// Whether the property has "!important" annotation (implies 'false' if absent).
1198    #[serde(skip_serializing_if = "Option::is_none")]
1199    important: Option<bool>,
1200    /// Whether the property is implicit (implies 'false' if absent).
1201    #[serde(skip_serializing_if = "Option::is_none")]
1202    implicit: Option<bool>,
1203    /// The full property text as specified in the style.
1204    #[serde(skip_serializing_if = "Option::is_none")]
1205    text: Option<Cow<'a, str>>,
1206    /// Whether the property is understood by the browser (implies 'true' if absent).
1207    #[serde(skip_serializing_if = "Option::is_none", rename = "parsedOk")]
1208    parsed_ok: Option<bool>,
1209    /// Whether the property is disabled by the user (present for source-based properties only).
1210    #[serde(skip_serializing_if = "Option::is_none")]
1211    disabled: Option<bool>,
1212    /// The entire property range in the enclosing style declaration (if available).
1213    #[serde(skip_serializing_if = "Option::is_none")]
1214    range: Option<SourceRange>,
1215    /// Parsed longhand components of this property if it is a shorthand.
1216    /// This field will be empty if the given property is not a shorthand.
1217    #[serde(skip_serializing_if = "Option::is_none", rename = "longhandProperties")]
1218    longhand_properties: Option<Vec<Box<CSSProperty<'a>>>>,
1219}
1220
1221impl<'a> CSSProperty<'a> {
1222    /// Creates a builder for this type with the required parameters:
1223    /// * `name`: The property name.
1224    /// * `value`: The property value.
1225    pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSPropertyBuilder<'a> {
1226        CSSPropertyBuilder {
1227            name: name.into(),
1228            value: value.into(),
1229            important: None,
1230            implicit: None,
1231            text: None,
1232            parsed_ok: None,
1233            disabled: None,
1234            range: None,
1235            longhand_properties: None,
1236        }
1237    }
1238    /// The property name.
1239    pub fn name(&self) -> &str { self.name.as_ref() }
1240    /// The property value.
1241    pub fn value(&self) -> &str { self.value.as_ref() }
1242    /// Whether the property has "!important" annotation (implies 'false' if absent).
1243    pub fn important(&self) -> Option<bool> { self.important }
1244    /// Whether the property is implicit (implies 'false' if absent).
1245    pub fn implicit(&self) -> Option<bool> { self.implicit }
1246    /// The full property text as specified in the style.
1247    pub fn text(&self) -> Option<&str> { self.text.as_deref() }
1248    /// Whether the property is understood by the browser (implies 'true' if absent).
1249    pub fn parsed_ok(&self) -> Option<bool> { self.parsed_ok }
1250    /// Whether the property is disabled by the user (present for source-based properties only).
1251    pub fn disabled(&self) -> Option<bool> { self.disabled }
1252    /// The entire property range in the enclosing style declaration (if available).
1253    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1254    /// Parsed longhand components of this property if it is a shorthand.
1255    /// This field will be empty if the given property is not a shorthand.
1256    pub fn longhand_properties(&self) -> Option<&[Box<CSSProperty<'a>>]> { self.longhand_properties.as_deref() }
1257}
1258
1259
1260pub struct CSSPropertyBuilder<'a> {
1261    name: Cow<'a, str>,
1262    value: Cow<'a, str>,
1263    important: Option<bool>,
1264    implicit: Option<bool>,
1265    text: Option<Cow<'a, str>>,
1266    parsed_ok: Option<bool>,
1267    disabled: Option<bool>,
1268    range: Option<SourceRange>,
1269    longhand_properties: Option<Vec<Box<CSSProperty<'a>>>>,
1270}
1271
1272impl<'a> CSSPropertyBuilder<'a> {
1273    /// Whether the property has "!important" annotation (implies 'false' if absent).
1274    pub fn important(mut self, important: bool) -> Self { self.important = Some(important); self }
1275    /// Whether the property is implicit (implies 'false' if absent).
1276    pub fn implicit(mut self, implicit: bool) -> Self { self.implicit = Some(implicit); self }
1277    /// The full property text as specified in the style.
1278    pub fn text(mut self, text: impl Into<Cow<'a, str>>) -> Self { self.text = Some(text.into()); self }
1279    /// Whether the property is understood by the browser (implies 'true' if absent).
1280    pub fn parsed_ok(mut self, parsed_ok: bool) -> Self { self.parsed_ok = Some(parsed_ok); self }
1281    /// Whether the property is disabled by the user (present for source-based properties only).
1282    pub fn disabled(mut self, disabled: bool) -> Self { self.disabled = Some(disabled); self }
1283    /// The entire property range in the enclosing style declaration (if available).
1284    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1285    /// Parsed longhand components of this property if it is a shorthand.
1286    /// This field will be empty if the given property is not a shorthand.
1287    pub fn longhand_properties(mut self, longhand_properties: Vec<Box<CSSProperty<'a>>>) -> Self { self.longhand_properties = Some(longhand_properties); self }
1288    pub fn build(self) -> CSSProperty<'a> {
1289        CSSProperty {
1290            name: self.name,
1291            value: self.value,
1292            important: self.important,
1293            implicit: self.implicit,
1294            text: self.text,
1295            parsed_ok: self.parsed_ok,
1296            disabled: self.disabled,
1297            range: self.range,
1298            longhand_properties: self.longhand_properties,
1299        }
1300    }
1301}
1302
1303/// CSS media rule descriptor.
1304
1305#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1306#[serde(rename_all = "camelCase")]
1307pub struct CSSMedia<'a> {
1308    /// Media query text.
1309    text: Cow<'a, str>,
1310    /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if
1311    /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked
1312    /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline
1313    /// stylesheet's STYLE tag.
1314    source: Cow<'a, str>,
1315    /// URL of the document containing the media query description.
1316    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceURL")]
1317    source_url: Option<Cow<'a, str>>,
1318    /// The associated rule (@media or @import) header range in the enclosing stylesheet (if
1319    /// available).
1320    #[serde(skip_serializing_if = "Option::is_none")]
1321    range: Option<SourceRange>,
1322    /// Identifier of the stylesheet containing this object (if exists).
1323    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1324    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1325    /// Array of media queries.
1326    #[serde(skip_serializing_if = "Option::is_none", rename = "mediaList")]
1327    media_list: Option<Vec<MediaQuery<'a>>>,
1328}
1329
1330impl<'a> CSSMedia<'a> {
1331    /// Creates a builder for this type with the required parameters:
1332    /// * `text`: Media query text.
1333    /// * `source`: Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline stylesheet's STYLE tag.
1334    pub fn builder(text: impl Into<Cow<'a, str>>, source: impl Into<Cow<'a, str>>) -> CSSMediaBuilder<'a> {
1335        CSSMediaBuilder {
1336            text: text.into(),
1337            source: source.into(),
1338            source_url: None,
1339            range: None,
1340            style_sheet_id: None,
1341            media_list: None,
1342        }
1343    }
1344    /// Media query text.
1345    pub fn text(&self) -> &str { self.text.as_ref() }
1346    /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if
1347    /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked
1348    /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline
1349    /// stylesheet's STYLE tag.
1350    pub fn source(&self) -> &str { self.source.as_ref() }
1351    /// URL of the document containing the media query description.
1352    pub fn source_url(&self) -> Option<&str> { self.source_url.as_deref() }
1353    /// The associated rule (@media or @import) header range in the enclosing stylesheet (if
1354    /// available).
1355    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1356    /// Identifier of the stylesheet containing this object (if exists).
1357    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1358    /// Array of media queries.
1359    pub fn media_list(&self) -> Option<&[MediaQuery<'a>]> { self.media_list.as_deref() }
1360}
1361
1362
1363pub struct CSSMediaBuilder<'a> {
1364    text: Cow<'a, str>,
1365    source: Cow<'a, str>,
1366    source_url: Option<Cow<'a, str>>,
1367    range: Option<SourceRange>,
1368    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1369    media_list: Option<Vec<MediaQuery<'a>>>,
1370}
1371
1372impl<'a> CSSMediaBuilder<'a> {
1373    /// URL of the document containing the media query description.
1374    pub fn source_url(mut self, source_url: impl Into<Cow<'a, str>>) -> Self { self.source_url = Some(source_url.into()); self }
1375    /// The associated rule (@media or @import) header range in the enclosing stylesheet (if
1376    /// available).
1377    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1378    /// Identifier of the stylesheet containing this object (if exists).
1379    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1380    /// Array of media queries.
1381    pub fn media_list(mut self, media_list: Vec<MediaQuery<'a>>) -> Self { self.media_list = Some(media_list); self }
1382    pub fn build(self) -> CSSMedia<'a> {
1383        CSSMedia {
1384            text: self.text,
1385            source: self.source,
1386            source_url: self.source_url,
1387            range: self.range,
1388            style_sheet_id: self.style_sheet_id,
1389            media_list: self.media_list,
1390        }
1391    }
1392}
1393
1394/// Media query descriptor.
1395
1396#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1397#[serde(rename_all = "camelCase")]
1398pub struct MediaQuery<'a> {
1399    /// Array of media query expressions.
1400    expressions: Vec<MediaQueryExpression<'a>>,
1401    /// Whether the media query condition is satisfied.
1402    active: bool,
1403}
1404
1405impl<'a> MediaQuery<'a> {
1406    /// Creates a builder for this type with the required parameters:
1407    /// * `expressions`: Array of media query expressions.
1408    /// * `active`: Whether the media query condition is satisfied.
1409    pub fn builder(expressions: Vec<MediaQueryExpression<'a>>, active: bool) -> MediaQueryBuilder<'a> {
1410        MediaQueryBuilder {
1411            expressions: expressions,
1412            active: active,
1413        }
1414    }
1415    /// Array of media query expressions.
1416    pub fn expressions(&self) -> &[MediaQueryExpression<'a>] { &self.expressions }
1417    /// Whether the media query condition is satisfied.
1418    pub fn active(&self) -> bool { self.active }
1419}
1420
1421
1422pub struct MediaQueryBuilder<'a> {
1423    expressions: Vec<MediaQueryExpression<'a>>,
1424    active: bool,
1425}
1426
1427impl<'a> MediaQueryBuilder<'a> {
1428    pub fn build(self) -> MediaQuery<'a> {
1429        MediaQuery {
1430            expressions: self.expressions,
1431            active: self.active,
1432        }
1433    }
1434}
1435
1436/// Media query expression descriptor.
1437
1438#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1439#[serde(rename_all = "camelCase")]
1440pub struct MediaQueryExpression<'a> {
1441    /// Media query expression value.
1442    value: f64,
1443    /// Media query expression units.
1444    unit: Cow<'a, str>,
1445    /// Media query expression feature.
1446    feature: Cow<'a, str>,
1447    /// The associated range of the value text in the enclosing stylesheet (if available).
1448    #[serde(skip_serializing_if = "Option::is_none", rename = "valueRange")]
1449    value_range: Option<SourceRange>,
1450    /// Computed length of media query expression (if applicable).
1451    #[serde(skip_serializing_if = "Option::is_none", rename = "computedLength")]
1452    computed_length: Option<f64>,
1453}
1454
1455impl<'a> MediaQueryExpression<'a> {
1456    /// Creates a builder for this type with the required parameters:
1457    /// * `value`: Media query expression value.
1458    /// * `unit`: Media query expression units.
1459    /// * `feature`: Media query expression feature.
1460    pub fn builder(value: f64, unit: impl Into<Cow<'a, str>>, feature: impl Into<Cow<'a, str>>) -> MediaQueryExpressionBuilder<'a> {
1461        MediaQueryExpressionBuilder {
1462            value: value,
1463            unit: unit.into(),
1464            feature: feature.into(),
1465            value_range: None,
1466            computed_length: None,
1467        }
1468    }
1469    /// Media query expression value.
1470    pub fn value(&self) -> f64 { self.value }
1471    /// Media query expression units.
1472    pub fn unit(&self) -> &str { self.unit.as_ref() }
1473    /// Media query expression feature.
1474    pub fn feature(&self) -> &str { self.feature.as_ref() }
1475    /// The associated range of the value text in the enclosing stylesheet (if available).
1476    pub fn value_range(&self) -> Option<&SourceRange> { self.value_range.as_ref() }
1477    /// Computed length of media query expression (if applicable).
1478    pub fn computed_length(&self) -> Option<f64> { self.computed_length }
1479}
1480
1481
1482pub struct MediaQueryExpressionBuilder<'a> {
1483    value: f64,
1484    unit: Cow<'a, str>,
1485    feature: Cow<'a, str>,
1486    value_range: Option<SourceRange>,
1487    computed_length: Option<f64>,
1488}
1489
1490impl<'a> MediaQueryExpressionBuilder<'a> {
1491    /// The associated range of the value text in the enclosing stylesheet (if available).
1492    pub fn value_range(mut self, value_range: SourceRange) -> Self { self.value_range = Some(value_range); self }
1493    /// Computed length of media query expression (if applicable).
1494    pub fn computed_length(mut self, computed_length: f64) -> Self { self.computed_length = Some(computed_length); self }
1495    pub fn build(self) -> MediaQueryExpression<'a> {
1496        MediaQueryExpression {
1497            value: self.value,
1498            unit: self.unit,
1499            feature: self.feature,
1500            value_range: self.value_range,
1501            computed_length: self.computed_length,
1502        }
1503    }
1504}
1505
1506/// CSS container query rule descriptor.
1507
1508#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1509#[serde(rename_all = "camelCase")]
1510pub struct CSSContainerQuery<'a> {
1511    /// Container query text.
1512    /// Contains the query part without the container name for a single query.
1513    /// Deprecated in favor of conditionText which contains the full prelude
1514    /// after @container.
1515    text: Cow<'a, str>,
1516    /// The associated rule header range in the enclosing stylesheet (if
1517    /// available).
1518    #[serde(skip_serializing_if = "Option::is_none")]
1519    range: Option<SourceRange>,
1520    /// Identifier of the stylesheet containing this object (if exists).
1521    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1522    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1523    /// Optional name for the container.
1524    #[serde(skip_serializing_if = "Option::is_none")]
1525    name: Option<Cow<'a, str>>,
1526    /// Optional physical axes queried for the container.
1527    #[serde(skip_serializing_if = "Option::is_none", rename = "physicalAxes")]
1528    physical_axes: Option<crate::dom::PhysicalAxes>,
1529    /// Optional logical axes queried for the container.
1530    #[serde(skip_serializing_if = "Option::is_none", rename = "logicalAxes")]
1531    logical_axes: Option<crate::dom::LogicalAxes>,
1532    /// true if the query contains scroll-state() queries.
1533    #[serde(skip_serializing_if = "Option::is_none", rename = "queriesScrollState")]
1534    queries_scroll_state: Option<bool>,
1535    /// true if the query contains anchored() queries.
1536    #[serde(skip_serializing_if = "Option::is_none", rename = "queriesAnchored")]
1537    queries_anchored: Option<bool>,
1538    /// CSSContainerRule.conditionText
1539    #[serde(rename = "conditionText")]
1540    condition_text: Cow<'a, str>,
1541}
1542
1543impl<'a> CSSContainerQuery<'a> {
1544    /// Creates a builder for this type with the required parameters:
1545    /// * `text`: Container query text. Contains the query part without the container name for a single query. Deprecated in favor of conditionText which contains the full prelude after @container.
1546    /// * `condition_text`: CSSContainerRule.conditionText
1547    pub fn builder(text: impl Into<Cow<'a, str>>, condition_text: impl Into<Cow<'a, str>>) -> CSSContainerQueryBuilder<'a> {
1548        CSSContainerQueryBuilder {
1549            text: text.into(),
1550            range: None,
1551            style_sheet_id: None,
1552            name: None,
1553            physical_axes: None,
1554            logical_axes: None,
1555            queries_scroll_state: None,
1556            queries_anchored: None,
1557            condition_text: condition_text.into(),
1558        }
1559    }
1560    /// Container query text.
1561    /// Contains the query part without the container name for a single query.
1562    /// Deprecated in favor of conditionText which contains the full prelude
1563    /// after @container.
1564    pub fn text(&self) -> &str { self.text.as_ref() }
1565    /// The associated rule header range in the enclosing stylesheet (if
1566    /// available).
1567    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1568    /// Identifier of the stylesheet containing this object (if exists).
1569    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1570    /// Optional name for the container.
1571    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
1572    /// Optional physical axes queried for the container.
1573    pub fn physical_axes(&self) -> Option<&crate::dom::PhysicalAxes> { self.physical_axes.as_ref() }
1574    /// Optional logical axes queried for the container.
1575    pub fn logical_axes(&self) -> Option<&crate::dom::LogicalAxes> { self.logical_axes.as_ref() }
1576    /// true if the query contains scroll-state() queries.
1577    pub fn queries_scroll_state(&self) -> Option<bool> { self.queries_scroll_state }
1578    /// true if the query contains anchored() queries.
1579    pub fn queries_anchored(&self) -> Option<bool> { self.queries_anchored }
1580    /// CSSContainerRule.conditionText
1581    pub fn condition_text(&self) -> &str { self.condition_text.as_ref() }
1582}
1583
1584
1585pub struct CSSContainerQueryBuilder<'a> {
1586    text: Cow<'a, str>,
1587    range: Option<SourceRange>,
1588    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1589    name: Option<Cow<'a, str>>,
1590    physical_axes: Option<crate::dom::PhysicalAxes>,
1591    logical_axes: Option<crate::dom::LogicalAxes>,
1592    queries_scroll_state: Option<bool>,
1593    queries_anchored: Option<bool>,
1594    condition_text: Cow<'a, str>,
1595}
1596
1597impl<'a> CSSContainerQueryBuilder<'a> {
1598    /// The associated rule header range in the enclosing stylesheet (if
1599    /// available).
1600    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1601    /// Identifier of the stylesheet containing this object (if exists).
1602    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1603    /// Optional name for the container.
1604    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
1605    /// Optional physical axes queried for the container.
1606    pub fn physical_axes(mut self, physical_axes: crate::dom::PhysicalAxes) -> Self { self.physical_axes = Some(physical_axes); self }
1607    /// Optional logical axes queried for the container.
1608    pub fn logical_axes(mut self, logical_axes: crate::dom::LogicalAxes) -> Self { self.logical_axes = Some(logical_axes); self }
1609    /// true if the query contains scroll-state() queries.
1610    pub fn queries_scroll_state(mut self, queries_scroll_state: bool) -> Self { self.queries_scroll_state = Some(queries_scroll_state); self }
1611    /// true if the query contains anchored() queries.
1612    pub fn queries_anchored(mut self, queries_anchored: bool) -> Self { self.queries_anchored = Some(queries_anchored); self }
1613    pub fn build(self) -> CSSContainerQuery<'a> {
1614        CSSContainerQuery {
1615            text: self.text,
1616            range: self.range,
1617            style_sheet_id: self.style_sheet_id,
1618            name: self.name,
1619            physical_axes: self.physical_axes,
1620            logical_axes: self.logical_axes,
1621            queries_scroll_state: self.queries_scroll_state,
1622            queries_anchored: self.queries_anchored,
1623            condition_text: self.condition_text,
1624        }
1625    }
1626}
1627
1628/// CSS Supports at-rule descriptor.
1629
1630#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1631#[serde(rename_all = "camelCase")]
1632pub struct CSSSupports<'a> {
1633    /// Supports rule text.
1634    text: Cow<'a, str>,
1635    /// Whether the supports condition is satisfied.
1636    active: bool,
1637    /// The associated rule header range in the enclosing stylesheet (if
1638    /// available).
1639    #[serde(skip_serializing_if = "Option::is_none")]
1640    range: Option<SourceRange>,
1641    /// Identifier of the stylesheet containing this object (if exists).
1642    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1643    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1644}
1645
1646impl<'a> CSSSupports<'a> {
1647    /// Creates a builder for this type with the required parameters:
1648    /// * `text`: Supports rule text.
1649    /// * `active`: Whether the supports condition is satisfied.
1650    pub fn builder(text: impl Into<Cow<'a, str>>, active: bool) -> CSSSupportsBuilder<'a> {
1651        CSSSupportsBuilder {
1652            text: text.into(),
1653            active: active,
1654            range: None,
1655            style_sheet_id: None,
1656        }
1657    }
1658    /// Supports rule text.
1659    pub fn text(&self) -> &str { self.text.as_ref() }
1660    /// Whether the supports condition is satisfied.
1661    pub fn active(&self) -> bool { self.active }
1662    /// The associated rule header range in the enclosing stylesheet (if
1663    /// available).
1664    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1665    /// Identifier of the stylesheet containing this object (if exists).
1666    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1667}
1668
1669
1670pub struct CSSSupportsBuilder<'a> {
1671    text: Cow<'a, str>,
1672    active: bool,
1673    range: Option<SourceRange>,
1674    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1675}
1676
1677impl<'a> CSSSupportsBuilder<'a> {
1678    /// The associated rule header range in the enclosing stylesheet (if
1679    /// available).
1680    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1681    /// Identifier of the stylesheet containing this object (if exists).
1682    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1683    pub fn build(self) -> CSSSupports<'a> {
1684        CSSSupports {
1685            text: self.text,
1686            active: self.active,
1687            range: self.range,
1688            style_sheet_id: self.style_sheet_id,
1689        }
1690    }
1691}
1692
1693/// CSS Navigation at-rule descriptor.
1694
1695#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1696#[serde(rename_all = "camelCase")]
1697pub struct CSSNavigation<'a> {
1698    /// Navigation rule text.
1699    text: Cow<'a, str>,
1700    /// Whether the navigation condition is satisfied.
1701    #[serde(skip_serializing_if = "Option::is_none")]
1702    active: Option<bool>,
1703    /// The associated rule header range in the enclosing stylesheet (if
1704    /// available).
1705    #[serde(skip_serializing_if = "Option::is_none")]
1706    range: Option<SourceRange>,
1707    /// Identifier of the stylesheet containing this object (if exists).
1708    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1709    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1710}
1711
1712impl<'a> CSSNavigation<'a> {
1713    /// Creates a builder for this type with the required parameters:
1714    /// * `text`: Navigation rule text.
1715    pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSNavigationBuilder<'a> {
1716        CSSNavigationBuilder {
1717            text: text.into(),
1718            active: None,
1719            range: None,
1720            style_sheet_id: None,
1721        }
1722    }
1723    /// Navigation rule text.
1724    pub fn text(&self) -> &str { self.text.as_ref() }
1725    /// Whether the navigation condition is satisfied.
1726    pub fn active(&self) -> Option<bool> { self.active }
1727    /// The associated rule header range in the enclosing stylesheet (if
1728    /// available).
1729    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1730    /// Identifier of the stylesheet containing this object (if exists).
1731    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1732}
1733
1734
1735pub struct CSSNavigationBuilder<'a> {
1736    text: Cow<'a, str>,
1737    active: Option<bool>,
1738    range: Option<SourceRange>,
1739    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1740}
1741
1742impl<'a> CSSNavigationBuilder<'a> {
1743    /// Whether the navigation condition is satisfied.
1744    pub fn active(mut self, active: bool) -> Self { self.active = Some(active); self }
1745    /// The associated rule header range in the enclosing stylesheet (if
1746    /// available).
1747    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1748    /// Identifier of the stylesheet containing this object (if exists).
1749    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1750    pub fn build(self) -> CSSNavigation<'a> {
1751        CSSNavigation {
1752            text: self.text,
1753            active: self.active,
1754            range: self.range,
1755            style_sheet_id: self.style_sheet_id,
1756        }
1757    }
1758}
1759
1760/// CSS Scope at-rule descriptor.
1761
1762#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1763#[serde(rename_all = "camelCase")]
1764pub struct CSSScope<'a> {
1765    /// Scope rule text.
1766    text: Cow<'a, str>,
1767    /// The associated rule header range in the enclosing stylesheet (if
1768    /// available).
1769    #[serde(skip_serializing_if = "Option::is_none")]
1770    range: Option<SourceRange>,
1771    /// Identifier of the stylesheet containing this object (if exists).
1772    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1773    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1774}
1775
1776impl<'a> CSSScope<'a> {
1777    /// Creates a builder for this type with the required parameters:
1778    /// * `text`: Scope rule text.
1779    pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSScopeBuilder<'a> {
1780        CSSScopeBuilder {
1781            text: text.into(),
1782            range: None,
1783            style_sheet_id: None,
1784        }
1785    }
1786    /// Scope rule text.
1787    pub fn text(&self) -> &str { self.text.as_ref() }
1788    /// The associated rule header range in the enclosing stylesheet (if
1789    /// available).
1790    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1791    /// Identifier of the stylesheet containing this object (if exists).
1792    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1793}
1794
1795
1796pub struct CSSScopeBuilder<'a> {
1797    text: Cow<'a, str>,
1798    range: Option<SourceRange>,
1799    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1800}
1801
1802impl<'a> CSSScopeBuilder<'a> {
1803    /// The associated rule header range in the enclosing stylesheet (if
1804    /// available).
1805    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1806    /// Identifier of the stylesheet containing this object (if exists).
1807    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1808    pub fn build(self) -> CSSScope<'a> {
1809        CSSScope {
1810            text: self.text,
1811            range: self.range,
1812            style_sheet_id: self.style_sheet_id,
1813        }
1814    }
1815}
1816
1817/// CSS Layer at-rule descriptor.
1818
1819#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1820#[serde(rename_all = "camelCase")]
1821pub struct CSSLayer<'a> {
1822    /// Layer name.
1823    text: Cow<'a, str>,
1824    /// The associated rule header range in the enclosing stylesheet (if
1825    /// available).
1826    #[serde(skip_serializing_if = "Option::is_none")]
1827    range: Option<SourceRange>,
1828    /// Identifier of the stylesheet containing this object (if exists).
1829    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1830    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1831}
1832
1833impl<'a> CSSLayer<'a> {
1834    /// Creates a builder for this type with the required parameters:
1835    /// * `text`: Layer name.
1836    pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSLayerBuilder<'a> {
1837        CSSLayerBuilder {
1838            text: text.into(),
1839            range: None,
1840            style_sheet_id: None,
1841        }
1842    }
1843    /// Layer name.
1844    pub fn text(&self) -> &str { self.text.as_ref() }
1845    /// The associated rule header range in the enclosing stylesheet (if
1846    /// available).
1847    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1848    /// Identifier of the stylesheet containing this object (if exists).
1849    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1850}
1851
1852
1853pub struct CSSLayerBuilder<'a> {
1854    text: Cow<'a, str>,
1855    range: Option<SourceRange>,
1856    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1857}
1858
1859impl<'a> CSSLayerBuilder<'a> {
1860    /// The associated rule header range in the enclosing stylesheet (if
1861    /// available).
1862    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1863    /// Identifier of the stylesheet containing this object (if exists).
1864    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1865    pub fn build(self) -> CSSLayer<'a> {
1866        CSSLayer {
1867            text: self.text,
1868            range: self.range,
1869            style_sheet_id: self.style_sheet_id,
1870        }
1871    }
1872}
1873
1874/// CSS Starting Style at-rule descriptor.
1875
1876#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1877#[serde(rename_all = "camelCase")]
1878pub struct CSSStartingStyle<'a> {
1879    /// The associated rule header range in the enclosing stylesheet (if
1880    /// available).
1881    #[serde(skip_serializing_if = "Option::is_none")]
1882    range: Option<SourceRange>,
1883    /// Identifier of the stylesheet containing this object (if exists).
1884    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1885    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1886}
1887
1888impl<'a> CSSStartingStyle<'a> {
1889    /// Creates a builder for this type.
1890    pub fn builder() -> CSSStartingStyleBuilder<'a> {
1891        CSSStartingStyleBuilder {
1892            range: None,
1893            style_sheet_id: None,
1894        }
1895    }
1896    /// The associated rule header range in the enclosing stylesheet (if
1897    /// available).
1898    pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1899    /// Identifier of the stylesheet containing this object (if exists).
1900    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1901}
1902
1903#[derive(Default)]
1904pub struct CSSStartingStyleBuilder<'a> {
1905    range: Option<SourceRange>,
1906    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1907}
1908
1909impl<'a> CSSStartingStyleBuilder<'a> {
1910    /// The associated rule header range in the enclosing stylesheet (if
1911    /// available).
1912    pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1913    /// Identifier of the stylesheet containing this object (if exists).
1914    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
1915    pub fn build(self) -> CSSStartingStyle<'a> {
1916        CSSStartingStyle {
1917            range: self.range,
1918            style_sheet_id: self.style_sheet_id,
1919        }
1920    }
1921}
1922
1923/// CSS Layer data.
1924
1925#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1926#[serde(rename_all = "camelCase")]
1927pub struct CSSLayerData<'a> {
1928    /// Layer name.
1929    name: Cow<'a, str>,
1930    /// Direct sub-layers
1931    #[serde(skip_serializing_if = "Option::is_none", rename = "subLayers")]
1932    sub_layers: Option<Vec<Box<CSSLayerData<'a>>>>,
1933    /// Layer order. The order determines the order of the layer in the cascade order.
1934    /// A higher number has higher priority in the cascade order.
1935    order: f64,
1936}
1937
1938impl<'a> CSSLayerData<'a> {
1939    /// Creates a builder for this type with the required parameters:
1940    /// * `name`: Layer name.
1941    /// * `order`: Layer order. The order determines the order of the layer in the cascade order. A higher number has higher priority in the cascade order.
1942    pub fn builder(name: impl Into<Cow<'a, str>>, order: f64) -> CSSLayerDataBuilder<'a> {
1943        CSSLayerDataBuilder {
1944            name: name.into(),
1945            sub_layers: None,
1946            order: order,
1947        }
1948    }
1949    /// Layer name.
1950    pub fn name(&self) -> &str { self.name.as_ref() }
1951    /// Direct sub-layers
1952    pub fn sub_layers(&self) -> Option<&[Box<CSSLayerData<'a>>]> { self.sub_layers.as_deref() }
1953    /// Layer order. The order determines the order of the layer in the cascade order.
1954    /// A higher number has higher priority in the cascade order.
1955    pub fn order(&self) -> f64 { self.order }
1956}
1957
1958
1959pub struct CSSLayerDataBuilder<'a> {
1960    name: Cow<'a, str>,
1961    sub_layers: Option<Vec<Box<CSSLayerData<'a>>>>,
1962    order: f64,
1963}
1964
1965impl<'a> CSSLayerDataBuilder<'a> {
1966    /// Direct sub-layers
1967    pub fn sub_layers(mut self, sub_layers: Vec<Box<CSSLayerData<'a>>>) -> Self { self.sub_layers = Some(sub_layers); self }
1968    pub fn build(self) -> CSSLayerData<'a> {
1969        CSSLayerData {
1970            name: self.name,
1971            sub_layers: self.sub_layers,
1972            order: self.order,
1973        }
1974    }
1975}
1976
1977/// Information about amount of glyphs that were rendered with given font.
1978
1979#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1980#[serde(rename_all = "camelCase")]
1981pub struct PlatformFontUsage<'a> {
1982    /// Font's family name reported by platform.
1983    #[serde(rename = "familyName")]
1984    family_name: Cow<'a, str>,
1985    /// Font's PostScript name reported by platform.
1986    #[serde(rename = "postScriptName")]
1987    post_script_name: Cow<'a, str>,
1988    /// Indicates if the font was downloaded or resolved locally.
1989    #[serde(rename = "isCustomFont")]
1990    is_custom_font: bool,
1991    /// Amount of glyphs that were rendered with this font.
1992    #[serde(rename = "glyphCount")]
1993    glyph_count: f64,
1994}
1995
1996impl<'a> PlatformFontUsage<'a> {
1997    /// Creates a builder for this type with the required parameters:
1998    /// * `family_name`: Font's family name reported by platform.
1999    /// * `post_script_name`: Font's PostScript name reported by platform.
2000    /// * `is_custom_font`: Indicates if the font was downloaded or resolved locally.
2001    /// * `glyph_count`: Amount of glyphs that were rendered with this font.
2002    pub fn builder(family_name: impl Into<Cow<'a, str>>, post_script_name: impl Into<Cow<'a, str>>, is_custom_font: bool, glyph_count: f64) -> PlatformFontUsageBuilder<'a> {
2003        PlatformFontUsageBuilder {
2004            family_name: family_name.into(),
2005            post_script_name: post_script_name.into(),
2006            is_custom_font: is_custom_font,
2007            glyph_count: glyph_count,
2008        }
2009    }
2010    /// Font's family name reported by platform.
2011    pub fn family_name(&self) -> &str { self.family_name.as_ref() }
2012    /// Font's PostScript name reported by platform.
2013    pub fn post_script_name(&self) -> &str { self.post_script_name.as_ref() }
2014    /// Indicates if the font was downloaded or resolved locally.
2015    pub fn is_custom_font(&self) -> bool { self.is_custom_font }
2016    /// Amount of glyphs that were rendered with this font.
2017    pub fn glyph_count(&self) -> f64 { self.glyph_count }
2018}
2019
2020
2021pub struct PlatformFontUsageBuilder<'a> {
2022    family_name: Cow<'a, str>,
2023    post_script_name: Cow<'a, str>,
2024    is_custom_font: bool,
2025    glyph_count: f64,
2026}
2027
2028impl<'a> PlatformFontUsageBuilder<'a> {
2029    pub fn build(self) -> PlatformFontUsage<'a> {
2030        PlatformFontUsage {
2031            family_name: self.family_name,
2032            post_script_name: self.post_script_name,
2033            is_custom_font: self.is_custom_font,
2034            glyph_count: self.glyph_count,
2035        }
2036    }
2037}
2038
2039/// Information about font variation axes for variable fonts
2040
2041#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2042#[serde(rename_all = "camelCase")]
2043pub struct FontVariationAxis<'a> {
2044    /// The font-variation-setting tag (a.k.a. "axis tag").
2045    tag: Cow<'a, str>,
2046    /// Human-readable variation name in the default language (normally, "en").
2047    name: Cow<'a, str>,
2048    /// The minimum value (inclusive) the font supports for this tag.
2049    #[serde(rename = "minValue")]
2050    min_value: f64,
2051    /// The maximum value (inclusive) the font supports for this tag.
2052    #[serde(rename = "maxValue")]
2053    max_value: f64,
2054    /// The default value.
2055    #[serde(rename = "defaultValue")]
2056    default_value: f64,
2057}
2058
2059impl<'a> FontVariationAxis<'a> {
2060    /// Creates a builder for this type with the required parameters:
2061    /// * `tag`: The font-variation-setting tag (a.k.a. "axis tag").
2062    /// * `name`: Human-readable variation name in the default language (normally, "en").
2063    /// * `min_value`: The minimum value (inclusive) the font supports for this tag.
2064    /// * `max_value`: The maximum value (inclusive) the font supports for this tag.
2065    /// * `default_value`: The default value.
2066    pub fn builder(tag: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>, min_value: f64, max_value: f64, default_value: f64) -> FontVariationAxisBuilder<'a> {
2067        FontVariationAxisBuilder {
2068            tag: tag.into(),
2069            name: name.into(),
2070            min_value: min_value,
2071            max_value: max_value,
2072            default_value: default_value,
2073        }
2074    }
2075    /// The font-variation-setting tag (a.k.a. "axis tag").
2076    pub fn tag(&self) -> &str { self.tag.as_ref() }
2077    /// Human-readable variation name in the default language (normally, "en").
2078    pub fn name(&self) -> &str { self.name.as_ref() }
2079    /// The minimum value (inclusive) the font supports for this tag.
2080    pub fn min_value(&self) -> f64 { self.min_value }
2081    /// The maximum value (inclusive) the font supports for this tag.
2082    pub fn max_value(&self) -> f64 { self.max_value }
2083    /// The default value.
2084    pub fn default_value(&self) -> f64 { self.default_value }
2085}
2086
2087
2088pub struct FontVariationAxisBuilder<'a> {
2089    tag: Cow<'a, str>,
2090    name: Cow<'a, str>,
2091    min_value: f64,
2092    max_value: f64,
2093    default_value: f64,
2094}
2095
2096impl<'a> FontVariationAxisBuilder<'a> {
2097    pub fn build(self) -> FontVariationAxis<'a> {
2098        FontVariationAxis {
2099            tag: self.tag,
2100            name: self.name,
2101            min_value: self.min_value,
2102            max_value: self.max_value,
2103            default_value: self.default_value,
2104        }
2105    }
2106}
2107
2108/// Properties of a web font: <https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions>
2109/// and additional information such as platformFontFamily and fontVariationAxes.
2110
2111#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2112#[serde(rename_all = "camelCase")]
2113pub struct FontFace<'a> {
2114    /// The font-family.
2115    #[serde(rename = "fontFamily")]
2116    font_family: Cow<'a, str>,
2117    /// The font-style.
2118    #[serde(rename = "fontStyle")]
2119    font_style: Cow<'a, str>,
2120    /// The font-variant.
2121    #[serde(rename = "fontVariant")]
2122    font_variant: Cow<'a, str>,
2123    /// The font-weight.
2124    #[serde(rename = "fontWeight")]
2125    font_weight: Cow<'a, str>,
2126    /// The font-stretch.
2127    #[serde(rename = "fontStretch")]
2128    font_stretch: Cow<'a, str>,
2129    /// The font-display.
2130    #[serde(rename = "fontDisplay")]
2131    font_display: Cow<'a, str>,
2132    /// The unicode-range.
2133    #[serde(rename = "unicodeRange")]
2134    unicode_range: Cow<'a, str>,
2135    /// The src.
2136    src: Cow<'a, str>,
2137    /// The resolved platform font family
2138    #[serde(rename = "platformFontFamily")]
2139    platform_font_family: Cow<'a, str>,
2140    /// Available variation settings (a.k.a. "axes").
2141    #[serde(skip_serializing_if = "Option::is_none", rename = "fontVariationAxes")]
2142    font_variation_axes: Option<Vec<FontVariationAxis<'a>>>,
2143}
2144
2145impl<'a> FontFace<'a> {
2146    /// Creates a builder for this type with the required parameters:
2147    /// * `font_family`: The font-family.
2148    /// * `font_style`: The font-style.
2149    /// * `font_variant`: The font-variant.
2150    /// * `font_weight`: The font-weight.
2151    /// * `font_stretch`: The font-stretch.
2152    /// * `font_display`: The font-display.
2153    /// * `unicode_range`: The unicode-range.
2154    /// * `src`: The src.
2155    /// * `platform_font_family`: The resolved platform font family
2156    pub fn builder(font_family: impl Into<Cow<'a, str>>, font_style: impl Into<Cow<'a, str>>, font_variant: impl Into<Cow<'a, str>>, font_weight: impl Into<Cow<'a, str>>, font_stretch: impl Into<Cow<'a, str>>, font_display: impl Into<Cow<'a, str>>, unicode_range: impl Into<Cow<'a, str>>, src: impl Into<Cow<'a, str>>, platform_font_family: impl Into<Cow<'a, str>>) -> FontFaceBuilder<'a> {
2157        FontFaceBuilder {
2158            font_family: font_family.into(),
2159            font_style: font_style.into(),
2160            font_variant: font_variant.into(),
2161            font_weight: font_weight.into(),
2162            font_stretch: font_stretch.into(),
2163            font_display: font_display.into(),
2164            unicode_range: unicode_range.into(),
2165            src: src.into(),
2166            platform_font_family: platform_font_family.into(),
2167            font_variation_axes: None,
2168        }
2169    }
2170    /// The font-family.
2171    pub fn font_family(&self) -> &str { self.font_family.as_ref() }
2172    /// The font-style.
2173    pub fn font_style(&self) -> &str { self.font_style.as_ref() }
2174    /// The font-variant.
2175    pub fn font_variant(&self) -> &str { self.font_variant.as_ref() }
2176    /// The font-weight.
2177    pub fn font_weight(&self) -> &str { self.font_weight.as_ref() }
2178    /// The font-stretch.
2179    pub fn font_stretch(&self) -> &str { self.font_stretch.as_ref() }
2180    /// The font-display.
2181    pub fn font_display(&self) -> &str { self.font_display.as_ref() }
2182    /// The unicode-range.
2183    pub fn unicode_range(&self) -> &str { self.unicode_range.as_ref() }
2184    /// The src.
2185    pub fn src(&self) -> &str { self.src.as_ref() }
2186    /// The resolved platform font family
2187    pub fn platform_font_family(&self) -> &str { self.platform_font_family.as_ref() }
2188    /// Available variation settings (a.k.a. "axes").
2189    pub fn font_variation_axes(&self) -> Option<&[FontVariationAxis<'a>]> { self.font_variation_axes.as_deref() }
2190}
2191
2192
2193pub struct FontFaceBuilder<'a> {
2194    font_family: Cow<'a, str>,
2195    font_style: Cow<'a, str>,
2196    font_variant: Cow<'a, str>,
2197    font_weight: Cow<'a, str>,
2198    font_stretch: Cow<'a, str>,
2199    font_display: Cow<'a, str>,
2200    unicode_range: Cow<'a, str>,
2201    src: Cow<'a, str>,
2202    platform_font_family: Cow<'a, str>,
2203    font_variation_axes: Option<Vec<FontVariationAxis<'a>>>,
2204}
2205
2206impl<'a> FontFaceBuilder<'a> {
2207    /// Available variation settings (a.k.a. "axes").
2208    pub fn font_variation_axes(mut self, font_variation_axes: Vec<FontVariationAxis<'a>>) -> Self { self.font_variation_axes = Some(font_variation_axes); self }
2209    pub fn build(self) -> FontFace<'a> {
2210        FontFace {
2211            font_family: self.font_family,
2212            font_style: self.font_style,
2213            font_variant: self.font_variant,
2214            font_weight: self.font_weight,
2215            font_stretch: self.font_stretch,
2216            font_display: self.font_display,
2217            unicode_range: self.unicode_range,
2218            src: self.src,
2219            platform_font_family: self.platform_font_family,
2220            font_variation_axes: self.font_variation_axes,
2221        }
2222    }
2223}
2224
2225/// CSS try rule representation.
2226
2227#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2228#[serde(rename_all = "camelCase")]
2229pub struct CSSTryRule<'a> {
2230    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2231    /// stylesheet rules) this rule came from.
2232    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2233    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2234    /// Parent stylesheet's origin.
2235    origin: StyleSheetOrigin,
2236    /// Associated style declaration.
2237    style: CSSStyle<'a>,
2238}
2239
2240impl<'a> CSSTryRule<'a> {
2241    /// Creates a builder for this type with the required parameters:
2242    /// * `origin`: Parent stylesheet's origin.
2243    /// * `style`: Associated style declaration.
2244    pub fn builder(origin: impl Into<StyleSheetOrigin>, style: CSSStyle<'a>) -> CSSTryRuleBuilder<'a> {
2245        CSSTryRuleBuilder {
2246            style_sheet_id: None,
2247            origin: origin.into(),
2248            style: style,
2249        }
2250    }
2251    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2252    /// stylesheet rules) this rule came from.
2253    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2254    /// Parent stylesheet's origin.
2255    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2256    /// Associated style declaration.
2257    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
2258}
2259
2260
2261pub struct CSSTryRuleBuilder<'a> {
2262    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2263    origin: StyleSheetOrigin,
2264    style: CSSStyle<'a>,
2265}
2266
2267impl<'a> CSSTryRuleBuilder<'a> {
2268    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2269    /// stylesheet rules) this rule came from.
2270    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2271    pub fn build(self) -> CSSTryRule<'a> {
2272        CSSTryRule {
2273            style_sheet_id: self.style_sheet_id,
2274            origin: self.origin,
2275            style: self.style,
2276        }
2277    }
2278}
2279
2280/// CSS @position-try rule representation.
2281
2282#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2283#[serde(rename_all = "camelCase")]
2284pub struct CSSPositionTryRule<'a> {
2285    /// The prelude dashed-ident name
2286    name: ProtocolValue<'a>,
2287    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2288    /// stylesheet rules) this rule came from.
2289    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2290    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2291    /// Parent stylesheet's origin.
2292    origin: StyleSheetOrigin,
2293    /// Associated style declaration.
2294    style: CSSStyle<'a>,
2295    active: bool,
2296}
2297
2298impl<'a> CSSPositionTryRule<'a> {
2299    /// Creates a builder for this type with the required parameters:
2300    /// * `name`: The prelude dashed-ident name
2301    /// * `origin`: Parent stylesheet's origin.
2302    /// * `style`: Associated style declaration.
2303    /// * `active`: 
2304    pub fn builder(name: ProtocolValue<'a>, origin: impl Into<StyleSheetOrigin>, style: CSSStyle<'a>, active: bool) -> CSSPositionTryRuleBuilder<'a> {
2305        CSSPositionTryRuleBuilder {
2306            name: name,
2307            style_sheet_id: None,
2308            origin: origin.into(),
2309            style: style,
2310            active: active,
2311        }
2312    }
2313    /// The prelude dashed-ident name
2314    pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
2315    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2316    /// stylesheet rules) this rule came from.
2317    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2318    /// Parent stylesheet's origin.
2319    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2320    /// Associated style declaration.
2321    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
2322    pub fn active(&self) -> bool { self.active }
2323}
2324
2325
2326pub struct CSSPositionTryRuleBuilder<'a> {
2327    name: ProtocolValue<'a>,
2328    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2329    origin: StyleSheetOrigin,
2330    style: CSSStyle<'a>,
2331    active: bool,
2332}
2333
2334impl<'a> CSSPositionTryRuleBuilder<'a> {
2335    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2336    /// stylesheet rules) this rule came from.
2337    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2338    pub fn build(self) -> CSSPositionTryRule<'a> {
2339        CSSPositionTryRule {
2340            name: self.name,
2341            style_sheet_id: self.style_sheet_id,
2342            origin: self.origin,
2343            style: self.style,
2344            active: self.active,
2345        }
2346    }
2347}
2348
2349/// CSS keyframes rule representation.
2350
2351#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2352#[serde(rename_all = "camelCase")]
2353pub struct CSSKeyframesRule<'a> {
2354    /// Animation name.
2355    #[serde(rename = "animationName")]
2356    animation_name: ProtocolValue<'a>,
2357    /// List of keyframes.
2358    keyframes: Vec<CSSKeyframeRule<'a>>,
2359}
2360
2361impl<'a> CSSKeyframesRule<'a> {
2362    /// Creates a builder for this type with the required parameters:
2363    /// * `animation_name`: Animation name.
2364    /// * `keyframes`: List of keyframes.
2365    pub fn builder(animation_name: ProtocolValue<'a>, keyframes: Vec<CSSKeyframeRule<'a>>) -> CSSKeyframesRuleBuilder<'a> {
2366        CSSKeyframesRuleBuilder {
2367            animation_name: animation_name,
2368            keyframes: keyframes,
2369        }
2370    }
2371    /// Animation name.
2372    pub fn animation_name(&self) -> &ProtocolValue<'a> { &self.animation_name }
2373    /// List of keyframes.
2374    pub fn keyframes(&self) -> &[CSSKeyframeRule<'a>] { &self.keyframes }
2375}
2376
2377
2378pub struct CSSKeyframesRuleBuilder<'a> {
2379    animation_name: ProtocolValue<'a>,
2380    keyframes: Vec<CSSKeyframeRule<'a>>,
2381}
2382
2383impl<'a> CSSKeyframesRuleBuilder<'a> {
2384    pub fn build(self) -> CSSKeyframesRule<'a> {
2385        CSSKeyframesRule {
2386            animation_name: self.animation_name,
2387            keyframes: self.keyframes,
2388        }
2389    }
2390}
2391
2392/// Representation of a custom property registration through CSS.registerProperty
2393
2394#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2395#[serde(rename_all = "camelCase")]
2396pub struct CSSPropertyRegistration<'a> {
2397    #[serde(rename = "propertyName")]
2398    property_name: Cow<'a, str>,
2399    #[serde(skip_serializing_if = "Option::is_none", rename = "initialValue")]
2400    initial_value: Option<ProtocolValue<'a>>,
2401    inherits: bool,
2402    syntax: Cow<'a, str>,
2403}
2404
2405impl<'a> CSSPropertyRegistration<'a> {
2406    /// Creates a builder for this type with the required parameters:
2407    /// * `property_name`: 
2408    /// * `inherits`: 
2409    /// * `syntax`: 
2410    pub fn builder(property_name: impl Into<Cow<'a, str>>, inherits: bool, syntax: impl Into<Cow<'a, str>>) -> CSSPropertyRegistrationBuilder<'a> {
2411        CSSPropertyRegistrationBuilder {
2412            property_name: property_name.into(),
2413            initial_value: None,
2414            inherits: inherits,
2415            syntax: syntax.into(),
2416        }
2417    }
2418    pub fn property_name(&self) -> &str { self.property_name.as_ref() }
2419    pub fn initial_value(&self) -> Option<&ProtocolValue<'a>> { self.initial_value.as_ref() }
2420    pub fn inherits(&self) -> bool { self.inherits }
2421    pub fn syntax(&self) -> &str { self.syntax.as_ref() }
2422}
2423
2424
2425pub struct CSSPropertyRegistrationBuilder<'a> {
2426    property_name: Cow<'a, str>,
2427    initial_value: Option<ProtocolValue<'a>>,
2428    inherits: bool,
2429    syntax: Cow<'a, str>,
2430}
2431
2432impl<'a> CSSPropertyRegistrationBuilder<'a> {
2433    pub fn initial_value(mut self, initial_value: ProtocolValue<'a>) -> Self { self.initial_value = Some(initial_value); self }
2434    pub fn build(self) -> CSSPropertyRegistration<'a> {
2435        CSSPropertyRegistration {
2436            property_name: self.property_name,
2437            initial_value: self.initial_value,
2438            inherits: self.inherits,
2439            syntax: self.syntax,
2440        }
2441    }
2442}
2443
2444/// CSS generic @rule representation.
2445
2446#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2447#[serde(rename_all = "camelCase")]
2448pub struct CSSAtRule<'a> {
2449    /// Type of at-rule.
2450    #[serde(rename = "type")]
2451    type_: Cow<'a, str>,
2452    /// Subsection of font-feature-values, if this is a subsection.
2453    #[serde(skip_serializing_if = "Option::is_none")]
2454    subsection: Option<Cow<'a, str>>,
2455    /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType)
2456    /// Associated name, if applicable.
2457    #[serde(skip_serializing_if = "Option::is_none")]
2458    name: Option<ProtocolValue<'a>>,
2459    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2460    /// stylesheet rules) this rule came from.
2461    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2462    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2463    /// Parent stylesheet's origin.
2464    origin: StyleSheetOrigin,
2465    /// Associated style declaration.
2466    style: CSSStyle<'a>,
2467}
2468
2469impl<'a> CSSAtRule<'a> {
2470    /// Creates a builder for this type with the required parameters:
2471    /// * `type_`: Type of at-rule.
2472    /// * `origin`: Parent stylesheet's origin.
2473    /// * `style`: Associated style declaration.
2474    pub fn builder(type_: impl Into<Cow<'a, str>>, origin: impl Into<StyleSheetOrigin>, style: CSSStyle<'a>) -> CSSAtRuleBuilder<'a> {
2475        CSSAtRuleBuilder {
2476            type_: type_.into(),
2477            subsection: None,
2478            name: None,
2479            style_sheet_id: None,
2480            origin: origin.into(),
2481            style: style,
2482        }
2483    }
2484    /// Type of at-rule.
2485    pub fn type_(&self) -> &str { self.type_.as_ref() }
2486    /// Subsection of font-feature-values, if this is a subsection.
2487    pub fn subsection(&self) -> Option<&str> { self.subsection.as_deref() }
2488    /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType)
2489    /// Associated name, if applicable.
2490    pub fn name(&self) -> Option<&ProtocolValue<'a>> { self.name.as_ref() }
2491    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2492    /// stylesheet rules) this rule came from.
2493    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2494    /// Parent stylesheet's origin.
2495    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2496    /// Associated style declaration.
2497    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
2498}
2499
2500
2501pub struct CSSAtRuleBuilder<'a> {
2502    type_: Cow<'a, str>,
2503    subsection: Option<Cow<'a, str>>,
2504    name: Option<ProtocolValue<'a>>,
2505    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2506    origin: StyleSheetOrigin,
2507    style: CSSStyle<'a>,
2508}
2509
2510impl<'a> CSSAtRuleBuilder<'a> {
2511    /// Subsection of font-feature-values, if this is a subsection.
2512    pub fn subsection(mut self, subsection: impl Into<Cow<'a, str>>) -> Self { self.subsection = Some(subsection.into()); self }
2513    /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType)
2514    /// Associated name, if applicable.
2515    pub fn name(mut self, name: ProtocolValue<'a>) -> Self { self.name = Some(name); self }
2516    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2517    /// stylesheet rules) this rule came from.
2518    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2519    pub fn build(self) -> CSSAtRule<'a> {
2520        CSSAtRule {
2521            type_: self.type_,
2522            subsection: self.subsection,
2523            name: self.name,
2524            style_sheet_id: self.style_sheet_id,
2525            origin: self.origin,
2526            style: self.style,
2527        }
2528    }
2529}
2530
2531/// CSS property at-rule representation.
2532
2533#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2534#[serde(rename_all = "camelCase")]
2535pub struct CSSPropertyRule<'a> {
2536    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2537    /// stylesheet rules) this rule came from.
2538    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2539    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2540    /// Parent stylesheet's origin.
2541    origin: StyleSheetOrigin,
2542    /// Associated property name.
2543    #[serde(rename = "propertyName")]
2544    property_name: ProtocolValue<'a>,
2545    /// Associated style declaration.
2546    style: CSSStyle<'a>,
2547}
2548
2549impl<'a> CSSPropertyRule<'a> {
2550    /// Creates a builder for this type with the required parameters:
2551    /// * `origin`: Parent stylesheet's origin.
2552    /// * `property_name`: Associated property name.
2553    /// * `style`: Associated style declaration.
2554    pub fn builder(origin: impl Into<StyleSheetOrigin>, property_name: ProtocolValue<'a>, style: CSSStyle<'a>) -> CSSPropertyRuleBuilder<'a> {
2555        CSSPropertyRuleBuilder {
2556            style_sheet_id: None,
2557            origin: origin.into(),
2558            property_name: property_name,
2559            style: style,
2560        }
2561    }
2562    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2563    /// stylesheet rules) this rule came from.
2564    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2565    /// Parent stylesheet's origin.
2566    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2567    /// Associated property name.
2568    pub fn property_name(&self) -> &ProtocolValue<'a> { &self.property_name }
2569    /// Associated style declaration.
2570    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
2571}
2572
2573
2574pub struct CSSPropertyRuleBuilder<'a> {
2575    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2576    origin: StyleSheetOrigin,
2577    property_name: ProtocolValue<'a>,
2578    style: CSSStyle<'a>,
2579}
2580
2581impl<'a> CSSPropertyRuleBuilder<'a> {
2582    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2583    /// stylesheet rules) this rule came from.
2584    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2585    pub fn build(self) -> CSSPropertyRule<'a> {
2586        CSSPropertyRule {
2587            style_sheet_id: self.style_sheet_id,
2588            origin: self.origin,
2589            property_name: self.property_name,
2590            style: self.style,
2591        }
2592    }
2593}
2594
2595/// CSS function argument representation.
2596
2597#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2598#[serde(rename_all = "camelCase")]
2599pub struct CSSFunctionParameter<'a> {
2600    /// The parameter name.
2601    name: Cow<'a, str>,
2602    /// The parameter type.
2603    #[serde(rename = "type")]
2604    type_: Cow<'a, str>,
2605}
2606
2607impl<'a> CSSFunctionParameter<'a> {
2608    /// Creates a builder for this type with the required parameters:
2609    /// * `name`: The parameter name.
2610    /// * `type_`: The parameter type.
2611    pub fn builder(name: impl Into<Cow<'a, str>>, type_: impl Into<Cow<'a, str>>) -> CSSFunctionParameterBuilder<'a> {
2612        CSSFunctionParameterBuilder {
2613            name: name.into(),
2614            type_: type_.into(),
2615        }
2616    }
2617    /// The parameter name.
2618    pub fn name(&self) -> &str { self.name.as_ref() }
2619    /// The parameter type.
2620    pub fn type_(&self) -> &str { self.type_.as_ref() }
2621}
2622
2623
2624pub struct CSSFunctionParameterBuilder<'a> {
2625    name: Cow<'a, str>,
2626    type_: Cow<'a, str>,
2627}
2628
2629impl<'a> CSSFunctionParameterBuilder<'a> {
2630    pub fn build(self) -> CSSFunctionParameter<'a> {
2631        CSSFunctionParameter {
2632            name: self.name,
2633            type_: self.type_,
2634        }
2635    }
2636}
2637
2638/// CSS function conditional block representation.
2639
2640#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2641#[serde(rename_all = "camelCase")]
2642pub struct CSSFunctionConditionNode<'a> {
2643    /// Media query for this conditional block. Only one type of condition should be set.
2644    #[serde(skip_serializing_if = "Option::is_none")]
2645    media: Option<CSSMedia<'a>>,
2646    /// Container query for this conditional block. Only one type of condition should be set.
2647    #[serde(skip_serializing_if = "Option::is_none", rename = "containerQueries")]
2648    container_queries: Option<CSSContainerQuery<'a>>,
2649    /// @supports CSS at-rule condition. Only one type of condition should be set.
2650    #[serde(skip_serializing_if = "Option::is_none")]
2651    supports: Option<CSSSupports<'a>>,
2652    /// @navigation condition. Only one type of condition should be set.
2653    #[serde(skip_serializing_if = "Option::is_none")]
2654    navigation: Option<CSSNavigation<'a>>,
2655    /// Block body.
2656    children: Vec<CSSFunctionNode<'a>>,
2657    /// The condition text.
2658    #[serde(rename = "conditionText")]
2659    condition_text: Cow<'a, str>,
2660}
2661
2662impl<'a> CSSFunctionConditionNode<'a> {
2663    /// Creates a builder for this type with the required parameters:
2664    /// * `children`: Block body.
2665    /// * `condition_text`: The condition text.
2666    pub fn builder(children: Vec<CSSFunctionNode<'a>>, condition_text: impl Into<Cow<'a, str>>) -> CSSFunctionConditionNodeBuilder<'a> {
2667        CSSFunctionConditionNodeBuilder {
2668            media: None,
2669            container_queries: None,
2670            supports: None,
2671            navigation: None,
2672            children: children,
2673            condition_text: condition_text.into(),
2674        }
2675    }
2676    /// Media query for this conditional block. Only one type of condition should be set.
2677    pub fn media(&self) -> Option<&CSSMedia<'a>> { self.media.as_ref() }
2678    /// Container query for this conditional block. Only one type of condition should be set.
2679    pub fn container_queries(&self) -> Option<&CSSContainerQuery<'a>> { self.container_queries.as_ref() }
2680    /// @supports CSS at-rule condition. Only one type of condition should be set.
2681    pub fn supports(&self) -> Option<&CSSSupports<'a>> { self.supports.as_ref() }
2682    /// @navigation condition. Only one type of condition should be set.
2683    pub fn navigation(&self) -> Option<&CSSNavigation<'a>> { self.navigation.as_ref() }
2684    /// Block body.
2685    pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
2686    /// The condition text.
2687    pub fn condition_text(&self) -> &str { self.condition_text.as_ref() }
2688}
2689
2690
2691pub struct CSSFunctionConditionNodeBuilder<'a> {
2692    media: Option<CSSMedia<'a>>,
2693    container_queries: Option<CSSContainerQuery<'a>>,
2694    supports: Option<CSSSupports<'a>>,
2695    navigation: Option<CSSNavigation<'a>>,
2696    children: Vec<CSSFunctionNode<'a>>,
2697    condition_text: Cow<'a, str>,
2698}
2699
2700impl<'a> CSSFunctionConditionNodeBuilder<'a> {
2701    /// Media query for this conditional block. Only one type of condition should be set.
2702    pub fn media(mut self, media: CSSMedia<'a>) -> Self { self.media = Some(media); self }
2703    /// Container query for this conditional block. Only one type of condition should be set.
2704    pub fn container_queries(mut self, container_queries: CSSContainerQuery<'a>) -> Self { self.container_queries = Some(container_queries); self }
2705    /// @supports CSS at-rule condition. Only one type of condition should be set.
2706    pub fn supports(mut self, supports: CSSSupports<'a>) -> Self { self.supports = Some(supports); self }
2707    /// @navigation condition. Only one type of condition should be set.
2708    pub fn navigation(mut self, navigation: CSSNavigation<'a>) -> Self { self.navigation = Some(navigation); self }
2709    pub fn build(self) -> CSSFunctionConditionNode<'a> {
2710        CSSFunctionConditionNode {
2711            media: self.media,
2712            container_queries: self.container_queries,
2713            supports: self.supports,
2714            navigation: self.navigation,
2715            children: self.children,
2716            condition_text: self.condition_text,
2717        }
2718    }
2719}
2720
2721/// Section of the body of a CSS function rule.
2722
2723#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2724#[serde(rename_all = "camelCase")]
2725pub struct CSSFunctionNode<'a> {
2726    /// A conditional block. If set, style should not be set.
2727    #[serde(skip_serializing_if = "Option::is_none")]
2728    condition: Option<CSSFunctionConditionNode<'a>>,
2729    /// Values set by this node. If set, condition should not be set.
2730    #[serde(skip_serializing_if = "Option::is_none")]
2731    style: Option<CSSStyle<'a>>,
2732}
2733
2734impl<'a> CSSFunctionNode<'a> {
2735    /// Creates a builder for this type.
2736    pub fn builder() -> CSSFunctionNodeBuilder<'a> {
2737        CSSFunctionNodeBuilder {
2738            condition: None,
2739            style: None,
2740        }
2741    }
2742    /// A conditional block. If set, style should not be set.
2743    pub fn condition(&self) -> Option<&CSSFunctionConditionNode<'a>> { self.condition.as_ref() }
2744    /// Values set by this node. If set, condition should not be set.
2745    pub fn style(&self) -> Option<&CSSStyle<'a>> { self.style.as_ref() }
2746}
2747
2748#[derive(Default)]
2749pub struct CSSFunctionNodeBuilder<'a> {
2750    condition: Option<CSSFunctionConditionNode<'a>>,
2751    style: Option<CSSStyle<'a>>,
2752}
2753
2754impl<'a> CSSFunctionNodeBuilder<'a> {
2755    /// A conditional block. If set, style should not be set.
2756    pub fn condition(mut self, condition: CSSFunctionConditionNode<'a>) -> Self { self.condition = Some(condition); self }
2757    /// Values set by this node. If set, condition should not be set.
2758    pub fn style(mut self, style: CSSStyle<'a>) -> Self { self.style = Some(style); self }
2759    pub fn build(self) -> CSSFunctionNode<'a> {
2760        CSSFunctionNode {
2761            condition: self.condition,
2762            style: self.style,
2763        }
2764    }
2765}
2766
2767/// CSS function at-rule representation.
2768
2769#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2770#[serde(rename_all = "camelCase")]
2771pub struct CSSFunctionRule<'a> {
2772    /// Name of the function.
2773    name: ProtocolValue<'a>,
2774    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2775    /// stylesheet rules) this rule came from.
2776    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2777    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2778    /// Parent stylesheet's origin.
2779    origin: StyleSheetOrigin,
2780    /// List of parameters.
2781    parameters: Vec<CSSFunctionParameter<'a>>,
2782    /// Function body.
2783    children: Vec<CSSFunctionNode<'a>>,
2784    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
2785    #[serde(skip_serializing_if = "Option::is_none", rename = "originTreeScopeNodeId")]
2786    origin_tree_scope_node_id: Option<crate::dom::BackendNodeId>,
2787}
2788
2789impl<'a> CSSFunctionRule<'a> {
2790    /// Creates a builder for this type with the required parameters:
2791    /// * `name`: Name of the function.
2792    /// * `origin`: Parent stylesheet's origin.
2793    /// * `parameters`: List of parameters.
2794    /// * `children`: Function body.
2795    pub fn builder(name: ProtocolValue<'a>, origin: impl Into<StyleSheetOrigin>, parameters: Vec<CSSFunctionParameter<'a>>, children: Vec<CSSFunctionNode<'a>>) -> CSSFunctionRuleBuilder<'a> {
2796        CSSFunctionRuleBuilder {
2797            name: name,
2798            style_sheet_id: None,
2799            origin: origin.into(),
2800            parameters: parameters,
2801            children: children,
2802            origin_tree_scope_node_id: None,
2803        }
2804    }
2805    /// Name of the function.
2806    pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
2807    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2808    /// stylesheet rules) this rule came from.
2809    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2810    /// Parent stylesheet's origin.
2811    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2812    /// List of parameters.
2813    pub fn parameters(&self) -> &[CSSFunctionParameter<'a>] { &self.parameters }
2814    /// Function body.
2815    pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
2816    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
2817    pub fn origin_tree_scope_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.origin_tree_scope_node_id.as_ref() }
2818}
2819
2820
2821pub struct CSSFunctionRuleBuilder<'a> {
2822    name: ProtocolValue<'a>,
2823    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2824    origin: StyleSheetOrigin,
2825    parameters: Vec<CSSFunctionParameter<'a>>,
2826    children: Vec<CSSFunctionNode<'a>>,
2827    origin_tree_scope_node_id: Option<crate::dom::BackendNodeId>,
2828}
2829
2830impl<'a> CSSFunctionRuleBuilder<'a> {
2831    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2832    /// stylesheet rules) this rule came from.
2833    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2834    /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
2835    pub fn origin_tree_scope_node_id(mut self, origin_tree_scope_node_id: crate::dom::BackendNodeId) -> Self { self.origin_tree_scope_node_id = Some(origin_tree_scope_node_id); self }
2836    pub fn build(self) -> CSSFunctionRule<'a> {
2837        CSSFunctionRule {
2838            name: self.name,
2839            style_sheet_id: self.style_sheet_id,
2840            origin: self.origin,
2841            parameters: self.parameters,
2842            children: self.children,
2843            origin_tree_scope_node_id: self.origin_tree_scope_node_id,
2844        }
2845    }
2846}
2847
2848/// CSS keyframe rule representation.
2849
2850#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2851#[serde(rename_all = "camelCase")]
2852pub struct CSSKeyframeRule<'a> {
2853    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2854    /// stylesheet rules) this rule came from.
2855    #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2856    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2857    /// Parent stylesheet's origin.
2858    origin: StyleSheetOrigin,
2859    /// Associated key text.
2860    #[serde(rename = "keyText")]
2861    key_text: ProtocolValue<'a>,
2862    /// Associated style declaration.
2863    style: CSSStyle<'a>,
2864}
2865
2866impl<'a> CSSKeyframeRule<'a> {
2867    /// Creates a builder for this type with the required parameters:
2868    /// * `origin`: Parent stylesheet's origin.
2869    /// * `key_text`: Associated key text.
2870    /// * `style`: Associated style declaration.
2871    pub fn builder(origin: impl Into<StyleSheetOrigin>, key_text: ProtocolValue<'a>, style: CSSStyle<'a>) -> CSSKeyframeRuleBuilder<'a> {
2872        CSSKeyframeRuleBuilder {
2873            style_sheet_id: None,
2874            origin: origin.into(),
2875            key_text: key_text,
2876            style: style,
2877        }
2878    }
2879    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2880    /// stylesheet rules) this rule came from.
2881    pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2882    /// Parent stylesheet's origin.
2883    pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2884    /// Associated key text.
2885    pub fn key_text(&self) -> &ProtocolValue<'a> { &self.key_text }
2886    /// Associated style declaration.
2887    pub fn style(&self) -> &CSSStyle<'a> { &self.style }
2888}
2889
2890
2891pub struct CSSKeyframeRuleBuilder<'a> {
2892    style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2893    origin: StyleSheetOrigin,
2894    key_text: ProtocolValue<'a>,
2895    style: CSSStyle<'a>,
2896}
2897
2898impl<'a> CSSKeyframeRuleBuilder<'a> {
2899    /// The css style sheet identifier (absent for user agent stylesheet and user-specified
2900    /// stylesheet rules) this rule came from.
2901    pub fn style_sheet_id(mut self, style_sheet_id: crate::dom::StyleSheetId<'a>) -> Self { self.style_sheet_id = Some(style_sheet_id); self }
2902    pub fn build(self) -> CSSKeyframeRule<'a> {
2903        CSSKeyframeRule {
2904            style_sheet_id: self.style_sheet_id,
2905            origin: self.origin,
2906            key_text: self.key_text,
2907            style: self.style,
2908        }
2909    }
2910}
2911
2912/// A descriptor of operation to mutate style declaration text.
2913
2914#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2915#[serde(rename_all = "camelCase")]
2916pub struct StyleDeclarationEdit<'a> {
2917    /// The css style sheet identifier.
2918    #[serde(rename = "styleSheetId")]
2919    style_sheet_id: crate::dom::StyleSheetId<'a>,
2920    /// The range of the style text in the enclosing stylesheet.
2921    range: SourceRange,
2922    /// New style text.
2923    text: Cow<'a, str>,
2924}
2925
2926impl<'a> StyleDeclarationEdit<'a> {
2927    /// Creates a builder for this type with the required parameters:
2928    /// * `style_sheet_id`: The css style sheet identifier.
2929    /// * `range`: The range of the style text in the enclosing stylesheet.
2930    /// * `text`: New style text.
2931    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> StyleDeclarationEditBuilder<'a> {
2932        StyleDeclarationEditBuilder {
2933            style_sheet_id: style_sheet_id,
2934            range: range,
2935            text: text.into(),
2936        }
2937    }
2938    /// The css style sheet identifier.
2939    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
2940    /// The range of the style text in the enclosing stylesheet.
2941    pub fn range(&self) -> &SourceRange { &self.range }
2942    /// New style text.
2943    pub fn text(&self) -> &str { self.text.as_ref() }
2944}
2945
2946
2947pub struct StyleDeclarationEditBuilder<'a> {
2948    style_sheet_id: crate::dom::StyleSheetId<'a>,
2949    range: SourceRange,
2950    text: Cow<'a, str>,
2951}
2952
2953impl<'a> StyleDeclarationEditBuilder<'a> {
2954    pub fn build(self) -> StyleDeclarationEdit<'a> {
2955        StyleDeclarationEdit {
2956            style_sheet_id: self.style_sheet_id,
2957            range: self.range,
2958            text: self.text,
2959        }
2960    }
2961}
2962
2963/// Inserts a new rule with the given 'ruleText' in a stylesheet with given 'styleSheetId', at the
2964/// position specified by 'location'.
2965
2966#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2967#[serde(rename_all = "camelCase")]
2968pub struct AddRuleParams<'a> {
2969    /// The css style sheet identifier where a new rule should be inserted.
2970    #[serde(rename = "styleSheetId")]
2971    style_sheet_id: crate::dom::StyleSheetId<'a>,
2972    /// The text of a new rule.
2973    #[serde(rename = "ruleText")]
2974    rule_text: Cow<'a, str>,
2975    /// Text position of a new rule in the target style sheet.
2976    location: SourceRange,
2977    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
2978    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
2979    /// incorrect results if the declaration contains a var() for example.
2980    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeForPropertySyntaxValidation")]
2981    node_for_property_syntax_validation: Option<crate::dom::NodeId>,
2982}
2983
2984impl<'a> AddRuleParams<'a> {
2985    /// Creates a builder for this type with the required parameters:
2986    /// * `style_sheet_id`: The css style sheet identifier where a new rule should be inserted.
2987    /// * `rule_text`: The text of a new rule.
2988    /// * `location`: Text position of a new rule in the target style sheet.
2989    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, rule_text: impl Into<Cow<'a, str>>, location: SourceRange) -> AddRuleParamsBuilder<'a> {
2990        AddRuleParamsBuilder {
2991            style_sheet_id: style_sheet_id,
2992            rule_text: rule_text.into(),
2993            location: location,
2994            node_for_property_syntax_validation: None,
2995        }
2996    }
2997    /// The css style sheet identifier where a new rule should be inserted.
2998    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
2999    /// The text of a new rule.
3000    pub fn rule_text(&self) -> &str { self.rule_text.as_ref() }
3001    /// Text position of a new rule in the target style sheet.
3002    pub fn location(&self) -> &SourceRange { &self.location }
3003    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
3004    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
3005    /// incorrect results if the declaration contains a var() for example.
3006    pub fn node_for_property_syntax_validation(&self) -> Option<&crate::dom::NodeId> { self.node_for_property_syntax_validation.as_ref() }
3007}
3008
3009
3010pub struct AddRuleParamsBuilder<'a> {
3011    style_sheet_id: crate::dom::StyleSheetId<'a>,
3012    rule_text: Cow<'a, str>,
3013    location: SourceRange,
3014    node_for_property_syntax_validation: Option<crate::dom::NodeId>,
3015}
3016
3017impl<'a> AddRuleParamsBuilder<'a> {
3018    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
3019    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
3020    /// incorrect results if the declaration contains a var() for example.
3021    pub fn node_for_property_syntax_validation(mut self, node_for_property_syntax_validation: crate::dom::NodeId) -> Self { self.node_for_property_syntax_validation = Some(node_for_property_syntax_validation); self }
3022    pub fn build(self) -> AddRuleParams<'a> {
3023        AddRuleParams {
3024            style_sheet_id: self.style_sheet_id,
3025            rule_text: self.rule_text,
3026            location: self.location,
3027            node_for_property_syntax_validation: self.node_for_property_syntax_validation,
3028        }
3029    }
3030}
3031
3032/// Inserts a new rule with the given 'ruleText' in a stylesheet with given 'styleSheetId', at the
3033/// position specified by 'location'.
3034
3035#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3036#[serde(rename_all = "camelCase")]
3037pub struct AddRuleReturns<'a> {
3038    /// The newly created rule.
3039    rule: CSSRule<'a>,
3040}
3041
3042impl<'a> AddRuleReturns<'a> {
3043    /// Creates a builder for this type with the required parameters:
3044    /// * `rule`: The newly created rule.
3045    pub fn builder(rule: CSSRule<'a>) -> AddRuleReturnsBuilder<'a> {
3046        AddRuleReturnsBuilder {
3047            rule: rule,
3048        }
3049    }
3050    /// The newly created rule.
3051    pub fn rule(&self) -> &CSSRule<'a> { &self.rule }
3052}
3053
3054
3055pub struct AddRuleReturnsBuilder<'a> {
3056    rule: CSSRule<'a>,
3057}
3058
3059impl<'a> AddRuleReturnsBuilder<'a> {
3060    pub fn build(self) -> AddRuleReturns<'a> {
3061        AddRuleReturns {
3062            rule: self.rule,
3063        }
3064    }
3065}
3066
3067impl<'a> AddRuleParams<'a> { pub const METHOD: &'static str = "CSS.addRule"; }
3068
3069impl<'a> crate::CdpCommand<'a> for AddRuleParams<'a> {
3070    const METHOD: &'static str = "CSS.addRule";
3071    type Response = AddRuleReturns<'a>;
3072}
3073
3074/// Returns all class names from specified stylesheet.
3075
3076#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3077#[serde(rename_all = "camelCase")]
3078pub struct CollectClassNamesParams<'a> {
3079    #[serde(rename = "styleSheetId")]
3080    style_sheet_id: crate::dom::StyleSheetId<'a>,
3081}
3082
3083impl<'a> CollectClassNamesParams<'a> {
3084    /// Creates a builder for this type with the required parameters:
3085    /// * `style_sheet_id`: 
3086    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>) -> CollectClassNamesParamsBuilder<'a> {
3087        CollectClassNamesParamsBuilder {
3088            style_sheet_id: style_sheet_id,
3089        }
3090    }
3091    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
3092}
3093
3094
3095pub struct CollectClassNamesParamsBuilder<'a> {
3096    style_sheet_id: crate::dom::StyleSheetId<'a>,
3097}
3098
3099impl<'a> CollectClassNamesParamsBuilder<'a> {
3100    pub fn build(self) -> CollectClassNamesParams<'a> {
3101        CollectClassNamesParams {
3102            style_sheet_id: self.style_sheet_id,
3103        }
3104    }
3105}
3106
3107/// Returns all class names from specified stylesheet.
3108
3109#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3110#[serde(rename_all = "camelCase")]
3111pub struct CollectClassNamesReturns<'a> {
3112    /// Class name list.
3113    #[serde(rename = "classNames")]
3114    class_names: Vec<Cow<'a, str>>,
3115}
3116
3117impl<'a> CollectClassNamesReturns<'a> {
3118    /// Creates a builder for this type with the required parameters:
3119    /// * `class_names`: Class name list.
3120    pub fn builder(class_names: Vec<Cow<'a, str>>) -> CollectClassNamesReturnsBuilder<'a> {
3121        CollectClassNamesReturnsBuilder {
3122            class_names: class_names,
3123        }
3124    }
3125    /// Class name list.
3126    pub fn class_names(&self) -> &[Cow<'a, str>] { &self.class_names }
3127}
3128
3129
3130pub struct CollectClassNamesReturnsBuilder<'a> {
3131    class_names: Vec<Cow<'a, str>>,
3132}
3133
3134impl<'a> CollectClassNamesReturnsBuilder<'a> {
3135    pub fn build(self) -> CollectClassNamesReturns<'a> {
3136        CollectClassNamesReturns {
3137            class_names: self.class_names,
3138        }
3139    }
3140}
3141
3142impl<'a> CollectClassNamesParams<'a> { pub const METHOD: &'static str = "CSS.collectClassNames"; }
3143
3144impl<'a> crate::CdpCommand<'a> for CollectClassNamesParams<'a> {
3145    const METHOD: &'static str = "CSS.collectClassNames";
3146    type Response = CollectClassNamesReturns<'a>;
3147}
3148
3149/// Creates a new special "via-inspector" stylesheet in the frame with given 'frameId'.
3150
3151#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3152#[serde(rename_all = "camelCase")]
3153pub struct CreateStyleSheetParams<'a> {
3154    /// Identifier of the frame where "via-inspector" stylesheet should be created.
3155    #[serde(rename = "frameId")]
3156    frame_id: crate::page::FrameId<'a>,
3157    /// If true, creates a new stylesheet for every call. If false,
3158    /// returns a stylesheet previously created by a call with force=false
3159    /// for the frame's document if it exists or creates a new stylesheet
3160    /// (default: false).
3161    #[serde(skip_serializing_if = "Option::is_none")]
3162    force: Option<bool>,
3163}
3164
3165impl<'a> CreateStyleSheetParams<'a> {
3166    /// Creates a builder for this type with the required parameters:
3167    /// * `frame_id`: Identifier of the frame where "via-inspector" stylesheet should be created.
3168    pub fn builder(frame_id: crate::page::FrameId<'a>) -> CreateStyleSheetParamsBuilder<'a> {
3169        CreateStyleSheetParamsBuilder {
3170            frame_id: frame_id,
3171            force: None,
3172        }
3173    }
3174    /// Identifier of the frame where "via-inspector" stylesheet should be created.
3175    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
3176    /// If true, creates a new stylesheet for every call. If false,
3177    /// returns a stylesheet previously created by a call with force=false
3178    /// for the frame's document if it exists or creates a new stylesheet
3179    /// (default: false).
3180    pub fn force(&self) -> Option<bool> { self.force }
3181}
3182
3183
3184pub struct CreateStyleSheetParamsBuilder<'a> {
3185    frame_id: crate::page::FrameId<'a>,
3186    force: Option<bool>,
3187}
3188
3189impl<'a> CreateStyleSheetParamsBuilder<'a> {
3190    /// If true, creates a new stylesheet for every call. If false,
3191    /// returns a stylesheet previously created by a call with force=false
3192    /// for the frame's document if it exists or creates a new stylesheet
3193    /// (default: false).
3194    pub fn force(mut self, force: bool) -> Self { self.force = Some(force); self }
3195    pub fn build(self) -> CreateStyleSheetParams<'a> {
3196        CreateStyleSheetParams {
3197            frame_id: self.frame_id,
3198            force: self.force,
3199        }
3200    }
3201}
3202
3203/// Creates a new special "via-inspector" stylesheet in the frame with given 'frameId'.
3204
3205#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3206#[serde(rename_all = "camelCase")]
3207pub struct CreateStyleSheetReturns<'a> {
3208    /// Identifier of the created "via-inspector" stylesheet.
3209    #[serde(rename = "styleSheetId")]
3210    style_sheet_id: crate::dom::StyleSheetId<'a>,
3211}
3212
3213impl<'a> CreateStyleSheetReturns<'a> {
3214    /// Creates a builder for this type with the required parameters:
3215    /// * `style_sheet_id`: Identifier of the created "via-inspector" stylesheet.
3216    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>) -> CreateStyleSheetReturnsBuilder<'a> {
3217        CreateStyleSheetReturnsBuilder {
3218            style_sheet_id: style_sheet_id,
3219        }
3220    }
3221    /// Identifier of the created "via-inspector" stylesheet.
3222    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
3223}
3224
3225
3226pub struct CreateStyleSheetReturnsBuilder<'a> {
3227    style_sheet_id: crate::dom::StyleSheetId<'a>,
3228}
3229
3230impl<'a> CreateStyleSheetReturnsBuilder<'a> {
3231    pub fn build(self) -> CreateStyleSheetReturns<'a> {
3232        CreateStyleSheetReturns {
3233            style_sheet_id: self.style_sheet_id,
3234        }
3235    }
3236}
3237
3238impl<'a> CreateStyleSheetParams<'a> { pub const METHOD: &'static str = "CSS.createStyleSheet"; }
3239
3240impl<'a> crate::CdpCommand<'a> for CreateStyleSheetParams<'a> {
3241    const METHOD: &'static str = "CSS.createStyleSheet";
3242    type Response = CreateStyleSheetReturns<'a>;
3243}
3244
3245#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3246pub struct DisableParams {}
3247
3248impl DisableParams { pub const METHOD: &'static str = "CSS.disable"; }
3249
3250impl<'a> crate::CdpCommand<'a> for DisableParams {
3251    const METHOD: &'static str = "CSS.disable";
3252    type Response = crate::EmptyReturns;
3253}
3254
3255#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3256pub struct EnableParams {}
3257
3258impl EnableParams { pub const METHOD: &'static str = "CSS.enable"; }
3259
3260impl<'a> crate::CdpCommand<'a> for EnableParams {
3261    const METHOD: &'static str = "CSS.enable";
3262    type Response = crate::EmptyReturns;
3263}
3264
3265/// Ensures that the given node will have specified pseudo-classes whenever its style is computed by
3266/// the browser.
3267
3268#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3269#[serde(rename_all = "camelCase")]
3270pub struct ForcePseudoStateParams<'a> {
3271    /// The element id for which to force the pseudo state.
3272    #[serde(rename = "nodeId")]
3273    node_id: crate::dom::NodeId,
3274    /// Element pseudo classes to force when computing the element's style.
3275    #[serde(rename = "forcedPseudoClasses")]
3276    forced_pseudo_classes: Vec<Cow<'a, str>>,
3277}
3278
3279impl<'a> ForcePseudoStateParams<'a> {
3280    /// Creates a builder for this type with the required parameters:
3281    /// * `node_id`: The element id for which to force the pseudo state.
3282    /// * `forced_pseudo_classes`: Element pseudo classes to force when computing the element's style.
3283    pub fn builder(node_id: crate::dom::NodeId, forced_pseudo_classes: Vec<Cow<'a, str>>) -> ForcePseudoStateParamsBuilder<'a> {
3284        ForcePseudoStateParamsBuilder {
3285            node_id: node_id,
3286            forced_pseudo_classes: forced_pseudo_classes,
3287        }
3288    }
3289    /// The element id for which to force the pseudo state.
3290    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3291    /// Element pseudo classes to force when computing the element's style.
3292    pub fn forced_pseudo_classes(&self) -> &[Cow<'a, str>] { &self.forced_pseudo_classes }
3293}
3294
3295
3296pub struct ForcePseudoStateParamsBuilder<'a> {
3297    node_id: crate::dom::NodeId,
3298    forced_pseudo_classes: Vec<Cow<'a, str>>,
3299}
3300
3301impl<'a> ForcePseudoStateParamsBuilder<'a> {
3302    pub fn build(self) -> ForcePseudoStateParams<'a> {
3303        ForcePseudoStateParams {
3304            node_id: self.node_id,
3305            forced_pseudo_classes: self.forced_pseudo_classes,
3306        }
3307    }
3308}
3309
3310impl<'a> ForcePseudoStateParams<'a> { pub const METHOD: &'static str = "CSS.forcePseudoState"; }
3311
3312impl<'a> crate::CdpCommand<'a> for ForcePseudoStateParams<'a> {
3313    const METHOD: &'static str = "CSS.forcePseudoState";
3314    type Response = crate::EmptyReturns;
3315}
3316
3317/// Ensures that the given node is in its starting-style state.
3318
3319#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3320#[serde(rename_all = "camelCase")]
3321pub struct ForceStartingStyleParams {
3322    /// The element id for which to force the starting-style state.
3323    #[serde(rename = "nodeId")]
3324    node_id: crate::dom::NodeId,
3325    /// Boolean indicating if this is on or off.
3326    forced: bool,
3327}
3328
3329impl ForceStartingStyleParams {
3330    /// Creates a builder for this type with the required parameters:
3331    /// * `node_id`: The element id for which to force the starting-style state.
3332    /// * `forced`: Boolean indicating if this is on or off.
3333    pub fn builder(node_id: crate::dom::NodeId, forced: bool) -> ForceStartingStyleParamsBuilder {
3334        ForceStartingStyleParamsBuilder {
3335            node_id: node_id,
3336            forced: forced,
3337        }
3338    }
3339    /// The element id for which to force the starting-style state.
3340    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3341    /// Boolean indicating if this is on or off.
3342    pub fn forced(&self) -> bool { self.forced }
3343}
3344
3345
3346pub struct ForceStartingStyleParamsBuilder {
3347    node_id: crate::dom::NodeId,
3348    forced: bool,
3349}
3350
3351impl ForceStartingStyleParamsBuilder {
3352    pub fn build(self) -> ForceStartingStyleParams {
3353        ForceStartingStyleParams {
3354            node_id: self.node_id,
3355            forced: self.forced,
3356        }
3357    }
3358}
3359
3360impl ForceStartingStyleParams { pub const METHOD: &'static str = "CSS.forceStartingStyle"; }
3361
3362impl<'a> crate::CdpCommand<'a> for ForceStartingStyleParams {
3363    const METHOD: &'static str = "CSS.forceStartingStyle";
3364    type Response = crate::EmptyReturns;
3365}
3366
3367
3368#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3369#[serde(rename_all = "camelCase")]
3370pub struct GetBackgroundColorsParams {
3371    /// Id of the node to get background colors for.
3372    #[serde(rename = "nodeId")]
3373    node_id: crate::dom::NodeId,
3374}
3375
3376impl GetBackgroundColorsParams {
3377    /// Creates a builder for this type with the required parameters:
3378    /// * `node_id`: Id of the node to get background colors for.
3379    pub fn builder(node_id: crate::dom::NodeId) -> GetBackgroundColorsParamsBuilder {
3380        GetBackgroundColorsParamsBuilder {
3381            node_id: node_id,
3382        }
3383    }
3384    /// Id of the node to get background colors for.
3385    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3386}
3387
3388
3389pub struct GetBackgroundColorsParamsBuilder {
3390    node_id: crate::dom::NodeId,
3391}
3392
3393impl GetBackgroundColorsParamsBuilder {
3394    pub fn build(self) -> GetBackgroundColorsParams {
3395        GetBackgroundColorsParams {
3396            node_id: self.node_id,
3397        }
3398    }
3399}
3400
3401
3402#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3403#[serde(rename_all = "camelCase")]
3404pub struct GetBackgroundColorsReturns<'a> {
3405    /// The range of background colors behind this element, if it contains any visible text. If no
3406    /// visible text is present, this will be undefined. In the case of a flat background color,
3407    /// this will consist of simply that color. In the case of a gradient, this will consist of each
3408    /// of the color stops. For anything more complicated, this will be an empty array. Images will
3409    /// be ignored (as if the image had failed to load).
3410    #[serde(skip_serializing_if = "Option::is_none", rename = "backgroundColors")]
3411    background_colors: Option<Vec<Cow<'a, str>>>,
3412    /// The computed font size for this node, as a CSS computed value string (e.g. '12px').
3413    #[serde(skip_serializing_if = "Option::is_none", rename = "computedFontSize")]
3414    computed_font_size: Option<Cow<'a, str>>,
3415    /// The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or
3416    /// '100').
3417    #[serde(skip_serializing_if = "Option::is_none", rename = "computedFontWeight")]
3418    computed_font_weight: Option<Cow<'a, str>>,
3419}
3420
3421impl<'a> GetBackgroundColorsReturns<'a> {
3422    /// Creates a builder for this type.
3423    pub fn builder() -> GetBackgroundColorsReturnsBuilder<'a> {
3424        GetBackgroundColorsReturnsBuilder {
3425            background_colors: None,
3426            computed_font_size: None,
3427            computed_font_weight: None,
3428        }
3429    }
3430    /// The range of background colors behind this element, if it contains any visible text. If no
3431    /// visible text is present, this will be undefined. In the case of a flat background color,
3432    /// this will consist of simply that color. In the case of a gradient, this will consist of each
3433    /// of the color stops. For anything more complicated, this will be an empty array. Images will
3434    /// be ignored (as if the image had failed to load).
3435    pub fn background_colors(&self) -> Option<&[Cow<'a, str>]> { self.background_colors.as_deref() }
3436    /// The computed font size for this node, as a CSS computed value string (e.g. '12px').
3437    pub fn computed_font_size(&self) -> Option<&str> { self.computed_font_size.as_deref() }
3438    /// The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or
3439    /// '100').
3440    pub fn computed_font_weight(&self) -> Option<&str> { self.computed_font_weight.as_deref() }
3441}
3442
3443#[derive(Default)]
3444pub struct GetBackgroundColorsReturnsBuilder<'a> {
3445    background_colors: Option<Vec<Cow<'a, str>>>,
3446    computed_font_size: Option<Cow<'a, str>>,
3447    computed_font_weight: Option<Cow<'a, str>>,
3448}
3449
3450impl<'a> GetBackgroundColorsReturnsBuilder<'a> {
3451    /// The range of background colors behind this element, if it contains any visible text. If no
3452    /// visible text is present, this will be undefined. In the case of a flat background color,
3453    /// this will consist of simply that color. In the case of a gradient, this will consist of each
3454    /// of the color stops. For anything more complicated, this will be an empty array. Images will
3455    /// be ignored (as if the image had failed to load).
3456    pub fn background_colors(mut self, background_colors: Vec<Cow<'a, str>>) -> Self { self.background_colors = Some(background_colors); self }
3457    /// The computed font size for this node, as a CSS computed value string (e.g. '12px').
3458    pub fn computed_font_size(mut self, computed_font_size: impl Into<Cow<'a, str>>) -> Self { self.computed_font_size = Some(computed_font_size.into()); self }
3459    /// The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or
3460    /// '100').
3461    pub fn computed_font_weight(mut self, computed_font_weight: impl Into<Cow<'a, str>>) -> Self { self.computed_font_weight = Some(computed_font_weight.into()); self }
3462    pub fn build(self) -> GetBackgroundColorsReturns<'a> {
3463        GetBackgroundColorsReturns {
3464            background_colors: self.background_colors,
3465            computed_font_size: self.computed_font_size,
3466            computed_font_weight: self.computed_font_weight,
3467        }
3468    }
3469}
3470
3471impl GetBackgroundColorsParams { pub const METHOD: &'static str = "CSS.getBackgroundColors"; }
3472
3473impl<'a> crate::CdpCommand<'a> for GetBackgroundColorsParams {
3474    const METHOD: &'static str = "CSS.getBackgroundColors";
3475    type Response = GetBackgroundColorsReturns<'a>;
3476}
3477
3478/// Returns the computed style for a DOM node identified by 'nodeId'.
3479
3480#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3481#[serde(rename_all = "camelCase")]
3482pub struct GetComputedStyleForNodeParams {
3483    #[serde(rename = "nodeId")]
3484    node_id: crate::dom::NodeId,
3485}
3486
3487impl GetComputedStyleForNodeParams {
3488    /// Creates a builder for this type with the required parameters:
3489    /// * `node_id`: 
3490    pub fn builder(node_id: crate::dom::NodeId) -> GetComputedStyleForNodeParamsBuilder {
3491        GetComputedStyleForNodeParamsBuilder {
3492            node_id: node_id,
3493        }
3494    }
3495    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3496}
3497
3498
3499pub struct GetComputedStyleForNodeParamsBuilder {
3500    node_id: crate::dom::NodeId,
3501}
3502
3503impl GetComputedStyleForNodeParamsBuilder {
3504    pub fn build(self) -> GetComputedStyleForNodeParams {
3505        GetComputedStyleForNodeParams {
3506            node_id: self.node_id,
3507        }
3508    }
3509}
3510
3511/// Returns the computed style for a DOM node identified by 'nodeId'.
3512
3513#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3514#[serde(rename_all = "camelCase")]
3515pub struct GetComputedStyleForNodeReturns<'a> {
3516    /// Computed style for the specified DOM node.
3517    #[serde(rename = "computedStyle")]
3518    computed_style: Vec<CSSComputedStyleProperty<'a>>,
3519    /// A list of non-standard "extra fields" which blink stores alongside each
3520    /// computed style.
3521    #[serde(rename = "extraFields")]
3522    extra_fields: ComputedStyleExtraFields,
3523}
3524
3525impl<'a> GetComputedStyleForNodeReturns<'a> {
3526    /// Creates a builder for this type with the required parameters:
3527    /// * `computed_style`: Computed style for the specified DOM node.
3528    /// * `extra_fields`: A list of non-standard "extra fields" which blink stores alongside each computed style.
3529    pub fn builder(computed_style: Vec<CSSComputedStyleProperty<'a>>, extra_fields: ComputedStyleExtraFields) -> GetComputedStyleForNodeReturnsBuilder<'a> {
3530        GetComputedStyleForNodeReturnsBuilder {
3531            computed_style: computed_style,
3532            extra_fields: extra_fields,
3533        }
3534    }
3535    /// Computed style for the specified DOM node.
3536    pub fn computed_style(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computed_style }
3537    /// A list of non-standard "extra fields" which blink stores alongside each
3538    /// computed style.
3539    pub fn extra_fields(&self) -> &ComputedStyleExtraFields { &self.extra_fields }
3540}
3541
3542
3543pub struct GetComputedStyleForNodeReturnsBuilder<'a> {
3544    computed_style: Vec<CSSComputedStyleProperty<'a>>,
3545    extra_fields: ComputedStyleExtraFields,
3546}
3547
3548impl<'a> GetComputedStyleForNodeReturnsBuilder<'a> {
3549    pub fn build(self) -> GetComputedStyleForNodeReturns<'a> {
3550        GetComputedStyleForNodeReturns {
3551            computed_style: self.computed_style,
3552            extra_fields: self.extra_fields,
3553        }
3554    }
3555}
3556
3557impl GetComputedStyleForNodeParams { pub const METHOD: &'static str = "CSS.getComputedStyleForNode"; }
3558
3559impl<'a> crate::CdpCommand<'a> for GetComputedStyleForNodeParams {
3560    const METHOD: &'static str = "CSS.getComputedStyleForNode";
3561    type Response = GetComputedStyleForNodeReturns<'a>;
3562}
3563
3564/// Resolve the specified values in the context of the provided element.
3565/// For example, a value of '1em' is evaluated according to the computed
3566/// 'font-size' of the element and a value 'calc(1px + 2px)' will be
3567/// resolved to '3px'.
3568/// If the 'propertyName' was specified the 'values' are resolved as if
3569/// they were property's declaration. If a value cannot be parsed according
3570/// to the provided property syntax, the value is parsed using combined
3571/// syntax as if null 'propertyName' was provided. If the value cannot be
3572/// resolved even then, return the provided value without any changes.
3573/// Note: this function currently does not resolve CSS random() function,
3574/// it returns unmodified random() function parts.'
3575
3576#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3577#[serde(rename_all = "camelCase")]
3578pub struct ResolveValuesParams<'a> {
3579    /// Cascade-dependent keywords (revert/revert-layer) do not work.
3580    values: Vec<Cow<'a, str>>,
3581    /// Id of the node in whose context the expression is evaluated
3582    #[serde(rename = "nodeId")]
3583    node_id: crate::dom::NodeId,
3584    /// Only longhands and custom property names are accepted.
3585    #[serde(skip_serializing_if = "Option::is_none", rename = "propertyName")]
3586    property_name: Option<Cow<'a, str>>,
3587    /// Pseudo element type, only works for pseudo elements that generate
3588    /// elements in the tree, such as ::before and ::after.
3589    #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
3590    pseudo_type: Option<crate::dom::PseudoType>,
3591    /// Pseudo element custom ident.
3592    #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
3593    pseudo_identifier: Option<Cow<'a, str>>,
3594}
3595
3596impl<'a> ResolveValuesParams<'a> {
3597    /// Creates a builder for this type with the required parameters:
3598    /// * `values`: Cascade-dependent keywords (revert/revert-layer) do not work.
3599    /// * `node_id`: Id of the node in whose context the expression is evaluated
3600    pub fn builder(values: Vec<Cow<'a, str>>, node_id: crate::dom::NodeId) -> ResolveValuesParamsBuilder<'a> {
3601        ResolveValuesParamsBuilder {
3602            values: values,
3603            node_id: node_id,
3604            property_name: None,
3605            pseudo_type: None,
3606            pseudo_identifier: None,
3607        }
3608    }
3609    /// Cascade-dependent keywords (revert/revert-layer) do not work.
3610    pub fn values(&self) -> &[Cow<'a, str>] { &self.values }
3611    /// Id of the node in whose context the expression is evaluated
3612    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3613    /// Only longhands and custom property names are accepted.
3614    pub fn property_name(&self) -> Option<&str> { self.property_name.as_deref() }
3615    /// Pseudo element type, only works for pseudo elements that generate
3616    /// elements in the tree, such as ::before and ::after.
3617    pub fn pseudo_type(&self) -> Option<&crate::dom::PseudoType> { self.pseudo_type.as_ref() }
3618    /// Pseudo element custom ident.
3619    pub fn pseudo_identifier(&self) -> Option<&str> { self.pseudo_identifier.as_deref() }
3620}
3621
3622
3623pub struct ResolveValuesParamsBuilder<'a> {
3624    values: Vec<Cow<'a, str>>,
3625    node_id: crate::dom::NodeId,
3626    property_name: Option<Cow<'a, str>>,
3627    pseudo_type: Option<crate::dom::PseudoType>,
3628    pseudo_identifier: Option<Cow<'a, str>>,
3629}
3630
3631impl<'a> ResolveValuesParamsBuilder<'a> {
3632    /// Only longhands and custom property names are accepted.
3633    pub fn property_name(mut self, property_name: impl Into<Cow<'a, str>>) -> Self { self.property_name = Some(property_name.into()); self }
3634    /// Pseudo element type, only works for pseudo elements that generate
3635    /// elements in the tree, such as ::before and ::after.
3636    pub fn pseudo_type(mut self, pseudo_type: crate::dom::PseudoType) -> Self { self.pseudo_type = Some(pseudo_type); self }
3637    /// Pseudo element custom ident.
3638    pub fn pseudo_identifier(mut self, pseudo_identifier: impl Into<Cow<'a, str>>) -> Self { self.pseudo_identifier = Some(pseudo_identifier.into()); self }
3639    pub fn build(self) -> ResolveValuesParams<'a> {
3640        ResolveValuesParams {
3641            values: self.values,
3642            node_id: self.node_id,
3643            property_name: self.property_name,
3644            pseudo_type: self.pseudo_type,
3645            pseudo_identifier: self.pseudo_identifier,
3646        }
3647    }
3648}
3649
3650/// Resolve the specified values in the context of the provided element.
3651/// For example, a value of '1em' is evaluated according to the computed
3652/// 'font-size' of the element and a value 'calc(1px + 2px)' will be
3653/// resolved to '3px'.
3654/// If the 'propertyName' was specified the 'values' are resolved as if
3655/// they were property's declaration. If a value cannot be parsed according
3656/// to the provided property syntax, the value is parsed using combined
3657/// syntax as if null 'propertyName' was provided. If the value cannot be
3658/// resolved even then, return the provided value without any changes.
3659/// Note: this function currently does not resolve CSS random() function,
3660/// it returns unmodified random() function parts.'
3661
3662#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3663#[serde(rename_all = "camelCase")]
3664pub struct ResolveValuesReturns<'a> {
3665    results: Vec<Cow<'a, str>>,
3666}
3667
3668impl<'a> ResolveValuesReturns<'a> {
3669    /// Creates a builder for this type with the required parameters:
3670    /// * `results`: 
3671    pub fn builder(results: Vec<Cow<'a, str>>) -> ResolveValuesReturnsBuilder<'a> {
3672        ResolveValuesReturnsBuilder {
3673            results: results,
3674        }
3675    }
3676    pub fn results(&self) -> &[Cow<'a, str>] { &self.results }
3677}
3678
3679
3680pub struct ResolveValuesReturnsBuilder<'a> {
3681    results: Vec<Cow<'a, str>>,
3682}
3683
3684impl<'a> ResolveValuesReturnsBuilder<'a> {
3685    pub fn build(self) -> ResolveValuesReturns<'a> {
3686        ResolveValuesReturns {
3687            results: self.results,
3688        }
3689    }
3690}
3691
3692impl<'a> ResolveValuesParams<'a> { pub const METHOD: &'static str = "CSS.resolveValues"; }
3693
3694impl<'a> crate::CdpCommand<'a> for ResolveValuesParams<'a> {
3695    const METHOD: &'static str = "CSS.resolveValues";
3696    type Response = ResolveValuesReturns<'a>;
3697}
3698
3699
3700#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3701#[serde(rename_all = "camelCase")]
3702pub struct GetLonghandPropertiesParams<'a> {
3703    #[serde(rename = "shorthandName")]
3704    shorthand_name: Cow<'a, str>,
3705    value: Cow<'a, str>,
3706}
3707
3708impl<'a> GetLonghandPropertiesParams<'a> {
3709    /// Creates a builder for this type with the required parameters:
3710    /// * `shorthand_name`: 
3711    /// * `value`: 
3712    pub fn builder(shorthand_name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> GetLonghandPropertiesParamsBuilder<'a> {
3713        GetLonghandPropertiesParamsBuilder {
3714            shorthand_name: shorthand_name.into(),
3715            value: value.into(),
3716        }
3717    }
3718    pub fn shorthand_name(&self) -> &str { self.shorthand_name.as_ref() }
3719    pub fn value(&self) -> &str { self.value.as_ref() }
3720}
3721
3722
3723pub struct GetLonghandPropertiesParamsBuilder<'a> {
3724    shorthand_name: Cow<'a, str>,
3725    value: Cow<'a, str>,
3726}
3727
3728impl<'a> GetLonghandPropertiesParamsBuilder<'a> {
3729    pub fn build(self) -> GetLonghandPropertiesParams<'a> {
3730        GetLonghandPropertiesParams {
3731            shorthand_name: self.shorthand_name,
3732            value: self.value,
3733        }
3734    }
3735}
3736
3737
3738#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3739#[serde(rename_all = "camelCase")]
3740pub struct GetLonghandPropertiesReturns<'a> {
3741    #[serde(rename = "longhandProperties")]
3742    longhand_properties: Vec<CSSProperty<'a>>,
3743}
3744
3745impl<'a> GetLonghandPropertiesReturns<'a> {
3746    /// Creates a builder for this type with the required parameters:
3747    /// * `longhand_properties`: 
3748    pub fn builder(longhand_properties: Vec<CSSProperty<'a>>) -> GetLonghandPropertiesReturnsBuilder<'a> {
3749        GetLonghandPropertiesReturnsBuilder {
3750            longhand_properties: longhand_properties,
3751        }
3752    }
3753    pub fn longhand_properties(&self) -> &[CSSProperty<'a>] { &self.longhand_properties }
3754}
3755
3756
3757pub struct GetLonghandPropertiesReturnsBuilder<'a> {
3758    longhand_properties: Vec<CSSProperty<'a>>,
3759}
3760
3761impl<'a> GetLonghandPropertiesReturnsBuilder<'a> {
3762    pub fn build(self) -> GetLonghandPropertiesReturns<'a> {
3763        GetLonghandPropertiesReturns {
3764            longhand_properties: self.longhand_properties,
3765        }
3766    }
3767}
3768
3769impl<'a> GetLonghandPropertiesParams<'a> { pub const METHOD: &'static str = "CSS.getLonghandProperties"; }
3770
3771impl<'a> crate::CdpCommand<'a> for GetLonghandPropertiesParams<'a> {
3772    const METHOD: &'static str = "CSS.getLonghandProperties";
3773    type Response = GetLonghandPropertiesReturns<'a>;
3774}
3775
3776/// Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM
3777/// attributes) for a DOM node identified by 'nodeId'.
3778
3779#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3780#[serde(rename_all = "camelCase")]
3781pub struct GetInlineStylesForNodeParams {
3782    #[serde(rename = "nodeId")]
3783    node_id: crate::dom::NodeId,
3784}
3785
3786impl GetInlineStylesForNodeParams {
3787    /// Creates a builder for this type with the required parameters:
3788    /// * `node_id`: 
3789    pub fn builder(node_id: crate::dom::NodeId) -> GetInlineStylesForNodeParamsBuilder {
3790        GetInlineStylesForNodeParamsBuilder {
3791            node_id: node_id,
3792        }
3793    }
3794    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3795}
3796
3797
3798pub struct GetInlineStylesForNodeParamsBuilder {
3799    node_id: crate::dom::NodeId,
3800}
3801
3802impl GetInlineStylesForNodeParamsBuilder {
3803    pub fn build(self) -> GetInlineStylesForNodeParams {
3804        GetInlineStylesForNodeParams {
3805            node_id: self.node_id,
3806        }
3807    }
3808}
3809
3810/// Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM
3811/// attributes) for a DOM node identified by 'nodeId'.
3812
3813#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3814#[serde(rename_all = "camelCase")]
3815pub struct GetInlineStylesForNodeReturns<'a> {
3816    /// Inline style for the specified DOM node.
3817    #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
3818    inline_style: Option<CSSStyle<'a>>,
3819    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
3820    #[serde(skip_serializing_if = "Option::is_none", rename = "attributesStyle")]
3821    attributes_style: Option<CSSStyle<'a>>,
3822}
3823
3824impl<'a> GetInlineStylesForNodeReturns<'a> {
3825    /// Creates a builder for this type.
3826    pub fn builder() -> GetInlineStylesForNodeReturnsBuilder<'a> {
3827        GetInlineStylesForNodeReturnsBuilder {
3828            inline_style: None,
3829            attributes_style: None,
3830        }
3831    }
3832    /// Inline style for the specified DOM node.
3833    pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
3834    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
3835    pub fn attributes_style(&self) -> Option<&CSSStyle<'a>> { self.attributes_style.as_ref() }
3836}
3837
3838#[derive(Default)]
3839pub struct GetInlineStylesForNodeReturnsBuilder<'a> {
3840    inline_style: Option<CSSStyle<'a>>,
3841    attributes_style: Option<CSSStyle<'a>>,
3842}
3843
3844impl<'a> GetInlineStylesForNodeReturnsBuilder<'a> {
3845    /// Inline style for the specified DOM node.
3846    pub fn inline_style(mut self, inline_style: CSSStyle<'a>) -> Self { self.inline_style = Some(inline_style); self }
3847    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
3848    pub fn attributes_style(mut self, attributes_style: CSSStyle<'a>) -> Self { self.attributes_style = Some(attributes_style); self }
3849    pub fn build(self) -> GetInlineStylesForNodeReturns<'a> {
3850        GetInlineStylesForNodeReturns {
3851            inline_style: self.inline_style,
3852            attributes_style: self.attributes_style,
3853        }
3854    }
3855}
3856
3857impl GetInlineStylesForNodeParams { pub const METHOD: &'static str = "CSS.getInlineStylesForNode"; }
3858
3859impl<'a> crate::CdpCommand<'a> for GetInlineStylesForNodeParams {
3860    const METHOD: &'static str = "CSS.getInlineStylesForNode";
3861    type Response = GetInlineStylesForNodeReturns<'a>;
3862}
3863
3864/// Returns the styles coming from animations & transitions
3865/// including the animation & transition styles coming from inheritance chain.
3866
3867#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3868#[serde(rename_all = "camelCase")]
3869pub struct GetAnimatedStylesForNodeParams {
3870    #[serde(rename = "nodeId")]
3871    node_id: crate::dom::NodeId,
3872}
3873
3874impl GetAnimatedStylesForNodeParams {
3875    /// Creates a builder for this type with the required parameters:
3876    /// * `node_id`: 
3877    pub fn builder(node_id: crate::dom::NodeId) -> GetAnimatedStylesForNodeParamsBuilder {
3878        GetAnimatedStylesForNodeParamsBuilder {
3879            node_id: node_id,
3880        }
3881    }
3882    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3883}
3884
3885
3886pub struct GetAnimatedStylesForNodeParamsBuilder {
3887    node_id: crate::dom::NodeId,
3888}
3889
3890impl GetAnimatedStylesForNodeParamsBuilder {
3891    pub fn build(self) -> GetAnimatedStylesForNodeParams {
3892        GetAnimatedStylesForNodeParams {
3893            node_id: self.node_id,
3894        }
3895    }
3896}
3897
3898/// Returns the styles coming from animations & transitions
3899/// including the animation & transition styles coming from inheritance chain.
3900
3901#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3902#[serde(rename_all = "camelCase")]
3903pub struct GetAnimatedStylesForNodeReturns<'a> {
3904    /// Styles coming from animations.
3905    #[serde(skip_serializing_if = "Option::is_none", rename = "animationStyles")]
3906    animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
3907    /// Style coming from transitions.
3908    #[serde(skip_serializing_if = "Option::is_none", rename = "transitionsStyle")]
3909    transitions_style: Option<CSSStyle<'a>>,
3910    /// Inherited style entries for animationsStyle and transitionsStyle from
3911    /// the inheritance chain of the element.
3912    #[serde(skip_serializing_if = "Option::is_none")]
3913    inherited: Option<Vec<InheritedAnimatedStyleEntry<'a>>>,
3914}
3915
3916impl<'a> GetAnimatedStylesForNodeReturns<'a> {
3917    /// Creates a builder for this type.
3918    pub fn builder() -> GetAnimatedStylesForNodeReturnsBuilder<'a> {
3919        GetAnimatedStylesForNodeReturnsBuilder {
3920            animation_styles: None,
3921            transitions_style: None,
3922            inherited: None,
3923        }
3924    }
3925    /// Styles coming from animations.
3926    pub fn animation_styles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animation_styles.as_deref() }
3927    /// Style coming from transitions.
3928    pub fn transitions_style(&self) -> Option<&CSSStyle<'a>> { self.transitions_style.as_ref() }
3929    /// Inherited style entries for animationsStyle and transitionsStyle from
3930    /// the inheritance chain of the element.
3931    pub fn inherited(&self) -> Option<&[InheritedAnimatedStyleEntry<'a>]> { self.inherited.as_deref() }
3932}
3933
3934#[derive(Default)]
3935pub struct GetAnimatedStylesForNodeReturnsBuilder<'a> {
3936    animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
3937    transitions_style: Option<CSSStyle<'a>>,
3938    inherited: Option<Vec<InheritedAnimatedStyleEntry<'a>>>,
3939}
3940
3941impl<'a> GetAnimatedStylesForNodeReturnsBuilder<'a> {
3942    /// Styles coming from animations.
3943    pub fn animation_styles(mut self, animation_styles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animation_styles = Some(animation_styles); self }
3944    /// Style coming from transitions.
3945    pub fn transitions_style(mut self, transitions_style: CSSStyle<'a>) -> Self { self.transitions_style = Some(transitions_style); self }
3946    /// Inherited style entries for animationsStyle and transitionsStyle from
3947    /// the inheritance chain of the element.
3948    pub fn inherited(mut self, inherited: Vec<InheritedAnimatedStyleEntry<'a>>) -> Self { self.inherited = Some(inherited); self }
3949    pub fn build(self) -> GetAnimatedStylesForNodeReturns<'a> {
3950        GetAnimatedStylesForNodeReturns {
3951            animation_styles: self.animation_styles,
3952            transitions_style: self.transitions_style,
3953            inherited: self.inherited,
3954        }
3955    }
3956}
3957
3958impl GetAnimatedStylesForNodeParams { pub const METHOD: &'static str = "CSS.getAnimatedStylesForNode"; }
3959
3960impl<'a> crate::CdpCommand<'a> for GetAnimatedStylesForNodeParams {
3961    const METHOD: &'static str = "CSS.getAnimatedStylesForNode";
3962    type Response = GetAnimatedStylesForNodeReturns<'a>;
3963}
3964
3965/// Returns requested styles for a DOM node identified by 'nodeId'.
3966
3967#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3968#[serde(rename_all = "camelCase")]
3969pub struct GetMatchedStylesForNodeParams {
3970    #[serde(rename = "nodeId")]
3971    node_id: crate::dom::NodeId,
3972}
3973
3974impl GetMatchedStylesForNodeParams {
3975    /// Creates a builder for this type with the required parameters:
3976    /// * `node_id`: 
3977    pub fn builder(node_id: crate::dom::NodeId) -> GetMatchedStylesForNodeParamsBuilder {
3978        GetMatchedStylesForNodeParamsBuilder {
3979            node_id: node_id,
3980        }
3981    }
3982    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3983}
3984
3985
3986pub struct GetMatchedStylesForNodeParamsBuilder {
3987    node_id: crate::dom::NodeId,
3988}
3989
3990impl GetMatchedStylesForNodeParamsBuilder {
3991    pub fn build(self) -> GetMatchedStylesForNodeParams {
3992        GetMatchedStylesForNodeParams {
3993            node_id: self.node_id,
3994        }
3995    }
3996}
3997
3998/// Returns requested styles for a DOM node identified by 'nodeId'.
3999
4000#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4001#[serde(rename_all = "camelCase")]
4002pub struct GetMatchedStylesForNodeReturns<'a> {
4003    /// Inline style for the specified DOM node.
4004    #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
4005    inline_style: Option<CSSStyle<'a>>,
4006    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
4007    #[serde(skip_serializing_if = "Option::is_none", rename = "attributesStyle")]
4008    attributes_style: Option<CSSStyle<'a>>,
4009    /// CSS rules matching this node, from all applicable stylesheets.
4010    #[serde(skip_serializing_if = "Option::is_none", rename = "matchedCSSRules")]
4011    matched_css_rules: Option<Vec<RuleMatch<'a>>>,
4012    /// Pseudo style matches for this node.
4013    #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoElements")]
4014    pseudo_elements: Option<Vec<PseudoElementMatches<'a>>>,
4015    /// A chain of inherited styles (from the immediate node parent up to the DOM tree root).
4016    #[serde(skip_serializing_if = "Option::is_none")]
4017    inherited: Option<Vec<InheritedStyleEntry<'a>>>,
4018    /// A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
4019    #[serde(skip_serializing_if = "Option::is_none", rename = "inheritedPseudoElements")]
4020    inherited_pseudo_elements: Option<Vec<InheritedPseudoElementMatches<'a>>>,
4021    /// A list of CSS keyframed animations matching this node.
4022    #[serde(skip_serializing_if = "Option::is_none", rename = "cssKeyframesRules")]
4023    css_keyframes_rules: Option<Vec<CSSKeyframesRule<'a>>>,
4024    /// A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
4025    #[serde(skip_serializing_if = "Option::is_none", rename = "cssPositionTryRules")]
4026    css_position_try_rules: Option<Vec<CSSPositionTryRule<'a>>>,
4027    /// Index of the active fallback in the applied position-try-fallback property,
4028    /// will not be set if there is no active position-try fallback.
4029    #[serde(skip_serializing_if = "Option::is_none", rename = "activePositionFallbackIndex")]
4030    active_position_fallback_index: Option<u64>,
4031    /// A list of CSS at-property rules matching this node.
4032    #[serde(skip_serializing_if = "Option::is_none", rename = "cssPropertyRules")]
4033    css_property_rules: Option<Vec<CSSPropertyRule<'a>>>,
4034    /// A list of CSS property registrations matching this node.
4035    #[serde(skip_serializing_if = "Option::is_none", rename = "cssPropertyRegistrations")]
4036    css_property_registrations: Option<Vec<CSSPropertyRegistration<'a>>>,
4037    /// A list of simple @rules matching this node or its pseudo-elements.
4038    #[serde(skip_serializing_if = "Option::is_none", rename = "cssAtRules")]
4039    css_at_rules: Option<Vec<CSSAtRule<'a>>>,
4040    /// Id of the first parent element that does not have display: contents.
4041    #[serde(skip_serializing_if = "Option::is_none", rename = "parentLayoutNodeId")]
4042    parent_layout_node_id: Option<crate::dom::NodeId>,
4043    /// A list of CSS at-function rules referenced by styles of this node.
4044    #[serde(skip_serializing_if = "Option::is_none", rename = "cssFunctionRules")]
4045    css_function_rules: Option<Vec<CSSFunctionRule<'a>>>,
4046}
4047
4048impl<'a> GetMatchedStylesForNodeReturns<'a> {
4049    /// Creates a builder for this type.
4050    pub fn builder() -> GetMatchedStylesForNodeReturnsBuilder<'a> {
4051        GetMatchedStylesForNodeReturnsBuilder {
4052            inline_style: None,
4053            attributes_style: None,
4054            matched_css_rules: None,
4055            pseudo_elements: None,
4056            inherited: None,
4057            inherited_pseudo_elements: None,
4058            css_keyframes_rules: None,
4059            css_position_try_rules: None,
4060            active_position_fallback_index: None,
4061            css_property_rules: None,
4062            css_property_registrations: None,
4063            css_at_rules: None,
4064            parent_layout_node_id: None,
4065            css_function_rules: None,
4066        }
4067    }
4068    /// Inline style for the specified DOM node.
4069    pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
4070    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
4071    pub fn attributes_style(&self) -> Option<&CSSStyle<'a>> { self.attributes_style.as_ref() }
4072    /// CSS rules matching this node, from all applicable stylesheets.
4073    pub fn matched_css_rules(&self) -> Option<&[RuleMatch<'a>]> { self.matched_css_rules.as_deref() }
4074    /// Pseudo style matches for this node.
4075    pub fn pseudo_elements(&self) -> Option<&[PseudoElementMatches<'a>]> { self.pseudo_elements.as_deref() }
4076    /// A chain of inherited styles (from the immediate node parent up to the DOM tree root).
4077    pub fn inherited(&self) -> Option<&[InheritedStyleEntry<'a>]> { self.inherited.as_deref() }
4078    /// A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
4079    pub fn inherited_pseudo_elements(&self) -> Option<&[InheritedPseudoElementMatches<'a>]> { self.inherited_pseudo_elements.as_deref() }
4080    /// A list of CSS keyframed animations matching this node.
4081    pub fn css_keyframes_rules(&self) -> Option<&[CSSKeyframesRule<'a>]> { self.css_keyframes_rules.as_deref() }
4082    /// A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
4083    pub fn css_position_try_rules(&self) -> Option<&[CSSPositionTryRule<'a>]> { self.css_position_try_rules.as_deref() }
4084    /// Index of the active fallback in the applied position-try-fallback property,
4085    /// will not be set if there is no active position-try fallback.
4086    pub fn active_position_fallback_index(&self) -> Option<u64> { self.active_position_fallback_index }
4087    /// A list of CSS at-property rules matching this node.
4088    pub fn css_property_rules(&self) -> Option<&[CSSPropertyRule<'a>]> { self.css_property_rules.as_deref() }
4089    /// A list of CSS property registrations matching this node.
4090    pub fn css_property_registrations(&self) -> Option<&[CSSPropertyRegistration<'a>]> { self.css_property_registrations.as_deref() }
4091    /// A list of simple @rules matching this node or its pseudo-elements.
4092    pub fn css_at_rules(&self) -> Option<&[CSSAtRule<'a>]> { self.css_at_rules.as_deref() }
4093    /// Id of the first parent element that does not have display: contents.
4094    pub fn parent_layout_node_id(&self) -> Option<&crate::dom::NodeId> { self.parent_layout_node_id.as_ref() }
4095    /// A list of CSS at-function rules referenced by styles of this node.
4096    pub fn css_function_rules(&self) -> Option<&[CSSFunctionRule<'a>]> { self.css_function_rules.as_deref() }
4097}
4098
4099#[derive(Default)]
4100pub struct GetMatchedStylesForNodeReturnsBuilder<'a> {
4101    inline_style: Option<CSSStyle<'a>>,
4102    attributes_style: Option<CSSStyle<'a>>,
4103    matched_css_rules: Option<Vec<RuleMatch<'a>>>,
4104    pseudo_elements: Option<Vec<PseudoElementMatches<'a>>>,
4105    inherited: Option<Vec<InheritedStyleEntry<'a>>>,
4106    inherited_pseudo_elements: Option<Vec<InheritedPseudoElementMatches<'a>>>,
4107    css_keyframes_rules: Option<Vec<CSSKeyframesRule<'a>>>,
4108    css_position_try_rules: Option<Vec<CSSPositionTryRule<'a>>>,
4109    active_position_fallback_index: Option<u64>,
4110    css_property_rules: Option<Vec<CSSPropertyRule<'a>>>,
4111    css_property_registrations: Option<Vec<CSSPropertyRegistration<'a>>>,
4112    css_at_rules: Option<Vec<CSSAtRule<'a>>>,
4113    parent_layout_node_id: Option<crate::dom::NodeId>,
4114    css_function_rules: Option<Vec<CSSFunctionRule<'a>>>,
4115}
4116
4117impl<'a> GetMatchedStylesForNodeReturnsBuilder<'a> {
4118    /// Inline style for the specified DOM node.
4119    pub fn inline_style(mut self, inline_style: CSSStyle<'a>) -> Self { self.inline_style = Some(inline_style); self }
4120    /// Attribute-defined element style (e.g. resulting from "width=20 height=100%").
4121    pub fn attributes_style(mut self, attributes_style: CSSStyle<'a>) -> Self { self.attributes_style = Some(attributes_style); self }
4122    /// CSS rules matching this node, from all applicable stylesheets.
4123    pub fn matched_css_rules(mut self, matched_css_rules: Vec<RuleMatch<'a>>) -> Self { self.matched_css_rules = Some(matched_css_rules); self }
4124    /// Pseudo style matches for this node.
4125    pub fn pseudo_elements(mut self, pseudo_elements: Vec<PseudoElementMatches<'a>>) -> Self { self.pseudo_elements = Some(pseudo_elements); self }
4126    /// A chain of inherited styles (from the immediate node parent up to the DOM tree root).
4127    pub fn inherited(mut self, inherited: Vec<InheritedStyleEntry<'a>>) -> Self { self.inherited = Some(inherited); self }
4128    /// A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
4129    pub fn inherited_pseudo_elements(mut self, inherited_pseudo_elements: Vec<InheritedPseudoElementMatches<'a>>) -> Self { self.inherited_pseudo_elements = Some(inherited_pseudo_elements); self }
4130    /// A list of CSS keyframed animations matching this node.
4131    pub fn css_keyframes_rules(mut self, css_keyframes_rules: Vec<CSSKeyframesRule<'a>>) -> Self { self.css_keyframes_rules = Some(css_keyframes_rules); self }
4132    /// A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
4133    pub fn css_position_try_rules(mut self, css_position_try_rules: Vec<CSSPositionTryRule<'a>>) -> Self { self.css_position_try_rules = Some(css_position_try_rules); self }
4134    /// Index of the active fallback in the applied position-try-fallback property,
4135    /// will not be set if there is no active position-try fallback.
4136    pub fn active_position_fallback_index(mut self, active_position_fallback_index: u64) -> Self { self.active_position_fallback_index = Some(active_position_fallback_index); self }
4137    /// A list of CSS at-property rules matching this node.
4138    pub fn css_property_rules(mut self, css_property_rules: Vec<CSSPropertyRule<'a>>) -> Self { self.css_property_rules = Some(css_property_rules); self }
4139    /// A list of CSS property registrations matching this node.
4140    pub fn css_property_registrations(mut self, css_property_registrations: Vec<CSSPropertyRegistration<'a>>) -> Self { self.css_property_registrations = Some(css_property_registrations); self }
4141    /// A list of simple @rules matching this node or its pseudo-elements.
4142    pub fn css_at_rules(mut self, css_at_rules: Vec<CSSAtRule<'a>>) -> Self { self.css_at_rules = Some(css_at_rules); self }
4143    /// Id of the first parent element that does not have display: contents.
4144    pub fn parent_layout_node_id(mut self, parent_layout_node_id: crate::dom::NodeId) -> Self { self.parent_layout_node_id = Some(parent_layout_node_id); self }
4145    /// A list of CSS at-function rules referenced by styles of this node.
4146    pub fn css_function_rules(mut self, css_function_rules: Vec<CSSFunctionRule<'a>>) -> Self { self.css_function_rules = Some(css_function_rules); self }
4147    pub fn build(self) -> GetMatchedStylesForNodeReturns<'a> {
4148        GetMatchedStylesForNodeReturns {
4149            inline_style: self.inline_style,
4150            attributes_style: self.attributes_style,
4151            matched_css_rules: self.matched_css_rules,
4152            pseudo_elements: self.pseudo_elements,
4153            inherited: self.inherited,
4154            inherited_pseudo_elements: self.inherited_pseudo_elements,
4155            css_keyframes_rules: self.css_keyframes_rules,
4156            css_position_try_rules: self.css_position_try_rules,
4157            active_position_fallback_index: self.active_position_fallback_index,
4158            css_property_rules: self.css_property_rules,
4159            css_property_registrations: self.css_property_registrations,
4160            css_at_rules: self.css_at_rules,
4161            parent_layout_node_id: self.parent_layout_node_id,
4162            css_function_rules: self.css_function_rules,
4163        }
4164    }
4165}
4166
4167impl GetMatchedStylesForNodeParams { pub const METHOD: &'static str = "CSS.getMatchedStylesForNode"; }
4168
4169impl<'a> crate::CdpCommand<'a> for GetMatchedStylesForNodeParams {
4170    const METHOD: &'static str = "CSS.getMatchedStylesForNode";
4171    type Response = GetMatchedStylesForNodeReturns<'a>;
4172}
4173
4174/// Returns the values of the default UA-defined environment variables used in env()
4175
4176#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4177#[serde(rename_all = "camelCase")]
4178pub struct GetEnvironmentVariablesReturns {
4179    #[serde(rename = "environmentVariables")]
4180    environment_variables: serde_json::Map<String, JsonValue>,
4181}
4182
4183impl GetEnvironmentVariablesReturns {
4184    /// Creates a builder for this type with the required parameters:
4185    /// * `environment_variables`: 
4186    pub fn builder(environment_variables: serde_json::Map<String, JsonValue>) -> GetEnvironmentVariablesReturnsBuilder {
4187        GetEnvironmentVariablesReturnsBuilder {
4188            environment_variables: environment_variables,
4189        }
4190    }
4191    pub fn environment_variables(&self) -> &serde_json::Map<String, JsonValue> { &self.environment_variables }
4192}
4193
4194
4195pub struct GetEnvironmentVariablesReturnsBuilder {
4196    environment_variables: serde_json::Map<String, JsonValue>,
4197}
4198
4199impl GetEnvironmentVariablesReturnsBuilder {
4200    pub fn build(self) -> GetEnvironmentVariablesReturns {
4201        GetEnvironmentVariablesReturns {
4202            environment_variables: self.environment_variables,
4203        }
4204    }
4205}
4206
4207#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4208pub struct GetEnvironmentVariablesParams {}
4209
4210impl GetEnvironmentVariablesParams { pub const METHOD: &'static str = "CSS.getEnvironmentVariables"; }
4211
4212impl<'a> crate::CdpCommand<'a> for GetEnvironmentVariablesParams {
4213    const METHOD: &'static str = "CSS.getEnvironmentVariables";
4214    type Response = GetEnvironmentVariablesReturns;
4215}
4216
4217/// Returns all media queries parsed by the rendering engine.
4218
4219#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4220#[serde(rename_all = "camelCase")]
4221pub struct GetMediaQueriesReturns<'a> {
4222    medias: Vec<CSSMedia<'a>>,
4223}
4224
4225impl<'a> GetMediaQueriesReturns<'a> {
4226    /// Creates a builder for this type with the required parameters:
4227    /// * `medias`: 
4228    pub fn builder(medias: Vec<CSSMedia<'a>>) -> GetMediaQueriesReturnsBuilder<'a> {
4229        GetMediaQueriesReturnsBuilder {
4230            medias: medias,
4231        }
4232    }
4233    pub fn medias(&self) -> &[CSSMedia<'a>] { &self.medias }
4234}
4235
4236
4237pub struct GetMediaQueriesReturnsBuilder<'a> {
4238    medias: Vec<CSSMedia<'a>>,
4239}
4240
4241impl<'a> GetMediaQueriesReturnsBuilder<'a> {
4242    pub fn build(self) -> GetMediaQueriesReturns<'a> {
4243        GetMediaQueriesReturns {
4244            medias: self.medias,
4245        }
4246    }
4247}
4248
4249#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4250pub struct GetMediaQueriesParams {}
4251
4252impl GetMediaQueriesParams { pub const METHOD: &'static str = "CSS.getMediaQueries"; }
4253
4254impl<'a> crate::CdpCommand<'a> for GetMediaQueriesParams {
4255    const METHOD: &'static str = "CSS.getMediaQueries";
4256    type Response = GetMediaQueriesReturns<'a>;
4257}
4258
4259/// Requests information about platform fonts which we used to render child TextNodes in the given
4260/// node.
4261
4262#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4263#[serde(rename_all = "camelCase")]
4264pub struct GetPlatformFontsForNodeParams {
4265    #[serde(rename = "nodeId")]
4266    node_id: crate::dom::NodeId,
4267}
4268
4269impl GetPlatformFontsForNodeParams {
4270    /// Creates a builder for this type with the required parameters:
4271    /// * `node_id`: 
4272    pub fn builder(node_id: crate::dom::NodeId) -> GetPlatformFontsForNodeParamsBuilder {
4273        GetPlatformFontsForNodeParamsBuilder {
4274            node_id: node_id,
4275        }
4276    }
4277    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
4278}
4279
4280
4281pub struct GetPlatformFontsForNodeParamsBuilder {
4282    node_id: crate::dom::NodeId,
4283}
4284
4285impl GetPlatformFontsForNodeParamsBuilder {
4286    pub fn build(self) -> GetPlatformFontsForNodeParams {
4287        GetPlatformFontsForNodeParams {
4288            node_id: self.node_id,
4289        }
4290    }
4291}
4292
4293/// Requests information about platform fonts which we used to render child TextNodes in the given
4294/// node.
4295
4296#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4297#[serde(rename_all = "camelCase")]
4298pub struct GetPlatformFontsForNodeReturns<'a> {
4299    /// Usage statistics for every employed platform font.
4300    fonts: Vec<PlatformFontUsage<'a>>,
4301}
4302
4303impl<'a> GetPlatformFontsForNodeReturns<'a> {
4304    /// Creates a builder for this type with the required parameters:
4305    /// * `fonts`: Usage statistics for every employed platform font.
4306    pub fn builder(fonts: Vec<PlatformFontUsage<'a>>) -> GetPlatformFontsForNodeReturnsBuilder<'a> {
4307        GetPlatformFontsForNodeReturnsBuilder {
4308            fonts: fonts,
4309        }
4310    }
4311    /// Usage statistics for every employed platform font.
4312    pub fn fonts(&self) -> &[PlatformFontUsage<'a>] { &self.fonts }
4313}
4314
4315
4316pub struct GetPlatformFontsForNodeReturnsBuilder<'a> {
4317    fonts: Vec<PlatformFontUsage<'a>>,
4318}
4319
4320impl<'a> GetPlatformFontsForNodeReturnsBuilder<'a> {
4321    pub fn build(self) -> GetPlatformFontsForNodeReturns<'a> {
4322        GetPlatformFontsForNodeReturns {
4323            fonts: self.fonts,
4324        }
4325    }
4326}
4327
4328impl GetPlatformFontsForNodeParams { pub const METHOD: &'static str = "CSS.getPlatformFontsForNode"; }
4329
4330impl<'a> crate::CdpCommand<'a> for GetPlatformFontsForNodeParams {
4331    const METHOD: &'static str = "CSS.getPlatformFontsForNode";
4332    type Response = GetPlatformFontsForNodeReturns<'a>;
4333}
4334
4335/// Returns the current textual content for a stylesheet.
4336
4337#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4338#[serde(rename_all = "camelCase")]
4339pub struct GetStyleSheetTextParams<'a> {
4340    #[serde(rename = "styleSheetId")]
4341    style_sheet_id: crate::dom::StyleSheetId<'a>,
4342}
4343
4344impl<'a> GetStyleSheetTextParams<'a> {
4345    /// Creates a builder for this type with the required parameters:
4346    /// * `style_sheet_id`: 
4347    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>) -> GetStyleSheetTextParamsBuilder<'a> {
4348        GetStyleSheetTextParamsBuilder {
4349            style_sheet_id: style_sheet_id,
4350        }
4351    }
4352    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
4353}
4354
4355
4356pub struct GetStyleSheetTextParamsBuilder<'a> {
4357    style_sheet_id: crate::dom::StyleSheetId<'a>,
4358}
4359
4360impl<'a> GetStyleSheetTextParamsBuilder<'a> {
4361    pub fn build(self) -> GetStyleSheetTextParams<'a> {
4362        GetStyleSheetTextParams {
4363            style_sheet_id: self.style_sheet_id,
4364        }
4365    }
4366}
4367
4368/// Returns the current textual content for a stylesheet.
4369
4370#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4371#[serde(rename_all = "camelCase")]
4372pub struct GetStyleSheetTextReturns<'a> {
4373    /// The stylesheet text.
4374    text: Cow<'a, str>,
4375}
4376
4377impl<'a> GetStyleSheetTextReturns<'a> {
4378    /// Creates a builder for this type with the required parameters:
4379    /// * `text`: The stylesheet text.
4380    pub fn builder(text: impl Into<Cow<'a, str>>) -> GetStyleSheetTextReturnsBuilder<'a> {
4381        GetStyleSheetTextReturnsBuilder {
4382            text: text.into(),
4383        }
4384    }
4385    /// The stylesheet text.
4386    pub fn text(&self) -> &str { self.text.as_ref() }
4387}
4388
4389
4390pub struct GetStyleSheetTextReturnsBuilder<'a> {
4391    text: Cow<'a, str>,
4392}
4393
4394impl<'a> GetStyleSheetTextReturnsBuilder<'a> {
4395    pub fn build(self) -> GetStyleSheetTextReturns<'a> {
4396        GetStyleSheetTextReturns {
4397            text: self.text,
4398        }
4399    }
4400}
4401
4402impl<'a> GetStyleSheetTextParams<'a> { pub const METHOD: &'static str = "CSS.getStyleSheetText"; }
4403
4404impl<'a> crate::CdpCommand<'a> for GetStyleSheetTextParams<'a> {
4405    const METHOD: &'static str = "CSS.getStyleSheetText";
4406    type Response = GetStyleSheetTextReturns<'a>;
4407}
4408
4409/// Returns all layers parsed by the rendering engine for the tree scope of a node.
4410/// Given a DOM element identified by nodeId, getLayersForNode returns the root
4411/// layer for the nearest ancestor document or shadow root. The layer root contains
4412/// the full layer tree for the tree scope and their ordering.
4413
4414#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4415#[serde(rename_all = "camelCase")]
4416pub struct GetLayersForNodeParams {
4417    #[serde(rename = "nodeId")]
4418    node_id: crate::dom::NodeId,
4419}
4420
4421impl GetLayersForNodeParams {
4422    /// Creates a builder for this type with the required parameters:
4423    /// * `node_id`: 
4424    pub fn builder(node_id: crate::dom::NodeId) -> GetLayersForNodeParamsBuilder {
4425        GetLayersForNodeParamsBuilder {
4426            node_id: node_id,
4427        }
4428    }
4429    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
4430}
4431
4432
4433pub struct GetLayersForNodeParamsBuilder {
4434    node_id: crate::dom::NodeId,
4435}
4436
4437impl GetLayersForNodeParamsBuilder {
4438    pub fn build(self) -> GetLayersForNodeParams {
4439        GetLayersForNodeParams {
4440            node_id: self.node_id,
4441        }
4442    }
4443}
4444
4445/// Returns all layers parsed by the rendering engine for the tree scope of a node.
4446/// Given a DOM element identified by nodeId, getLayersForNode returns the root
4447/// layer for the nearest ancestor document or shadow root. The layer root contains
4448/// the full layer tree for the tree scope and their ordering.
4449
4450#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4451#[serde(rename_all = "camelCase")]
4452pub struct GetLayersForNodeReturns<'a> {
4453    #[serde(rename = "rootLayer")]
4454    root_layer: CSSLayerData<'a>,
4455}
4456
4457impl<'a> GetLayersForNodeReturns<'a> {
4458    /// Creates a builder for this type with the required parameters:
4459    /// * `root_layer`: 
4460    pub fn builder(root_layer: CSSLayerData<'a>) -> GetLayersForNodeReturnsBuilder<'a> {
4461        GetLayersForNodeReturnsBuilder {
4462            root_layer: root_layer,
4463        }
4464    }
4465    pub fn root_layer(&self) -> &CSSLayerData<'a> { &self.root_layer }
4466}
4467
4468
4469pub struct GetLayersForNodeReturnsBuilder<'a> {
4470    root_layer: CSSLayerData<'a>,
4471}
4472
4473impl<'a> GetLayersForNodeReturnsBuilder<'a> {
4474    pub fn build(self) -> GetLayersForNodeReturns<'a> {
4475        GetLayersForNodeReturns {
4476            root_layer: self.root_layer,
4477        }
4478    }
4479}
4480
4481impl GetLayersForNodeParams { pub const METHOD: &'static str = "CSS.getLayersForNode"; }
4482
4483impl<'a> crate::CdpCommand<'a> for GetLayersForNodeParams {
4484    const METHOD: &'static str = "CSS.getLayersForNode";
4485    type Response = GetLayersForNodeReturns<'a>;
4486}
4487
4488/// Given a CSS selector text and a style sheet ID, getLocationForSelector
4489/// returns an array of locations of the CSS selector in the style sheet.
4490
4491#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4492#[serde(rename_all = "camelCase")]
4493pub struct GetLocationForSelectorParams<'a> {
4494    #[serde(rename = "styleSheetId")]
4495    style_sheet_id: crate::dom::StyleSheetId<'a>,
4496    #[serde(rename = "selectorText")]
4497    selector_text: Cow<'a, str>,
4498}
4499
4500impl<'a> GetLocationForSelectorParams<'a> {
4501    /// Creates a builder for this type with the required parameters:
4502    /// * `style_sheet_id`: 
4503    /// * `selector_text`: 
4504    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, selector_text: impl Into<Cow<'a, str>>) -> GetLocationForSelectorParamsBuilder<'a> {
4505        GetLocationForSelectorParamsBuilder {
4506            style_sheet_id: style_sheet_id,
4507            selector_text: selector_text.into(),
4508        }
4509    }
4510    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
4511    pub fn selector_text(&self) -> &str { self.selector_text.as_ref() }
4512}
4513
4514
4515pub struct GetLocationForSelectorParamsBuilder<'a> {
4516    style_sheet_id: crate::dom::StyleSheetId<'a>,
4517    selector_text: Cow<'a, str>,
4518}
4519
4520impl<'a> GetLocationForSelectorParamsBuilder<'a> {
4521    pub fn build(self) -> GetLocationForSelectorParams<'a> {
4522        GetLocationForSelectorParams {
4523            style_sheet_id: self.style_sheet_id,
4524            selector_text: self.selector_text,
4525        }
4526    }
4527}
4528
4529/// Given a CSS selector text and a style sheet ID, getLocationForSelector
4530/// returns an array of locations of the CSS selector in the style sheet.
4531
4532#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4533#[serde(rename_all = "camelCase")]
4534pub struct GetLocationForSelectorReturns {
4535    ranges: Vec<SourceRange>,
4536}
4537
4538impl GetLocationForSelectorReturns {
4539    /// Creates a builder for this type with the required parameters:
4540    /// * `ranges`: 
4541    pub fn builder(ranges: Vec<SourceRange>) -> GetLocationForSelectorReturnsBuilder {
4542        GetLocationForSelectorReturnsBuilder {
4543            ranges: ranges,
4544        }
4545    }
4546    pub fn ranges(&self) -> &[SourceRange] { &self.ranges }
4547}
4548
4549
4550pub struct GetLocationForSelectorReturnsBuilder {
4551    ranges: Vec<SourceRange>,
4552}
4553
4554impl GetLocationForSelectorReturnsBuilder {
4555    pub fn build(self) -> GetLocationForSelectorReturns {
4556        GetLocationForSelectorReturns {
4557            ranges: self.ranges,
4558        }
4559    }
4560}
4561
4562impl<'a> GetLocationForSelectorParams<'a> { pub const METHOD: &'static str = "CSS.getLocationForSelector"; }
4563
4564impl<'a> crate::CdpCommand<'a> for GetLocationForSelectorParams<'a> {
4565    const METHOD: &'static str = "CSS.getLocationForSelector";
4566    type Response = GetLocationForSelectorReturns;
4567}
4568
4569/// Starts tracking the given node for the computed style updates
4570/// and whenever the computed style is updated for node, it queues
4571/// a 'computedStyleUpdated' event with throttling.
4572/// There can only be 1 node tracked for computed style updates
4573/// so passing a new node id removes tracking from the previous node.
4574/// Pass 'undefined' to disable tracking.
4575
4576#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4577#[serde(rename_all = "camelCase")]
4578pub struct TrackComputedStyleUpdatesForNodeParams {
4579    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
4580    node_id: Option<crate::dom::NodeId>,
4581}
4582
4583impl TrackComputedStyleUpdatesForNodeParams {
4584    /// Creates a builder for this type.
4585    pub fn builder() -> TrackComputedStyleUpdatesForNodeParamsBuilder {
4586        TrackComputedStyleUpdatesForNodeParamsBuilder {
4587            node_id: None,
4588        }
4589    }
4590    pub fn node_id(&self) -> Option<&crate::dom::NodeId> { self.node_id.as_ref() }
4591}
4592
4593#[derive(Default)]
4594pub struct TrackComputedStyleUpdatesForNodeParamsBuilder {
4595    node_id: Option<crate::dom::NodeId>,
4596}
4597
4598impl TrackComputedStyleUpdatesForNodeParamsBuilder {
4599    pub fn node_id(mut self, node_id: crate::dom::NodeId) -> Self { self.node_id = Some(node_id); self }
4600    pub fn build(self) -> TrackComputedStyleUpdatesForNodeParams {
4601        TrackComputedStyleUpdatesForNodeParams {
4602            node_id: self.node_id,
4603        }
4604    }
4605}
4606
4607impl TrackComputedStyleUpdatesForNodeParams { pub const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode"; }
4608
4609impl<'a> crate::CdpCommand<'a> for TrackComputedStyleUpdatesForNodeParams {
4610    const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode";
4611    type Response = crate::EmptyReturns;
4612}
4613
4614/// Starts tracking the given computed styles for updates. The specified array of properties
4615/// replaces the one previously specified. Pass empty array to disable tracking.
4616/// Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified.
4617/// The changes to computed style properties are only tracked for nodes pushed to the front-end
4618/// by the DOM agent. If no changes to the tracked properties occur after the node has been pushed
4619/// to the front-end, no updates will be issued for the node.
4620
4621#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4622#[serde(rename_all = "camelCase")]
4623pub struct TrackComputedStyleUpdatesParams<'a> {
4624    #[serde(rename = "propertiesToTrack")]
4625    properties_to_track: Vec<CSSComputedStyleProperty<'a>>,
4626}
4627
4628impl<'a> TrackComputedStyleUpdatesParams<'a> {
4629    /// Creates a builder for this type with the required parameters:
4630    /// * `properties_to_track`: 
4631    pub fn builder(properties_to_track: Vec<CSSComputedStyleProperty<'a>>) -> TrackComputedStyleUpdatesParamsBuilder<'a> {
4632        TrackComputedStyleUpdatesParamsBuilder {
4633            properties_to_track: properties_to_track,
4634        }
4635    }
4636    pub fn properties_to_track(&self) -> &[CSSComputedStyleProperty<'a>] { &self.properties_to_track }
4637}
4638
4639
4640pub struct TrackComputedStyleUpdatesParamsBuilder<'a> {
4641    properties_to_track: Vec<CSSComputedStyleProperty<'a>>,
4642}
4643
4644impl<'a> TrackComputedStyleUpdatesParamsBuilder<'a> {
4645    pub fn build(self) -> TrackComputedStyleUpdatesParams<'a> {
4646        TrackComputedStyleUpdatesParams {
4647            properties_to_track: self.properties_to_track,
4648        }
4649    }
4650}
4651
4652impl<'a> TrackComputedStyleUpdatesParams<'a> { pub const METHOD: &'static str = "CSS.trackComputedStyleUpdates"; }
4653
4654impl<'a> crate::CdpCommand<'a> for TrackComputedStyleUpdatesParams<'a> {
4655    const METHOD: &'static str = "CSS.trackComputedStyleUpdates";
4656    type Response = crate::EmptyReturns;
4657}
4658
4659/// Polls the next batch of computed style updates.
4660
4661#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4662#[serde(rename_all = "camelCase")]
4663pub struct TakeComputedStyleUpdatesReturns {
4664    /// The list of node Ids that have their tracked computed styles updated.
4665    #[serde(rename = "nodeIds")]
4666    node_ids: Vec<crate::dom::NodeId>,
4667}
4668
4669impl TakeComputedStyleUpdatesReturns {
4670    /// Creates a builder for this type with the required parameters:
4671    /// * `node_ids`: The list of node Ids that have their tracked computed styles updated.
4672    pub fn builder(node_ids: Vec<crate::dom::NodeId>) -> TakeComputedStyleUpdatesReturnsBuilder {
4673        TakeComputedStyleUpdatesReturnsBuilder {
4674            node_ids: node_ids,
4675        }
4676    }
4677    /// The list of node Ids that have their tracked computed styles updated.
4678    pub fn node_ids(&self) -> &[crate::dom::NodeId] { &self.node_ids }
4679}
4680
4681
4682pub struct TakeComputedStyleUpdatesReturnsBuilder {
4683    node_ids: Vec<crate::dom::NodeId>,
4684}
4685
4686impl TakeComputedStyleUpdatesReturnsBuilder {
4687    pub fn build(self) -> TakeComputedStyleUpdatesReturns {
4688        TakeComputedStyleUpdatesReturns {
4689            node_ids: self.node_ids,
4690        }
4691    }
4692}
4693
4694#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4695pub struct TakeComputedStyleUpdatesParams {}
4696
4697impl TakeComputedStyleUpdatesParams { pub const METHOD: &'static str = "CSS.takeComputedStyleUpdates"; }
4698
4699impl<'a> crate::CdpCommand<'a> for TakeComputedStyleUpdatesParams {
4700    const METHOD: &'static str = "CSS.takeComputedStyleUpdates";
4701    type Response = TakeComputedStyleUpdatesReturns;
4702}
4703
4704/// Find a rule with the given active property for the given node and set the new value for this
4705/// property
4706
4707#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4708#[serde(rename_all = "camelCase")]
4709pub struct SetEffectivePropertyValueForNodeParams<'a> {
4710    /// The element id for which to set property.
4711    #[serde(rename = "nodeId")]
4712    node_id: crate::dom::NodeId,
4713    #[serde(rename = "propertyName")]
4714    property_name: Cow<'a, str>,
4715    value: Cow<'a, str>,
4716}
4717
4718impl<'a> SetEffectivePropertyValueForNodeParams<'a> {
4719    /// Creates a builder for this type with the required parameters:
4720    /// * `node_id`: The element id for which to set property.
4721    /// * `property_name`: 
4722    /// * `value`: 
4723    pub fn builder(node_id: crate::dom::NodeId, property_name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetEffectivePropertyValueForNodeParamsBuilder<'a> {
4724        SetEffectivePropertyValueForNodeParamsBuilder {
4725            node_id: node_id,
4726            property_name: property_name.into(),
4727            value: value.into(),
4728        }
4729    }
4730    /// The element id for which to set property.
4731    pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
4732    pub fn property_name(&self) -> &str { self.property_name.as_ref() }
4733    pub fn value(&self) -> &str { self.value.as_ref() }
4734}
4735
4736
4737pub struct SetEffectivePropertyValueForNodeParamsBuilder<'a> {
4738    node_id: crate::dom::NodeId,
4739    property_name: Cow<'a, str>,
4740    value: Cow<'a, str>,
4741}
4742
4743impl<'a> SetEffectivePropertyValueForNodeParamsBuilder<'a> {
4744    pub fn build(self) -> SetEffectivePropertyValueForNodeParams<'a> {
4745        SetEffectivePropertyValueForNodeParams {
4746            node_id: self.node_id,
4747            property_name: self.property_name,
4748            value: self.value,
4749        }
4750    }
4751}
4752
4753impl<'a> SetEffectivePropertyValueForNodeParams<'a> { pub const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode"; }
4754
4755impl<'a> crate::CdpCommand<'a> for SetEffectivePropertyValueForNodeParams<'a> {
4756    const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode";
4757    type Response = crate::EmptyReturns;
4758}
4759
4760/// Modifies the property rule property name.
4761
4762#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4763#[serde(rename_all = "camelCase")]
4764pub struct SetPropertyRulePropertyNameParams<'a> {
4765    #[serde(rename = "styleSheetId")]
4766    style_sheet_id: crate::dom::StyleSheetId<'a>,
4767    range: SourceRange,
4768    #[serde(rename = "propertyName")]
4769    property_name: Cow<'a, str>,
4770}
4771
4772impl<'a> SetPropertyRulePropertyNameParams<'a> {
4773    /// Creates a builder for this type with the required parameters:
4774    /// * `style_sheet_id`: 
4775    /// * `range`: 
4776    /// * `property_name`: 
4777    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, property_name: impl Into<Cow<'a, str>>) -> SetPropertyRulePropertyNameParamsBuilder<'a> {
4778        SetPropertyRulePropertyNameParamsBuilder {
4779            style_sheet_id: style_sheet_id,
4780            range: range,
4781            property_name: property_name.into(),
4782        }
4783    }
4784    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
4785    pub fn range(&self) -> &SourceRange { &self.range }
4786    pub fn property_name(&self) -> &str { self.property_name.as_ref() }
4787}
4788
4789
4790pub struct SetPropertyRulePropertyNameParamsBuilder<'a> {
4791    style_sheet_id: crate::dom::StyleSheetId<'a>,
4792    range: SourceRange,
4793    property_name: Cow<'a, str>,
4794}
4795
4796impl<'a> SetPropertyRulePropertyNameParamsBuilder<'a> {
4797    pub fn build(self) -> SetPropertyRulePropertyNameParams<'a> {
4798        SetPropertyRulePropertyNameParams {
4799            style_sheet_id: self.style_sheet_id,
4800            range: self.range,
4801            property_name: self.property_name,
4802        }
4803    }
4804}
4805
4806/// Modifies the property rule property name.
4807
4808#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4809#[serde(rename_all = "camelCase")]
4810pub struct SetPropertyRulePropertyNameReturns<'a> {
4811    /// The resulting key text after modification.
4812    #[serde(rename = "propertyName")]
4813    property_name: ProtocolValue<'a>,
4814}
4815
4816impl<'a> SetPropertyRulePropertyNameReturns<'a> {
4817    /// Creates a builder for this type with the required parameters:
4818    /// * `property_name`: The resulting key text after modification.
4819    pub fn builder(property_name: ProtocolValue<'a>) -> SetPropertyRulePropertyNameReturnsBuilder<'a> {
4820        SetPropertyRulePropertyNameReturnsBuilder {
4821            property_name: property_name,
4822        }
4823    }
4824    /// The resulting key text after modification.
4825    pub fn property_name(&self) -> &ProtocolValue<'a> { &self.property_name }
4826}
4827
4828
4829pub struct SetPropertyRulePropertyNameReturnsBuilder<'a> {
4830    property_name: ProtocolValue<'a>,
4831}
4832
4833impl<'a> SetPropertyRulePropertyNameReturnsBuilder<'a> {
4834    pub fn build(self) -> SetPropertyRulePropertyNameReturns<'a> {
4835        SetPropertyRulePropertyNameReturns {
4836            property_name: self.property_name,
4837        }
4838    }
4839}
4840
4841impl<'a> SetPropertyRulePropertyNameParams<'a> { pub const METHOD: &'static str = "CSS.setPropertyRulePropertyName"; }
4842
4843impl<'a> crate::CdpCommand<'a> for SetPropertyRulePropertyNameParams<'a> {
4844    const METHOD: &'static str = "CSS.setPropertyRulePropertyName";
4845    type Response = SetPropertyRulePropertyNameReturns<'a>;
4846}
4847
4848/// Modifies the keyframe rule key text.
4849
4850#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4851#[serde(rename_all = "camelCase")]
4852pub struct SetKeyframeKeyParams<'a> {
4853    #[serde(rename = "styleSheetId")]
4854    style_sheet_id: crate::dom::StyleSheetId<'a>,
4855    range: SourceRange,
4856    #[serde(rename = "keyText")]
4857    key_text: Cow<'a, str>,
4858}
4859
4860impl<'a> SetKeyframeKeyParams<'a> {
4861    /// Creates a builder for this type with the required parameters:
4862    /// * `style_sheet_id`: 
4863    /// * `range`: 
4864    /// * `key_text`: 
4865    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, key_text: impl Into<Cow<'a, str>>) -> SetKeyframeKeyParamsBuilder<'a> {
4866        SetKeyframeKeyParamsBuilder {
4867            style_sheet_id: style_sheet_id,
4868            range: range,
4869            key_text: key_text.into(),
4870        }
4871    }
4872    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
4873    pub fn range(&self) -> &SourceRange { &self.range }
4874    pub fn key_text(&self) -> &str { self.key_text.as_ref() }
4875}
4876
4877
4878pub struct SetKeyframeKeyParamsBuilder<'a> {
4879    style_sheet_id: crate::dom::StyleSheetId<'a>,
4880    range: SourceRange,
4881    key_text: Cow<'a, str>,
4882}
4883
4884impl<'a> SetKeyframeKeyParamsBuilder<'a> {
4885    pub fn build(self) -> SetKeyframeKeyParams<'a> {
4886        SetKeyframeKeyParams {
4887            style_sheet_id: self.style_sheet_id,
4888            range: self.range,
4889            key_text: self.key_text,
4890        }
4891    }
4892}
4893
4894/// Modifies the keyframe rule key text.
4895
4896#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4897#[serde(rename_all = "camelCase")]
4898pub struct SetKeyframeKeyReturns<'a> {
4899    /// The resulting key text after modification.
4900    #[serde(rename = "keyText")]
4901    key_text: ProtocolValue<'a>,
4902}
4903
4904impl<'a> SetKeyframeKeyReturns<'a> {
4905    /// Creates a builder for this type with the required parameters:
4906    /// * `key_text`: The resulting key text after modification.
4907    pub fn builder(key_text: ProtocolValue<'a>) -> SetKeyframeKeyReturnsBuilder<'a> {
4908        SetKeyframeKeyReturnsBuilder {
4909            key_text: key_text,
4910        }
4911    }
4912    /// The resulting key text after modification.
4913    pub fn key_text(&self) -> &ProtocolValue<'a> { &self.key_text }
4914}
4915
4916
4917pub struct SetKeyframeKeyReturnsBuilder<'a> {
4918    key_text: ProtocolValue<'a>,
4919}
4920
4921impl<'a> SetKeyframeKeyReturnsBuilder<'a> {
4922    pub fn build(self) -> SetKeyframeKeyReturns<'a> {
4923        SetKeyframeKeyReturns {
4924            key_text: self.key_text,
4925        }
4926    }
4927}
4928
4929impl<'a> SetKeyframeKeyParams<'a> { pub const METHOD: &'static str = "CSS.setKeyframeKey"; }
4930
4931impl<'a> crate::CdpCommand<'a> for SetKeyframeKeyParams<'a> {
4932    const METHOD: &'static str = "CSS.setKeyframeKey";
4933    type Response = SetKeyframeKeyReturns<'a>;
4934}
4935
4936/// Modifies the rule selector.
4937
4938#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4939#[serde(rename_all = "camelCase")]
4940pub struct SetMediaTextParams<'a> {
4941    #[serde(rename = "styleSheetId")]
4942    style_sheet_id: crate::dom::StyleSheetId<'a>,
4943    range: SourceRange,
4944    text: Cow<'a, str>,
4945}
4946
4947impl<'a> SetMediaTextParams<'a> {
4948    /// Creates a builder for this type with the required parameters:
4949    /// * `style_sheet_id`: 
4950    /// * `range`: 
4951    /// * `text`: 
4952    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetMediaTextParamsBuilder<'a> {
4953        SetMediaTextParamsBuilder {
4954            style_sheet_id: style_sheet_id,
4955            range: range,
4956            text: text.into(),
4957        }
4958    }
4959    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
4960    pub fn range(&self) -> &SourceRange { &self.range }
4961    pub fn text(&self) -> &str { self.text.as_ref() }
4962}
4963
4964
4965pub struct SetMediaTextParamsBuilder<'a> {
4966    style_sheet_id: crate::dom::StyleSheetId<'a>,
4967    range: SourceRange,
4968    text: Cow<'a, str>,
4969}
4970
4971impl<'a> SetMediaTextParamsBuilder<'a> {
4972    pub fn build(self) -> SetMediaTextParams<'a> {
4973        SetMediaTextParams {
4974            style_sheet_id: self.style_sheet_id,
4975            range: self.range,
4976            text: self.text,
4977        }
4978    }
4979}
4980
4981/// Modifies the rule selector.
4982
4983#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4984#[serde(rename_all = "camelCase")]
4985pub struct SetMediaTextReturns<'a> {
4986    /// The resulting CSS media rule after modification.
4987    media: CSSMedia<'a>,
4988}
4989
4990impl<'a> SetMediaTextReturns<'a> {
4991    /// Creates a builder for this type with the required parameters:
4992    /// * `media`: The resulting CSS media rule after modification.
4993    pub fn builder(media: CSSMedia<'a>) -> SetMediaTextReturnsBuilder<'a> {
4994        SetMediaTextReturnsBuilder {
4995            media: media,
4996        }
4997    }
4998    /// The resulting CSS media rule after modification.
4999    pub fn media(&self) -> &CSSMedia<'a> { &self.media }
5000}
5001
5002
5003pub struct SetMediaTextReturnsBuilder<'a> {
5004    media: CSSMedia<'a>,
5005}
5006
5007impl<'a> SetMediaTextReturnsBuilder<'a> {
5008    pub fn build(self) -> SetMediaTextReturns<'a> {
5009        SetMediaTextReturns {
5010            media: self.media,
5011        }
5012    }
5013}
5014
5015impl<'a> SetMediaTextParams<'a> { pub const METHOD: &'static str = "CSS.setMediaText"; }
5016
5017impl<'a> crate::CdpCommand<'a> for SetMediaTextParams<'a> {
5018    const METHOD: &'static str = "CSS.setMediaText";
5019    type Response = SetMediaTextReturns<'a>;
5020}
5021
5022/// Modifies the expression of a container query.
5023/// Deprecated. Use setContainerQueryConditionText instead.
5024
5025#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5026#[serde(rename_all = "camelCase")]
5027pub struct SetContainerQueryTextParams<'a> {
5028    #[serde(rename = "styleSheetId")]
5029    style_sheet_id: crate::dom::StyleSheetId<'a>,
5030    range: SourceRange,
5031    text: Cow<'a, str>,
5032}
5033
5034impl<'a> SetContainerQueryTextParams<'a> {
5035    /// Creates a builder for this type with the required parameters:
5036    /// * `style_sheet_id`: 
5037    /// * `range`: 
5038    /// * `text`: 
5039    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetContainerQueryTextParamsBuilder<'a> {
5040        SetContainerQueryTextParamsBuilder {
5041            style_sheet_id: style_sheet_id,
5042            range: range,
5043            text: text.into(),
5044        }
5045    }
5046    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5047    pub fn range(&self) -> &SourceRange { &self.range }
5048    pub fn text(&self) -> &str { self.text.as_ref() }
5049}
5050
5051
5052pub struct SetContainerQueryTextParamsBuilder<'a> {
5053    style_sheet_id: crate::dom::StyleSheetId<'a>,
5054    range: SourceRange,
5055    text: Cow<'a, str>,
5056}
5057
5058impl<'a> SetContainerQueryTextParamsBuilder<'a> {
5059    pub fn build(self) -> SetContainerQueryTextParams<'a> {
5060        SetContainerQueryTextParams {
5061            style_sheet_id: self.style_sheet_id,
5062            range: self.range,
5063            text: self.text,
5064        }
5065    }
5066}
5067
5068/// Modifies the expression of a container query.
5069/// Deprecated. Use setContainerQueryConditionText instead.
5070
5071#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5072#[serde(rename_all = "camelCase")]
5073pub struct SetContainerQueryTextReturns<'a> {
5074    /// The resulting CSS container query rule after modification.
5075    #[serde(rename = "containerQuery")]
5076    container_query: CSSContainerQuery<'a>,
5077}
5078
5079impl<'a> SetContainerQueryTextReturns<'a> {
5080    /// Creates a builder for this type with the required parameters:
5081    /// * `container_query`: The resulting CSS container query rule after modification.
5082    pub fn builder(container_query: CSSContainerQuery<'a>) -> SetContainerQueryTextReturnsBuilder<'a> {
5083        SetContainerQueryTextReturnsBuilder {
5084            container_query: container_query,
5085        }
5086    }
5087    /// The resulting CSS container query rule after modification.
5088    pub fn container_query(&self) -> &CSSContainerQuery<'a> { &self.container_query }
5089}
5090
5091
5092pub struct SetContainerQueryTextReturnsBuilder<'a> {
5093    container_query: CSSContainerQuery<'a>,
5094}
5095
5096impl<'a> SetContainerQueryTextReturnsBuilder<'a> {
5097    pub fn build(self) -> SetContainerQueryTextReturns<'a> {
5098        SetContainerQueryTextReturns {
5099            container_query: self.container_query,
5100        }
5101    }
5102}
5103
5104impl<'a> SetContainerQueryTextParams<'a> { pub const METHOD: &'static str = "CSS.setContainerQueryText"; }
5105
5106impl<'a> crate::CdpCommand<'a> for SetContainerQueryTextParams<'a> {
5107    const METHOD: &'static str = "CSS.setContainerQueryText";
5108    type Response = SetContainerQueryTextReturns<'a>;
5109}
5110
5111
5112#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5113#[serde(rename_all = "camelCase")]
5114pub struct SetContainerQueryConditionTextParams<'a> {
5115    #[serde(rename = "styleSheetId")]
5116    style_sheet_id: crate::dom::StyleSheetId<'a>,
5117    range: SourceRange,
5118    text: Cow<'a, str>,
5119}
5120
5121impl<'a> SetContainerQueryConditionTextParams<'a> {
5122    /// Creates a builder for this type with the required parameters:
5123    /// * `style_sheet_id`: 
5124    /// * `range`: 
5125    /// * `text`: 
5126    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetContainerQueryConditionTextParamsBuilder<'a> {
5127        SetContainerQueryConditionTextParamsBuilder {
5128            style_sheet_id: style_sheet_id,
5129            range: range,
5130            text: text.into(),
5131        }
5132    }
5133    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5134    pub fn range(&self) -> &SourceRange { &self.range }
5135    pub fn text(&self) -> &str { self.text.as_ref() }
5136}
5137
5138
5139pub struct SetContainerQueryConditionTextParamsBuilder<'a> {
5140    style_sheet_id: crate::dom::StyleSheetId<'a>,
5141    range: SourceRange,
5142    text: Cow<'a, str>,
5143}
5144
5145impl<'a> SetContainerQueryConditionTextParamsBuilder<'a> {
5146    pub fn build(self) -> SetContainerQueryConditionTextParams<'a> {
5147        SetContainerQueryConditionTextParams {
5148            style_sheet_id: self.style_sheet_id,
5149            range: self.range,
5150            text: self.text,
5151        }
5152    }
5153}
5154
5155
5156#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5157#[serde(rename_all = "camelCase")]
5158pub struct SetContainerQueryConditionTextReturns<'a> {
5159    /// The resulting CSS container query rule after modification.
5160    #[serde(rename = "containerQuery")]
5161    container_query: CSSContainerQuery<'a>,
5162}
5163
5164impl<'a> SetContainerQueryConditionTextReturns<'a> {
5165    /// Creates a builder for this type with the required parameters:
5166    /// * `container_query`: The resulting CSS container query rule after modification.
5167    pub fn builder(container_query: CSSContainerQuery<'a>) -> SetContainerQueryConditionTextReturnsBuilder<'a> {
5168        SetContainerQueryConditionTextReturnsBuilder {
5169            container_query: container_query,
5170        }
5171    }
5172    /// The resulting CSS container query rule after modification.
5173    pub fn container_query(&self) -> &CSSContainerQuery<'a> { &self.container_query }
5174}
5175
5176
5177pub struct SetContainerQueryConditionTextReturnsBuilder<'a> {
5178    container_query: CSSContainerQuery<'a>,
5179}
5180
5181impl<'a> SetContainerQueryConditionTextReturnsBuilder<'a> {
5182    pub fn build(self) -> SetContainerQueryConditionTextReturns<'a> {
5183        SetContainerQueryConditionTextReturns {
5184            container_query: self.container_query,
5185        }
5186    }
5187}
5188
5189impl<'a> SetContainerQueryConditionTextParams<'a> { pub const METHOD: &'static str = "CSS.setContainerQueryConditionText"; }
5190
5191impl<'a> crate::CdpCommand<'a> for SetContainerQueryConditionTextParams<'a> {
5192    const METHOD: &'static str = "CSS.setContainerQueryConditionText";
5193    type Response = SetContainerQueryConditionTextReturns<'a>;
5194}
5195
5196/// Modifies the expression of a supports at-rule.
5197
5198#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5199#[serde(rename_all = "camelCase")]
5200pub struct SetSupportsTextParams<'a> {
5201    #[serde(rename = "styleSheetId")]
5202    style_sheet_id: crate::dom::StyleSheetId<'a>,
5203    range: SourceRange,
5204    text: Cow<'a, str>,
5205}
5206
5207impl<'a> SetSupportsTextParams<'a> {
5208    /// Creates a builder for this type with the required parameters:
5209    /// * `style_sheet_id`: 
5210    /// * `range`: 
5211    /// * `text`: 
5212    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetSupportsTextParamsBuilder<'a> {
5213        SetSupportsTextParamsBuilder {
5214            style_sheet_id: style_sheet_id,
5215            range: range,
5216            text: text.into(),
5217        }
5218    }
5219    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5220    pub fn range(&self) -> &SourceRange { &self.range }
5221    pub fn text(&self) -> &str { self.text.as_ref() }
5222}
5223
5224
5225pub struct SetSupportsTextParamsBuilder<'a> {
5226    style_sheet_id: crate::dom::StyleSheetId<'a>,
5227    range: SourceRange,
5228    text: Cow<'a, str>,
5229}
5230
5231impl<'a> SetSupportsTextParamsBuilder<'a> {
5232    pub fn build(self) -> SetSupportsTextParams<'a> {
5233        SetSupportsTextParams {
5234            style_sheet_id: self.style_sheet_id,
5235            range: self.range,
5236            text: self.text,
5237        }
5238    }
5239}
5240
5241/// Modifies the expression of a supports at-rule.
5242
5243#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5244#[serde(rename_all = "camelCase")]
5245pub struct SetSupportsTextReturns<'a> {
5246    /// The resulting CSS Supports rule after modification.
5247    supports: CSSSupports<'a>,
5248}
5249
5250impl<'a> SetSupportsTextReturns<'a> {
5251    /// Creates a builder for this type with the required parameters:
5252    /// * `supports`: The resulting CSS Supports rule after modification.
5253    pub fn builder(supports: CSSSupports<'a>) -> SetSupportsTextReturnsBuilder<'a> {
5254        SetSupportsTextReturnsBuilder {
5255            supports: supports,
5256        }
5257    }
5258    /// The resulting CSS Supports rule after modification.
5259    pub fn supports(&self) -> &CSSSupports<'a> { &self.supports }
5260}
5261
5262
5263pub struct SetSupportsTextReturnsBuilder<'a> {
5264    supports: CSSSupports<'a>,
5265}
5266
5267impl<'a> SetSupportsTextReturnsBuilder<'a> {
5268    pub fn build(self) -> SetSupportsTextReturns<'a> {
5269        SetSupportsTextReturns {
5270            supports: self.supports,
5271        }
5272    }
5273}
5274
5275impl<'a> SetSupportsTextParams<'a> { pub const METHOD: &'static str = "CSS.setSupportsText"; }
5276
5277impl<'a> crate::CdpCommand<'a> for SetSupportsTextParams<'a> {
5278    const METHOD: &'static str = "CSS.setSupportsText";
5279    type Response = SetSupportsTextReturns<'a>;
5280}
5281
5282/// Modifies the expression of a navigation at-rule.
5283
5284#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5285#[serde(rename_all = "camelCase")]
5286pub struct SetNavigationTextParams<'a> {
5287    #[serde(rename = "styleSheetId")]
5288    style_sheet_id: crate::dom::StyleSheetId<'a>,
5289    range: SourceRange,
5290    text: Cow<'a, str>,
5291}
5292
5293impl<'a> SetNavigationTextParams<'a> {
5294    /// Creates a builder for this type with the required parameters:
5295    /// * `style_sheet_id`: 
5296    /// * `range`: 
5297    /// * `text`: 
5298    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetNavigationTextParamsBuilder<'a> {
5299        SetNavigationTextParamsBuilder {
5300            style_sheet_id: style_sheet_id,
5301            range: range,
5302            text: text.into(),
5303        }
5304    }
5305    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5306    pub fn range(&self) -> &SourceRange { &self.range }
5307    pub fn text(&self) -> &str { self.text.as_ref() }
5308}
5309
5310
5311pub struct SetNavigationTextParamsBuilder<'a> {
5312    style_sheet_id: crate::dom::StyleSheetId<'a>,
5313    range: SourceRange,
5314    text: Cow<'a, str>,
5315}
5316
5317impl<'a> SetNavigationTextParamsBuilder<'a> {
5318    pub fn build(self) -> SetNavigationTextParams<'a> {
5319        SetNavigationTextParams {
5320            style_sheet_id: self.style_sheet_id,
5321            range: self.range,
5322            text: self.text,
5323        }
5324    }
5325}
5326
5327/// Modifies the expression of a navigation at-rule.
5328
5329#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5330#[serde(rename_all = "camelCase")]
5331pub struct SetNavigationTextReturns<'a> {
5332    /// The resulting CSS Navigation rule after modification.
5333    navigation: CSSNavigation<'a>,
5334}
5335
5336impl<'a> SetNavigationTextReturns<'a> {
5337    /// Creates a builder for this type with the required parameters:
5338    /// * `navigation`: The resulting CSS Navigation rule after modification.
5339    pub fn builder(navigation: CSSNavigation<'a>) -> SetNavigationTextReturnsBuilder<'a> {
5340        SetNavigationTextReturnsBuilder {
5341            navigation: navigation,
5342        }
5343    }
5344    /// The resulting CSS Navigation rule after modification.
5345    pub fn navigation(&self) -> &CSSNavigation<'a> { &self.navigation }
5346}
5347
5348
5349pub struct SetNavigationTextReturnsBuilder<'a> {
5350    navigation: CSSNavigation<'a>,
5351}
5352
5353impl<'a> SetNavigationTextReturnsBuilder<'a> {
5354    pub fn build(self) -> SetNavigationTextReturns<'a> {
5355        SetNavigationTextReturns {
5356            navigation: self.navigation,
5357        }
5358    }
5359}
5360
5361impl<'a> SetNavigationTextParams<'a> { pub const METHOD: &'static str = "CSS.setNavigationText"; }
5362
5363impl<'a> crate::CdpCommand<'a> for SetNavigationTextParams<'a> {
5364    const METHOD: &'static str = "CSS.setNavigationText";
5365    type Response = SetNavigationTextReturns<'a>;
5366}
5367
5368/// Modifies the expression of a scope at-rule.
5369
5370#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5371#[serde(rename_all = "camelCase")]
5372pub struct SetScopeTextParams<'a> {
5373    #[serde(rename = "styleSheetId")]
5374    style_sheet_id: crate::dom::StyleSheetId<'a>,
5375    range: SourceRange,
5376    text: Cow<'a, str>,
5377}
5378
5379impl<'a> SetScopeTextParams<'a> {
5380    /// Creates a builder for this type with the required parameters:
5381    /// * `style_sheet_id`: 
5382    /// * `range`: 
5383    /// * `text`: 
5384    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetScopeTextParamsBuilder<'a> {
5385        SetScopeTextParamsBuilder {
5386            style_sheet_id: style_sheet_id,
5387            range: range,
5388            text: text.into(),
5389        }
5390    }
5391    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5392    pub fn range(&self) -> &SourceRange { &self.range }
5393    pub fn text(&self) -> &str { self.text.as_ref() }
5394}
5395
5396
5397pub struct SetScopeTextParamsBuilder<'a> {
5398    style_sheet_id: crate::dom::StyleSheetId<'a>,
5399    range: SourceRange,
5400    text: Cow<'a, str>,
5401}
5402
5403impl<'a> SetScopeTextParamsBuilder<'a> {
5404    pub fn build(self) -> SetScopeTextParams<'a> {
5405        SetScopeTextParams {
5406            style_sheet_id: self.style_sheet_id,
5407            range: self.range,
5408            text: self.text,
5409        }
5410    }
5411}
5412
5413/// Modifies the expression of a scope at-rule.
5414
5415#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5416#[serde(rename_all = "camelCase")]
5417pub struct SetScopeTextReturns<'a> {
5418    /// The resulting CSS Scope rule after modification.
5419    scope: CSSScope<'a>,
5420}
5421
5422impl<'a> SetScopeTextReturns<'a> {
5423    /// Creates a builder for this type with the required parameters:
5424    /// * `scope`: The resulting CSS Scope rule after modification.
5425    pub fn builder(scope: CSSScope<'a>) -> SetScopeTextReturnsBuilder<'a> {
5426        SetScopeTextReturnsBuilder {
5427            scope: scope,
5428        }
5429    }
5430    /// The resulting CSS Scope rule after modification.
5431    pub fn scope(&self) -> &CSSScope<'a> { &self.scope }
5432}
5433
5434
5435pub struct SetScopeTextReturnsBuilder<'a> {
5436    scope: CSSScope<'a>,
5437}
5438
5439impl<'a> SetScopeTextReturnsBuilder<'a> {
5440    pub fn build(self) -> SetScopeTextReturns<'a> {
5441        SetScopeTextReturns {
5442            scope: self.scope,
5443        }
5444    }
5445}
5446
5447impl<'a> SetScopeTextParams<'a> { pub const METHOD: &'static str = "CSS.setScopeText"; }
5448
5449impl<'a> crate::CdpCommand<'a> for SetScopeTextParams<'a> {
5450    const METHOD: &'static str = "CSS.setScopeText";
5451    type Response = SetScopeTextReturns<'a>;
5452}
5453
5454/// Modifies the rule selector.
5455
5456#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5457#[serde(rename_all = "camelCase")]
5458pub struct SetRuleSelectorParams<'a> {
5459    #[serde(rename = "styleSheetId")]
5460    style_sheet_id: crate::dom::StyleSheetId<'a>,
5461    range: SourceRange,
5462    selector: Cow<'a, str>,
5463}
5464
5465impl<'a> SetRuleSelectorParams<'a> {
5466    /// Creates a builder for this type with the required parameters:
5467    /// * `style_sheet_id`: 
5468    /// * `range`: 
5469    /// * `selector`: 
5470    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, range: SourceRange, selector: impl Into<Cow<'a, str>>) -> SetRuleSelectorParamsBuilder<'a> {
5471        SetRuleSelectorParamsBuilder {
5472            style_sheet_id: style_sheet_id,
5473            range: range,
5474            selector: selector.into(),
5475        }
5476    }
5477    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5478    pub fn range(&self) -> &SourceRange { &self.range }
5479    pub fn selector(&self) -> &str { self.selector.as_ref() }
5480}
5481
5482
5483pub struct SetRuleSelectorParamsBuilder<'a> {
5484    style_sheet_id: crate::dom::StyleSheetId<'a>,
5485    range: SourceRange,
5486    selector: Cow<'a, str>,
5487}
5488
5489impl<'a> SetRuleSelectorParamsBuilder<'a> {
5490    pub fn build(self) -> SetRuleSelectorParams<'a> {
5491        SetRuleSelectorParams {
5492            style_sheet_id: self.style_sheet_id,
5493            range: self.range,
5494            selector: self.selector,
5495        }
5496    }
5497}
5498
5499/// Modifies the rule selector.
5500
5501#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5502#[serde(rename_all = "camelCase")]
5503pub struct SetRuleSelectorReturns<'a> {
5504    /// The resulting selector list after modification.
5505    #[serde(rename = "selectorList")]
5506    selector_list: SelectorList<'a>,
5507}
5508
5509impl<'a> SetRuleSelectorReturns<'a> {
5510    /// Creates a builder for this type with the required parameters:
5511    /// * `selector_list`: The resulting selector list after modification.
5512    pub fn builder(selector_list: SelectorList<'a>) -> SetRuleSelectorReturnsBuilder<'a> {
5513        SetRuleSelectorReturnsBuilder {
5514            selector_list: selector_list,
5515        }
5516    }
5517    /// The resulting selector list after modification.
5518    pub fn selector_list(&self) -> &SelectorList<'a> { &self.selector_list }
5519}
5520
5521
5522pub struct SetRuleSelectorReturnsBuilder<'a> {
5523    selector_list: SelectorList<'a>,
5524}
5525
5526impl<'a> SetRuleSelectorReturnsBuilder<'a> {
5527    pub fn build(self) -> SetRuleSelectorReturns<'a> {
5528        SetRuleSelectorReturns {
5529            selector_list: self.selector_list,
5530        }
5531    }
5532}
5533
5534impl<'a> SetRuleSelectorParams<'a> { pub const METHOD: &'static str = "CSS.setRuleSelector"; }
5535
5536impl<'a> crate::CdpCommand<'a> for SetRuleSelectorParams<'a> {
5537    const METHOD: &'static str = "CSS.setRuleSelector";
5538    type Response = SetRuleSelectorReturns<'a>;
5539}
5540
5541/// Sets the new stylesheet text.
5542
5543#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5544#[serde(rename_all = "camelCase")]
5545pub struct SetStyleSheetTextParams<'a> {
5546    #[serde(rename = "styleSheetId")]
5547    style_sheet_id: crate::dom::StyleSheetId<'a>,
5548    text: Cow<'a, str>,
5549}
5550
5551impl<'a> SetStyleSheetTextParams<'a> {
5552    /// Creates a builder for this type with the required parameters:
5553    /// * `style_sheet_id`: 
5554    /// * `text`: 
5555    pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>, text: impl Into<Cow<'a, str>>) -> SetStyleSheetTextParamsBuilder<'a> {
5556        SetStyleSheetTextParamsBuilder {
5557            style_sheet_id: style_sheet_id,
5558            text: text.into(),
5559        }
5560    }
5561    pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
5562    pub fn text(&self) -> &str { self.text.as_ref() }
5563}
5564
5565
5566pub struct SetStyleSheetTextParamsBuilder<'a> {
5567    style_sheet_id: crate::dom::StyleSheetId<'a>,
5568    text: Cow<'a, str>,
5569}
5570
5571impl<'a> SetStyleSheetTextParamsBuilder<'a> {
5572    pub fn build(self) -> SetStyleSheetTextParams<'a> {
5573        SetStyleSheetTextParams {
5574            style_sheet_id: self.style_sheet_id,
5575            text: self.text,
5576        }
5577    }
5578}
5579
5580/// Sets the new stylesheet text.
5581
5582#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5583#[serde(rename_all = "camelCase")]
5584pub struct SetStyleSheetTextReturns<'a> {
5585    /// URL of source map associated with script (if any).
5586    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceMapURL")]
5587    source_map_url: Option<Cow<'a, str>>,
5588}
5589
5590impl<'a> SetStyleSheetTextReturns<'a> {
5591    /// Creates a builder for this type.
5592    pub fn builder() -> SetStyleSheetTextReturnsBuilder<'a> {
5593        SetStyleSheetTextReturnsBuilder {
5594            source_map_url: None,
5595        }
5596    }
5597    /// URL of source map associated with script (if any).
5598    pub fn source_map_url(&self) -> Option<&str> { self.source_map_url.as_deref() }
5599}
5600
5601#[derive(Default)]
5602pub struct SetStyleSheetTextReturnsBuilder<'a> {
5603    source_map_url: Option<Cow<'a, str>>,
5604}
5605
5606impl<'a> SetStyleSheetTextReturnsBuilder<'a> {
5607    /// URL of source map associated with script (if any).
5608    pub fn source_map_url(mut self, source_map_url: impl Into<Cow<'a, str>>) -> Self { self.source_map_url = Some(source_map_url.into()); self }
5609    pub fn build(self) -> SetStyleSheetTextReturns<'a> {
5610        SetStyleSheetTextReturns {
5611            source_map_url: self.source_map_url,
5612        }
5613    }
5614}
5615
5616impl<'a> SetStyleSheetTextParams<'a> { pub const METHOD: &'static str = "CSS.setStyleSheetText"; }
5617
5618impl<'a> crate::CdpCommand<'a> for SetStyleSheetTextParams<'a> {
5619    const METHOD: &'static str = "CSS.setStyleSheetText";
5620    type Response = SetStyleSheetTextReturns<'a>;
5621}
5622
5623/// Applies specified style edits one after another in the given order.
5624
5625#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5626#[serde(rename_all = "camelCase")]
5627pub struct SetStyleTextsParams<'a> {
5628    edits: Vec<StyleDeclarationEdit<'a>>,
5629    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
5630    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
5631    /// incorrect results if the declaration contains a var() for example.
5632    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeForPropertySyntaxValidation")]
5633    node_for_property_syntax_validation: Option<crate::dom::NodeId>,
5634}
5635
5636impl<'a> SetStyleTextsParams<'a> {
5637    /// Creates a builder for this type with the required parameters:
5638    /// * `edits`: 
5639    pub fn builder(edits: Vec<StyleDeclarationEdit<'a>>) -> SetStyleTextsParamsBuilder<'a> {
5640        SetStyleTextsParamsBuilder {
5641            edits: edits,
5642            node_for_property_syntax_validation: None,
5643        }
5644    }
5645    pub fn edits(&self) -> &[StyleDeclarationEdit<'a>] { &self.edits }
5646    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
5647    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
5648    /// incorrect results if the declaration contains a var() for example.
5649    pub fn node_for_property_syntax_validation(&self) -> Option<&crate::dom::NodeId> { self.node_for_property_syntax_validation.as_ref() }
5650}
5651
5652
5653pub struct SetStyleTextsParamsBuilder<'a> {
5654    edits: Vec<StyleDeclarationEdit<'a>>,
5655    node_for_property_syntax_validation: Option<crate::dom::NodeId>,
5656}
5657
5658impl<'a> SetStyleTextsParamsBuilder<'a> {
5659    /// NodeId for the DOM node in whose context custom property declarations for registered properties should be
5660    /// validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
5661    /// incorrect results if the declaration contains a var() for example.
5662    pub fn node_for_property_syntax_validation(mut self, node_for_property_syntax_validation: crate::dom::NodeId) -> Self { self.node_for_property_syntax_validation = Some(node_for_property_syntax_validation); self }
5663    pub fn build(self) -> SetStyleTextsParams<'a> {
5664        SetStyleTextsParams {
5665            edits: self.edits,
5666            node_for_property_syntax_validation: self.node_for_property_syntax_validation,
5667        }
5668    }
5669}
5670
5671/// Applies specified style edits one after another in the given order.
5672
5673#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5674#[serde(rename_all = "camelCase")]
5675pub struct SetStyleTextsReturns<'a> {
5676    /// The resulting styles after modification.
5677    styles: Vec<CSSStyle<'a>>,
5678}
5679
5680impl<'a> SetStyleTextsReturns<'a> {
5681    /// Creates a builder for this type with the required parameters:
5682    /// * `styles`: The resulting styles after modification.
5683    pub fn builder(styles: Vec<CSSStyle<'a>>) -> SetStyleTextsReturnsBuilder<'a> {
5684        SetStyleTextsReturnsBuilder {
5685            styles: styles,
5686        }
5687    }
5688    /// The resulting styles after modification.
5689    pub fn styles(&self) -> &[CSSStyle<'a>] { &self.styles }
5690}
5691
5692
5693pub struct SetStyleTextsReturnsBuilder<'a> {
5694    styles: Vec<CSSStyle<'a>>,
5695}
5696
5697impl<'a> SetStyleTextsReturnsBuilder<'a> {
5698    pub fn build(self) -> SetStyleTextsReturns<'a> {
5699        SetStyleTextsReturns {
5700            styles: self.styles,
5701        }
5702    }
5703}
5704
5705impl<'a> SetStyleTextsParams<'a> { pub const METHOD: &'static str = "CSS.setStyleTexts"; }
5706
5707impl<'a> crate::CdpCommand<'a> for SetStyleTextsParams<'a> {
5708    const METHOD: &'static str = "CSS.setStyleTexts";
5709    type Response = SetStyleTextsReturns<'a>;
5710}
5711
5712#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5713pub struct StartRuleUsageTrackingParams {}
5714
5715impl StartRuleUsageTrackingParams { pub const METHOD: &'static str = "CSS.startRuleUsageTracking"; }
5716
5717impl<'a> crate::CdpCommand<'a> for StartRuleUsageTrackingParams {
5718    const METHOD: &'static str = "CSS.startRuleUsageTracking";
5719    type Response = crate::EmptyReturns;
5720}
5721
5722/// Stop tracking rule usage and return the list of rules that were used since last call to
5723/// 'takeCoverageDelta' (or since start of coverage instrumentation).
5724
5725#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5726#[serde(rename_all = "camelCase")]
5727pub struct StopRuleUsageTrackingReturns<'a> {
5728    #[serde(rename = "ruleUsage")]
5729    rule_usage: Vec<RuleUsage<'a>>,
5730}
5731
5732impl<'a> StopRuleUsageTrackingReturns<'a> {
5733    /// Creates a builder for this type with the required parameters:
5734    /// * `rule_usage`: 
5735    pub fn builder(rule_usage: Vec<RuleUsage<'a>>) -> StopRuleUsageTrackingReturnsBuilder<'a> {
5736        StopRuleUsageTrackingReturnsBuilder {
5737            rule_usage: rule_usage,
5738        }
5739    }
5740    pub fn rule_usage(&self) -> &[RuleUsage<'a>] { &self.rule_usage }
5741}
5742
5743
5744pub struct StopRuleUsageTrackingReturnsBuilder<'a> {
5745    rule_usage: Vec<RuleUsage<'a>>,
5746}
5747
5748impl<'a> StopRuleUsageTrackingReturnsBuilder<'a> {
5749    pub fn build(self) -> StopRuleUsageTrackingReturns<'a> {
5750        StopRuleUsageTrackingReturns {
5751            rule_usage: self.rule_usage,
5752        }
5753    }
5754}
5755
5756#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5757pub struct StopRuleUsageTrackingParams {}
5758
5759impl StopRuleUsageTrackingParams { pub const METHOD: &'static str = "CSS.stopRuleUsageTracking"; }
5760
5761impl<'a> crate::CdpCommand<'a> for StopRuleUsageTrackingParams {
5762    const METHOD: &'static str = "CSS.stopRuleUsageTracking";
5763    type Response = StopRuleUsageTrackingReturns<'a>;
5764}
5765
5766/// Obtain list of rules that became used since last call to this method (or since start of coverage
5767/// instrumentation).
5768
5769#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5770#[serde(rename_all = "camelCase")]
5771pub struct TakeCoverageDeltaReturns<'a> {
5772    coverage: Vec<RuleUsage<'a>>,
5773    /// Monotonically increasing time, in seconds.
5774    timestamp: f64,
5775}
5776
5777impl<'a> TakeCoverageDeltaReturns<'a> {
5778    /// Creates a builder for this type with the required parameters:
5779    /// * `coverage`: 
5780    /// * `timestamp`: Monotonically increasing time, in seconds.
5781    pub fn builder(coverage: Vec<RuleUsage<'a>>, timestamp: f64) -> TakeCoverageDeltaReturnsBuilder<'a> {
5782        TakeCoverageDeltaReturnsBuilder {
5783            coverage: coverage,
5784            timestamp: timestamp,
5785        }
5786    }
5787    pub fn coverage(&self) -> &[RuleUsage<'a>] { &self.coverage }
5788    /// Monotonically increasing time, in seconds.
5789    pub fn timestamp(&self) -> f64 { self.timestamp }
5790}
5791
5792
5793pub struct TakeCoverageDeltaReturnsBuilder<'a> {
5794    coverage: Vec<RuleUsage<'a>>,
5795    timestamp: f64,
5796}
5797
5798impl<'a> TakeCoverageDeltaReturnsBuilder<'a> {
5799    pub fn build(self) -> TakeCoverageDeltaReturns<'a> {
5800        TakeCoverageDeltaReturns {
5801            coverage: self.coverage,
5802            timestamp: self.timestamp,
5803        }
5804    }
5805}
5806
5807#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5808pub struct TakeCoverageDeltaParams {}
5809
5810impl TakeCoverageDeltaParams { pub const METHOD: &'static str = "CSS.takeCoverageDelta"; }
5811
5812impl<'a> crate::CdpCommand<'a> for TakeCoverageDeltaParams {
5813    const METHOD: &'static str = "CSS.takeCoverageDelta";
5814    type Response = TakeCoverageDeltaReturns<'a>;
5815}
5816
5817/// Enables/disables rendering of local CSS fonts (enabled by default).
5818
5819#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5820#[serde(rename_all = "camelCase")]
5821pub struct SetLocalFontsEnabledParams {
5822    /// Whether rendering of local fonts is enabled.
5823    enabled: bool,
5824}
5825
5826impl SetLocalFontsEnabledParams {
5827    /// Creates a builder for this type with the required parameters:
5828    /// * `enabled`: Whether rendering of local fonts is enabled.
5829    pub fn builder(enabled: bool) -> SetLocalFontsEnabledParamsBuilder {
5830        SetLocalFontsEnabledParamsBuilder {
5831            enabled: enabled,
5832        }
5833    }
5834    /// Whether rendering of local fonts is enabled.
5835    pub fn enabled(&self) -> bool { self.enabled }
5836}
5837
5838
5839pub struct SetLocalFontsEnabledParamsBuilder {
5840    enabled: bool,
5841}
5842
5843impl SetLocalFontsEnabledParamsBuilder {
5844    pub fn build(self) -> SetLocalFontsEnabledParams {
5845        SetLocalFontsEnabledParams {
5846            enabled: self.enabled,
5847        }
5848    }
5849}
5850
5851impl SetLocalFontsEnabledParams { pub const METHOD: &'static str = "CSS.setLocalFontsEnabled"; }
5852
5853impl<'a> crate::CdpCommand<'a> for SetLocalFontsEnabledParams {
5854    const METHOD: &'static str = "CSS.setLocalFontsEnabled";
5855    type Response = crate::EmptyReturns;
5856}