1use serde::{Serialize, Deserialize};
10use serde_json::Value as JsonValue;
11use std::borrow::Cow;
12
13#[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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
33#[serde(rename_all = "camelCase")]
34pub struct PseudoElementMatches<'a> {
35 #[serde(rename = "pseudoType")]
37 pseudo_type: crate::dom::PseudoType,
38 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
40 pseudo_identifier: Option<Cow<'a, str>>,
41 matches: Vec<RuleMatch<'a>>,
43}
44
45impl<'a> PseudoElementMatches<'a> {
46 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 pub fn pseudo_type(&self) -> &crate::dom::PseudoType { &self.pseudo_type }
58 pub fn pseudo_identifier(&self) -> Option<&str> { self.pseudo_identifier.as_deref() }
60 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
86#[serde(rename_all = "camelCase")]
87pub struct CSSAnimationStyle<'a> {
88 #[serde(skip_serializing_if = "Option::is_none")]
90 name: Option<Cow<'a, str>>,
91 style: CSSStyle<'a>,
93}
94
95impl<'a> CSSAnimationStyle<'a> {
96 pub fn builder(style: CSSStyle<'a>) -> CSSAnimationStyleBuilder<'a> {
99 CSSAnimationStyleBuilder {
100 name: None,
101 style: style,
102 }
103 }
104 pub fn name(&self) -> Option<&str> { self.name.as_deref() }
106 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
130#[serde(rename_all = "camelCase")]
131pub struct InheritedStyleEntry<'a> {
132 #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
134 inline_style: Option<CSSStyle<'a>>,
135 #[serde(rename = "matchedCSSRules")]
137 matched_css_rules: Vec<RuleMatch<'a>>,
138}
139
140impl<'a> InheritedStyleEntry<'a> {
141 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 pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
151 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
175#[serde(rename_all = "camelCase")]
176pub struct InheritedAnimatedStyleEntry<'a> {
177 #[serde(skip_serializing_if = "Option::is_none", rename = "animationStyles")]
179 animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
180 #[serde(skip_serializing_if = "Option::is_none", rename = "transitionsStyle")]
182 transitions_style: Option<CSSStyle<'a>>,
183}
184
185impl<'a> InheritedAnimatedStyleEntry<'a> {
186 pub fn builder() -> InheritedAnimatedStyleEntryBuilder<'a> {
188 InheritedAnimatedStyleEntryBuilder {
189 animation_styles: None,
190 transitions_style: None,
191 }
192 }
193 pub fn animation_styles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animation_styles.as_deref() }
195 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 pub fn animation_styles(mut self, animation_styles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animation_styles = Some(animation_styles); self }
208 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
221#[serde(rename_all = "camelCase")]
222pub struct InheritedPseudoElementMatches<'a> {
223 #[serde(rename = "pseudoElements")]
225 pseudo_elements: Vec<PseudoElementMatches<'a>>,
226}
227
228impl<'a> InheritedPseudoElementMatches<'a> {
229 pub fn builder(pseudo_elements: Vec<PseudoElementMatches<'a>>) -> InheritedPseudoElementMatchesBuilder<'a> {
232 InheritedPseudoElementMatchesBuilder {
233 pseudo_elements: pseudo_elements,
234 }
235 }
236 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
256#[serde(rename_all = "camelCase")]
257pub struct RuleMatch<'a> {
258 rule: CSSRule<'a>,
260 #[serde(rename = "matchingSelectors")]
262 matching_selectors: Vec<i64>,
263}
264
265impl<'a> RuleMatch<'a> {
266 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 pub fn rule(&self) -> &CSSRule<'a> { &self.rule }
277 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
299#[serde(rename_all = "camelCase")]
300pub struct ProtocolValue<'a> {
301 text: Cow<'a, str>,
303 #[serde(skip_serializing_if = "Option::is_none")]
305 range: Option<SourceRange>,
306 #[serde(skip_serializing_if = "Option::is_none")]
308 specificity: Option<Specificity>,
309}
310
311impl<'a> ProtocolValue<'a> {
312 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 pub fn text(&self) -> &str { self.text.as_ref() }
323 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
325 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
339 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
354#[serde(rename_all = "camelCase")]
355pub struct Specificity {
356 a: i64,
358 b: i64,
361 c: i64,
363}
364
365impl Specificity {
366 pub fn builder(a: i64, b: i64, c: i64) -> SpecificityBuilder {
371 SpecificityBuilder {
372 a: a,
373 b: b,
374 c: c,
375 }
376 }
377 pub fn a(&self) -> i64 { self.a }
379 pub fn b(&self) -> i64 { self.b }
382 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
406#[serde(rename_all = "camelCase")]
407pub struct SelectorList<'a> {
408 selectors: Vec<ProtocolValue<'a>>,
410 text: Cow<'a, str>,
412}
413
414impl<'a> SelectorList<'a> {
415 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 pub fn selectors(&self) -> &[ProtocolValue<'a>] { &self.selectors }
426 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
448#[serde(rename_all = "camelCase")]
449pub struct CSSStyleSheetHeader<'a> {
450 #[serde(rename = "styleSheetId")]
452 style_sheet_id: crate::dom::StyleSheetId<'a>,
453 #[serde(rename = "frameId")]
455 frame_id: crate::page::FrameId<'a>,
456 #[serde(rename = "sourceURL")]
460 source_url: Cow<'a, str>,
461 #[serde(skip_serializing_if = "Option::is_none", rename = "sourceMapURL")]
463 source_map_url: Option<Cow<'a, str>>,
464 origin: StyleSheetOrigin,
466 title: Cow<'a, str>,
468 #[serde(skip_serializing_if = "Option::is_none", rename = "ownerNode")]
470 owner_node: Option<crate::dom::BackendNodeId>,
471 disabled: bool,
473 #[serde(skip_serializing_if = "Option::is_none", rename = "hasSourceURL")]
475 has_source_url: Option<bool>,
476 #[serde(rename = "isInline")]
479 is_inline: bool,
480 #[serde(rename = "isMutable")]
485 is_mutable: bool,
486 #[serde(rename = "isConstructed")]
489 is_constructed: bool,
490 #[serde(rename = "startLine")]
492 start_line: f64,
493 #[serde(rename = "startColumn")]
495 start_column: f64,
496 length: f64,
498 #[serde(rename = "endLine")]
500 end_line: f64,
501 #[serde(rename = "endColumn")]
503 end_column: f64,
504 #[serde(skip_serializing_if = "Option::is_none", rename = "loadingFailed")]
506 loading_failed: Option<bool>,
507}
508
509impl<'a> CSSStyleSheetHeader<'a> {
510 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 pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
549 pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
551 pub fn source_url(&self) -> &str { self.source_url.as_ref() }
555 pub fn source_map_url(&self) -> Option<&str> { self.source_map_url.as_deref() }
557 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
559 pub fn title(&self) -> &str { self.title.as_ref() }
561 pub fn owner_node(&self) -> Option<&crate::dom::BackendNodeId> { self.owner_node.as_ref() }
563 pub fn disabled(&self) -> bool { self.disabled }
565 pub fn has_source_url(&self) -> Option<bool> { self.has_source_url }
567 pub fn is_inline(&self) -> bool { self.is_inline }
570 pub fn is_mutable(&self) -> bool { self.is_mutable }
575 pub fn is_constructed(&self) -> bool { self.is_constructed }
578 pub fn start_line(&self) -> f64 { self.start_line }
580 pub fn start_column(&self) -> f64 { self.start_column }
582 pub fn length(&self) -> f64 { self.length }
584 pub fn end_line(&self) -> f64 { self.end_line }
586 pub fn end_column(&self) -> f64 { self.end_column }
588 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 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 pub fn owner_node(mut self, owner_node: crate::dom::BackendNodeId) -> Self { self.owner_node = Some(owner_node); self }
619 pub fn has_source_url(mut self, has_source_url: bool) -> Self { self.has_source_url = Some(has_source_url); self }
621 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
650#[serde(rename_all = "camelCase")]
651pub struct CSSRule<'a> {
652 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
655 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
656 #[serde(rename = "selectorList")]
658 selector_list: SelectorList<'a>,
659 #[serde(skip_serializing_if = "Option::is_none", rename = "nestingSelectors")]
661 nesting_selectors: Option<Vec<Cow<'a, str>>>,
662 origin: StyleSheetOrigin,
664 style: CSSStyle<'a>,
666 #[serde(skip_serializing_if = "Option::is_none", rename = "originTreeScopeNodeId")]
668 origin_tree_scope_node_id: Option<crate::dom::BackendNodeId>,
669 #[serde(skip_serializing_if = "Option::is_none")]
672 media: Option<Vec<CSSMedia<'a>>>,
673 #[serde(skip_serializing_if = "Option::is_none", rename = "containerQueries")]
676 container_queries: Option<Vec<CSSContainerQuery<'a>>>,
677 #[serde(skip_serializing_if = "Option::is_none")]
680 supports: Option<Vec<CSSSupports<'a>>>,
681 #[serde(skip_serializing_if = "Option::is_none")]
684 layers: Option<Vec<CSSLayer<'a>>>,
685 #[serde(skip_serializing_if = "Option::is_none")]
688 scopes: Option<Vec<CSSScope<'a>>>,
689 #[serde(skip_serializing_if = "Option::is_none", rename = "ruleTypes")]
691 rule_types: Option<Vec<CSSRuleType>>,
692 #[serde(skip_serializing_if = "Option::is_none", rename = "startingStyles")]
695 starting_styles: Option<Vec<CSSStartingStyle<'a>>>,
696 #[serde(skip_serializing_if = "Option::is_none")]
699 navigations: Option<Vec<CSSNavigation<'a>>>,
700}
701
702impl<'a> CSSRule<'a> {
703 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 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
728 pub fn selector_list(&self) -> &SelectorList<'a> { &self.selector_list }
730 pub fn nesting_selectors(&self) -> Option<&[Cow<'a, str>]> { self.nesting_selectors.as_deref() }
732 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
734 pub fn style(&self) -> &CSSStyle<'a> { &self.style }
736 pub fn origin_tree_scope_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.origin_tree_scope_node_id.as_ref() }
738 pub fn media(&self) -> Option<&[CSSMedia<'a>]> { self.media.as_deref() }
741 pub fn container_queries(&self) -> Option<&[CSSContainerQuery<'a>]> { self.container_queries.as_deref() }
744 pub fn supports(&self) -> Option<&[CSSSupports<'a>]> { self.supports.as_deref() }
747 pub fn layers(&self) -> Option<&[CSSLayer<'a>]> { self.layers.as_deref() }
750 pub fn scopes(&self) -> Option<&[CSSScope<'a>]> { self.scopes.as_deref() }
753 pub fn rule_types(&self) -> Option<&[CSSRuleType]> { self.rule_types.as_deref() }
755 pub fn starting_styles(&self) -> Option<&[CSSStartingStyle<'a>]> { self.starting_styles.as_deref() }
758 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 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 pub fn nesting_selectors(mut self, nesting_selectors: Vec<Cow<'a, str>>) -> Self { self.nesting_selectors = Some(nesting_selectors); self }
787 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 pub fn media(mut self, media: Vec<CSSMedia<'a>>) -> Self { self.media = Some(media); self }
792 pub fn container_queries(mut self, container_queries: Vec<CSSContainerQuery<'a>>) -> Self { self.container_queries = Some(container_queries); self }
795 pub fn supports(mut self, supports: Vec<CSSSupports<'a>>) -> Self { self.supports = Some(supports); self }
798 pub fn layers(mut self, layers: Vec<CSSLayer<'a>>) -> Self { self.layers = Some(layers); self }
801 pub fn scopes(mut self, scopes: Vec<CSSScope<'a>>) -> Self { self.scopes = Some(scopes); self }
804 pub fn rule_types(mut self, rule_types: Vec<CSSRuleType>) -> Self { self.rule_types = Some(rule_types); self }
806 pub fn starting_styles(mut self, starting_styles: Vec<CSSStartingStyle<'a>>) -> Self { self.starting_styles = Some(starting_styles); self }
809 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#[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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
859#[serde(rename_all = "camelCase")]
860pub struct RuleUsage<'a> {
861 #[serde(rename = "styleSheetId")]
864 style_sheet_id: crate::dom::StyleSheetId<'a>,
865 #[serde(rename = "startOffset")]
867 start_offset: f64,
868 #[serde(rename = "endOffset")]
870 end_offset: f64,
871 used: bool,
873}
874
875impl<'a> RuleUsage<'a> {
876 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 pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
892 pub fn start_offset(&self) -> f64 { self.start_offset }
894 pub fn end_offset(&self) -> f64 { self.end_offset }
896 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
922#[serde(rename_all = "camelCase")]
923pub struct SourceRange {
924 #[serde(rename = "startLine")]
926 start_line: i64,
927 #[serde(rename = "startColumn")]
929 start_column: i64,
930 #[serde(rename = "endLine")]
932 end_line: i64,
933 #[serde(rename = "endColumn")]
935 end_column: i64,
936}
937
938impl SourceRange {
939 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 pub fn start_line(&self) -> i64 { self.start_line }
954 pub fn start_column(&self) -> i64 { self.start_column }
956 pub fn end_line(&self) -> i64 { self.end_line }
958 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 name: Cow<'a, str>,
987 value: Cow<'a, str>,
989 #[serde(skip_serializing_if = "Option::is_none")]
991 important: Option<bool>,
992}
993
994impl<'a> ShorthandEntry<'a> {
995 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 pub fn name(&self) -> &str { self.name.as_ref() }
1007 pub fn value(&self) -> &str { self.value.as_ref() }
1009 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 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 name: Cow<'a, str>,
1038 value: Cow<'a, str>,
1040}
1041
1042impl<'a> CSSComputedStyleProperty<'a> {
1043 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 pub fn name(&self) -> &str { self.name.as_ref() }
1054 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 #[serde(rename = "isAppearanceBase")]
1081 is_appearance_base: bool,
1082}
1083
1084impl ComputedStyleExtraFields {
1085 pub fn builder(is_appearance_base: bool) -> ComputedStyleExtraFieldsBuilder {
1088 ComputedStyleExtraFieldsBuilder {
1089 is_appearance_base: is_appearance_base,
1090 }
1091 }
1092 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1114#[serde(rename_all = "camelCase")]
1115pub struct CSSStyle<'a> {
1116 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1119 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1120 #[serde(rename = "cssProperties")]
1122 css_properties: Vec<CSSProperty<'a>>,
1123 #[serde(rename = "shorthandEntries")]
1125 shorthand_entries: Vec<ShorthandEntry<'a>>,
1126 #[serde(skip_serializing_if = "Option::is_none", rename = "cssText")]
1128 css_text: Option<Cow<'a, str>>,
1129 #[serde(skip_serializing_if = "Option::is_none")]
1131 range: Option<SourceRange>,
1132}
1133
1134impl<'a> CSSStyle<'a> {
1135 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 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1150 pub fn css_properties(&self) -> &[CSSProperty<'a>] { &self.css_properties }
1152 pub fn shorthand_entries(&self) -> &[ShorthandEntry<'a>] { &self.shorthand_entries }
1154 pub fn css_text(&self) -> Option<&str> { self.css_text.as_deref() }
1156 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 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 pub fn css_text(mut self, css_text: impl Into<Cow<'a, str>>) -> Self { self.css_text = Some(css_text.into()); self }
1175 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1191#[serde(rename_all = "camelCase")]
1192pub struct CSSProperty<'a> {
1193 name: Cow<'a, str>,
1195 value: Cow<'a, str>,
1197 #[serde(skip_serializing_if = "Option::is_none")]
1199 important: Option<bool>,
1200 #[serde(skip_serializing_if = "Option::is_none")]
1202 implicit: Option<bool>,
1203 #[serde(skip_serializing_if = "Option::is_none")]
1205 text: Option<Cow<'a, str>>,
1206 #[serde(skip_serializing_if = "Option::is_none", rename = "parsedOk")]
1208 parsed_ok: Option<bool>,
1209 #[serde(skip_serializing_if = "Option::is_none")]
1211 disabled: Option<bool>,
1212 #[serde(skip_serializing_if = "Option::is_none")]
1214 range: Option<SourceRange>,
1215 #[serde(skip_serializing_if = "Option::is_none", rename = "longhandProperties")]
1218 longhand_properties: Option<Vec<Box<CSSProperty<'a>>>>,
1219}
1220
1221impl<'a> CSSProperty<'a> {
1222 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 pub fn name(&self) -> &str { self.name.as_ref() }
1240 pub fn value(&self) -> &str { self.value.as_ref() }
1242 pub fn important(&self) -> Option<bool> { self.important }
1244 pub fn implicit(&self) -> Option<bool> { self.implicit }
1246 pub fn text(&self) -> Option<&str> { self.text.as_deref() }
1248 pub fn parsed_ok(&self) -> Option<bool> { self.parsed_ok }
1250 pub fn disabled(&self) -> Option<bool> { self.disabled }
1252 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1254 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 pub fn important(mut self, important: bool) -> Self { self.important = Some(important); self }
1275 pub fn implicit(mut self, implicit: bool) -> Self { self.implicit = Some(implicit); self }
1277 pub fn text(mut self, text: impl Into<Cow<'a, str>>) -> Self { self.text = Some(text.into()); self }
1279 pub fn parsed_ok(mut self, parsed_ok: bool) -> Self { self.parsed_ok = Some(parsed_ok); self }
1281 pub fn disabled(mut self, disabled: bool) -> Self { self.disabled = Some(disabled); self }
1283 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1285 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1306#[serde(rename_all = "camelCase")]
1307pub struct CSSMedia<'a> {
1308 text: Cow<'a, str>,
1310 source: Cow<'a, str>,
1315 #[serde(skip_serializing_if = "Option::is_none", rename = "sourceURL")]
1317 source_url: Option<Cow<'a, str>>,
1318 #[serde(skip_serializing_if = "Option::is_none")]
1321 range: Option<SourceRange>,
1322 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1324 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1325 #[serde(skip_serializing_if = "Option::is_none", rename = "mediaList")]
1327 media_list: Option<Vec<MediaQuery<'a>>>,
1328}
1329
1330impl<'a> CSSMedia<'a> {
1331 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 pub fn text(&self) -> &str { self.text.as_ref() }
1346 pub fn source(&self) -> &str { self.source.as_ref() }
1351 pub fn source_url(&self) -> Option<&str> { self.source_url.as_deref() }
1353 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1356 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1358 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 pub fn source_url(mut self, source_url: impl Into<Cow<'a, str>>) -> Self { self.source_url = Some(source_url.into()); self }
1375 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1378 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1397#[serde(rename_all = "camelCase")]
1398pub struct MediaQuery<'a> {
1399 expressions: Vec<MediaQueryExpression<'a>>,
1401 active: bool,
1403}
1404
1405impl<'a> MediaQuery<'a> {
1406 pub fn builder(expressions: Vec<MediaQueryExpression<'a>>, active: bool) -> MediaQueryBuilder<'a> {
1410 MediaQueryBuilder {
1411 expressions: expressions,
1412 active: active,
1413 }
1414 }
1415 pub fn expressions(&self) -> &[MediaQueryExpression<'a>] { &self.expressions }
1417 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1439#[serde(rename_all = "camelCase")]
1440pub struct MediaQueryExpression<'a> {
1441 value: f64,
1443 unit: Cow<'a, str>,
1445 feature: Cow<'a, str>,
1447 #[serde(skip_serializing_if = "Option::is_none", rename = "valueRange")]
1449 value_range: Option<SourceRange>,
1450 #[serde(skip_serializing_if = "Option::is_none", rename = "computedLength")]
1452 computed_length: Option<f64>,
1453}
1454
1455impl<'a> MediaQueryExpression<'a> {
1456 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 pub fn value(&self) -> f64 { self.value }
1471 pub fn unit(&self) -> &str { self.unit.as_ref() }
1473 pub fn feature(&self) -> &str { self.feature.as_ref() }
1475 pub fn value_range(&self) -> Option<&SourceRange> { self.value_range.as_ref() }
1477 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 pub fn value_range(mut self, value_range: SourceRange) -> Self { self.value_range = Some(value_range); self }
1493 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1509#[serde(rename_all = "camelCase")]
1510pub struct CSSContainerQuery<'a> {
1511 text: Cow<'a, str>,
1516 #[serde(skip_serializing_if = "Option::is_none")]
1519 range: Option<SourceRange>,
1520 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
1522 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
1523 #[serde(skip_serializing_if = "Option::is_none")]
1525 name: Option<Cow<'a, str>>,
1526 #[serde(skip_serializing_if = "Option::is_none", rename = "physicalAxes")]
1528 physical_axes: Option<crate::dom::PhysicalAxes>,
1529 #[serde(skip_serializing_if = "Option::is_none", rename = "logicalAxes")]
1531 logical_axes: Option<crate::dom::LogicalAxes>,
1532 #[serde(skip_serializing_if = "Option::is_none", rename = "queriesScrollState")]
1534 queries_scroll_state: Option<bool>,
1535 #[serde(skip_serializing_if = "Option::is_none", rename = "queriesAnchored")]
1537 queries_anchored: Option<bool>,
1538 #[serde(rename = "conditionText")]
1540 condition_text: Cow<'a, str>,
1541}
1542
1543impl<'a> CSSContainerQuery<'a> {
1544 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 pub fn text(&self) -> &str { self.text.as_ref() }
1565 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1568 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
1570 pub fn name(&self) -> Option<&str> { self.name.as_deref() }
1572 pub fn physical_axes(&self) -> Option<&crate::dom::PhysicalAxes> { self.physical_axes.as_ref() }
1574 pub fn logical_axes(&self) -> Option<&crate::dom::LogicalAxes> { self.logical_axes.as_ref() }
1576 pub fn queries_scroll_state(&self) -> Option<bool> { self.queries_scroll_state }
1578 pub fn queries_anchored(&self) -> Option<bool> { self.queries_anchored }
1580 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1601 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 pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
1605 pub fn physical_axes(mut self, physical_axes: crate::dom::PhysicalAxes) -> Self { self.physical_axes = Some(physical_axes); self }
1607 pub fn logical_axes(mut self, logical_axes: crate::dom::LogicalAxes) -> Self { self.logical_axes = Some(logical_axes); self }
1609 pub fn queries_scroll_state(mut self, queries_scroll_state: bool) -> Self { self.queries_scroll_state = Some(queries_scroll_state); self }
1611 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1631#[serde(rename_all = "camelCase")]
1632pub struct CSSSupports<'a> {
1633 text: Cow<'a, str>,
1635 active: bool,
1637 #[serde(skip_serializing_if = "Option::is_none")]
1640 range: Option<SourceRange>,
1641 #[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 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 pub fn text(&self) -> &str { self.text.as_ref() }
1660 pub fn active(&self) -> bool { self.active }
1662 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1665 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1681 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1696#[serde(rename_all = "camelCase")]
1697pub struct CSSNavigation<'a> {
1698 text: Cow<'a, str>,
1700 #[serde(skip_serializing_if = "Option::is_none")]
1702 active: Option<bool>,
1703 #[serde(skip_serializing_if = "Option::is_none")]
1706 range: Option<SourceRange>,
1707 #[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 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 pub fn text(&self) -> &str { self.text.as_ref() }
1725 pub fn active(&self) -> Option<bool> { self.active }
1727 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1730 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 pub fn active(mut self, active: bool) -> Self { self.active = Some(active); self }
1745 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1748 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1763#[serde(rename_all = "camelCase")]
1764pub struct CSSScope<'a> {
1765 text: Cow<'a, str>,
1767 #[serde(skip_serializing_if = "Option::is_none")]
1770 range: Option<SourceRange>,
1771 #[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 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 pub fn text(&self) -> &str { self.text.as_ref() }
1788 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1791 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1806 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1820#[serde(rename_all = "camelCase")]
1821pub struct CSSLayer<'a> {
1822 text: Cow<'a, str>,
1824 #[serde(skip_serializing_if = "Option::is_none")]
1827 range: Option<SourceRange>,
1828 #[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 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 pub fn text(&self) -> &str { self.text.as_ref() }
1845 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1848 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1863 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1877#[serde(rename_all = "camelCase")]
1878pub struct CSSStartingStyle<'a> {
1879 #[serde(skip_serializing_if = "Option::is_none")]
1882 range: Option<SourceRange>,
1883 #[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 pub fn builder() -> CSSStartingStyleBuilder<'a> {
1891 CSSStartingStyleBuilder {
1892 range: None,
1893 style_sheet_id: None,
1894 }
1895 }
1896 pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
1899 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 pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
1913 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1926#[serde(rename_all = "camelCase")]
1927pub struct CSSLayerData<'a> {
1928 name: Cow<'a, str>,
1930 #[serde(skip_serializing_if = "Option::is_none", rename = "subLayers")]
1932 sub_layers: Option<Vec<Box<CSSLayerData<'a>>>>,
1933 order: f64,
1936}
1937
1938impl<'a> CSSLayerData<'a> {
1939 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 pub fn name(&self) -> &str { self.name.as_ref() }
1951 pub fn sub_layers(&self) -> Option<&[Box<CSSLayerData<'a>>]> { self.sub_layers.as_deref() }
1953 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1980#[serde(rename_all = "camelCase")]
1981pub struct PlatformFontUsage<'a> {
1982 #[serde(rename = "familyName")]
1984 family_name: Cow<'a, str>,
1985 #[serde(rename = "postScriptName")]
1987 post_script_name: Cow<'a, str>,
1988 #[serde(rename = "isCustomFont")]
1990 is_custom_font: bool,
1991 #[serde(rename = "glyphCount")]
1993 glyph_count: f64,
1994}
1995
1996impl<'a> PlatformFontUsage<'a> {
1997 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 pub fn family_name(&self) -> &str { self.family_name.as_ref() }
2012 pub fn post_script_name(&self) -> &str { self.post_script_name.as_ref() }
2014 pub fn is_custom_font(&self) -> bool { self.is_custom_font }
2016 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2042#[serde(rename_all = "camelCase")]
2043pub struct FontVariationAxis<'a> {
2044 tag: Cow<'a, str>,
2046 name: Cow<'a, str>,
2048 #[serde(rename = "minValue")]
2050 min_value: f64,
2051 #[serde(rename = "maxValue")]
2053 max_value: f64,
2054 #[serde(rename = "defaultValue")]
2056 default_value: f64,
2057}
2058
2059impl<'a> FontVariationAxis<'a> {
2060 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 pub fn tag(&self) -> &str { self.tag.as_ref() }
2077 pub fn name(&self) -> &str { self.name.as_ref() }
2079 pub fn min_value(&self) -> f64 { self.min_value }
2081 pub fn max_value(&self) -> f64 { self.max_value }
2083 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2112#[serde(rename_all = "camelCase")]
2113pub struct FontFace<'a> {
2114 #[serde(rename = "fontFamily")]
2116 font_family: Cow<'a, str>,
2117 #[serde(rename = "fontStyle")]
2119 font_style: Cow<'a, str>,
2120 #[serde(rename = "fontVariant")]
2122 font_variant: Cow<'a, str>,
2123 #[serde(rename = "fontWeight")]
2125 font_weight: Cow<'a, str>,
2126 #[serde(rename = "fontStretch")]
2128 font_stretch: Cow<'a, str>,
2129 #[serde(rename = "fontDisplay")]
2131 font_display: Cow<'a, str>,
2132 #[serde(rename = "unicodeRange")]
2134 unicode_range: Cow<'a, str>,
2135 src: Cow<'a, str>,
2137 #[serde(rename = "platformFontFamily")]
2139 platform_font_family: Cow<'a, str>,
2140 #[serde(skip_serializing_if = "Option::is_none", rename = "fontVariationAxes")]
2142 font_variation_axes: Option<Vec<FontVariationAxis<'a>>>,
2143}
2144
2145impl<'a> FontFace<'a> {
2146 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 pub fn font_family(&self) -> &str { self.font_family.as_ref() }
2172 pub fn font_style(&self) -> &str { self.font_style.as_ref() }
2174 pub fn font_variant(&self) -> &str { self.font_variant.as_ref() }
2176 pub fn font_weight(&self) -> &str { self.font_weight.as_ref() }
2178 pub fn font_stretch(&self) -> &str { self.font_stretch.as_ref() }
2180 pub fn font_display(&self) -> &str { self.font_display.as_ref() }
2182 pub fn unicode_range(&self) -> &str { self.unicode_range.as_ref() }
2184 pub fn src(&self) -> &str { self.src.as_ref() }
2186 pub fn platform_font_family(&self) -> &str { self.platform_font_family.as_ref() }
2188 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2228#[serde(rename_all = "camelCase")]
2229pub struct CSSTryRule<'a> {
2230 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2233 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2234 origin: StyleSheetOrigin,
2236 style: CSSStyle<'a>,
2238}
2239
2240impl<'a> CSSTryRule<'a> {
2241 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 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2254 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2256 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2283#[serde(rename_all = "camelCase")]
2284pub struct CSSPositionTryRule<'a> {
2285 name: ProtocolValue<'a>,
2287 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2290 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2291 origin: StyleSheetOrigin,
2293 style: CSSStyle<'a>,
2295 active: bool,
2296}
2297
2298impl<'a> CSSPositionTryRule<'a> {
2299 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 pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
2315 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2318 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2320 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2352#[serde(rename_all = "camelCase")]
2353pub struct CSSKeyframesRule<'a> {
2354 #[serde(rename = "animationName")]
2356 animation_name: ProtocolValue<'a>,
2357 keyframes: Vec<CSSKeyframeRule<'a>>,
2359}
2360
2361impl<'a> CSSKeyframesRule<'a> {
2362 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 pub fn animation_name(&self) -> &ProtocolValue<'a> { &self.animation_name }
2373 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2447#[serde(rename_all = "camelCase")]
2448pub struct CSSAtRule<'a> {
2449 #[serde(rename = "type")]
2451 type_: Cow<'a, str>,
2452 #[serde(skip_serializing_if = "Option::is_none")]
2454 subsection: Option<Cow<'a, str>>,
2455 #[serde(skip_serializing_if = "Option::is_none")]
2458 name: Option<ProtocolValue<'a>>,
2459 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2462 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2463 origin: StyleSheetOrigin,
2465 style: CSSStyle<'a>,
2467}
2468
2469impl<'a> CSSAtRule<'a> {
2470 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 pub fn type_(&self) -> &str { self.type_.as_ref() }
2486 pub fn subsection(&self) -> Option<&str> { self.subsection.as_deref() }
2488 pub fn name(&self) -> Option<&ProtocolValue<'a>> { self.name.as_ref() }
2491 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2494 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2496 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 pub fn subsection(mut self, subsection: impl Into<Cow<'a, str>>) -> Self { self.subsection = Some(subsection.into()); self }
2513 pub fn name(mut self, name: ProtocolValue<'a>) -> Self { self.name = Some(name); self }
2516 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2534#[serde(rename_all = "camelCase")]
2535pub struct CSSPropertyRule<'a> {
2536 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2539 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2540 origin: StyleSheetOrigin,
2542 #[serde(rename = "propertyName")]
2544 property_name: ProtocolValue<'a>,
2545 style: CSSStyle<'a>,
2547}
2548
2549impl<'a> CSSPropertyRule<'a> {
2550 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 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2565 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2567 pub fn property_name(&self) -> &ProtocolValue<'a> { &self.property_name }
2569 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2598#[serde(rename_all = "camelCase")]
2599pub struct CSSFunctionParameter<'a> {
2600 name: Cow<'a, str>,
2602 #[serde(rename = "type")]
2604 type_: Cow<'a, str>,
2605}
2606
2607impl<'a> CSSFunctionParameter<'a> {
2608 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 pub fn name(&self) -> &str { self.name.as_ref() }
2619 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2641#[serde(rename_all = "camelCase")]
2642pub struct CSSFunctionConditionNode<'a> {
2643 #[serde(skip_serializing_if = "Option::is_none")]
2645 media: Option<CSSMedia<'a>>,
2646 #[serde(skip_serializing_if = "Option::is_none", rename = "containerQueries")]
2648 container_queries: Option<CSSContainerQuery<'a>>,
2649 #[serde(skip_serializing_if = "Option::is_none")]
2651 supports: Option<CSSSupports<'a>>,
2652 #[serde(skip_serializing_if = "Option::is_none")]
2654 navigation: Option<CSSNavigation<'a>>,
2655 children: Vec<CSSFunctionNode<'a>>,
2657 #[serde(rename = "conditionText")]
2659 condition_text: Cow<'a, str>,
2660}
2661
2662impl<'a> CSSFunctionConditionNode<'a> {
2663 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 pub fn media(&self) -> Option<&CSSMedia<'a>> { self.media.as_ref() }
2678 pub fn container_queries(&self) -> Option<&CSSContainerQuery<'a>> { self.container_queries.as_ref() }
2680 pub fn supports(&self) -> Option<&CSSSupports<'a>> { self.supports.as_ref() }
2682 pub fn navigation(&self) -> Option<&CSSNavigation<'a>> { self.navigation.as_ref() }
2684 pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
2686 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 pub fn media(mut self, media: CSSMedia<'a>) -> Self { self.media = Some(media); self }
2703 pub fn container_queries(mut self, container_queries: CSSContainerQuery<'a>) -> Self { self.container_queries = Some(container_queries); self }
2705 pub fn supports(mut self, supports: CSSSupports<'a>) -> Self { self.supports = Some(supports); self }
2707 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2724#[serde(rename_all = "camelCase")]
2725pub struct CSSFunctionNode<'a> {
2726 #[serde(skip_serializing_if = "Option::is_none")]
2728 condition: Option<CSSFunctionConditionNode<'a>>,
2729 #[serde(skip_serializing_if = "Option::is_none")]
2731 style: Option<CSSStyle<'a>>,
2732}
2733
2734impl<'a> CSSFunctionNode<'a> {
2735 pub fn builder() -> CSSFunctionNodeBuilder<'a> {
2737 CSSFunctionNodeBuilder {
2738 condition: None,
2739 style: None,
2740 }
2741 }
2742 pub fn condition(&self) -> Option<&CSSFunctionConditionNode<'a>> { self.condition.as_ref() }
2744 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 pub fn condition(mut self, condition: CSSFunctionConditionNode<'a>) -> Self { self.condition = Some(condition); self }
2757 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2770#[serde(rename_all = "camelCase")]
2771pub struct CSSFunctionRule<'a> {
2772 name: ProtocolValue<'a>,
2774 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2777 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2778 origin: StyleSheetOrigin,
2780 parameters: Vec<CSSFunctionParameter<'a>>,
2782 children: Vec<CSSFunctionNode<'a>>,
2784 #[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 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 pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
2807 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2810 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2812 pub fn parameters(&self) -> &[CSSFunctionParameter<'a>] { &self.parameters }
2814 pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
2816 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 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2851#[serde(rename_all = "camelCase")]
2852pub struct CSSKeyframeRule<'a> {
2853 #[serde(skip_serializing_if = "Option::is_none", rename = "styleSheetId")]
2856 style_sheet_id: Option<crate::dom::StyleSheetId<'a>>,
2857 origin: StyleSheetOrigin,
2859 #[serde(rename = "keyText")]
2861 key_text: ProtocolValue<'a>,
2862 style: CSSStyle<'a>,
2864}
2865
2866impl<'a> CSSKeyframeRule<'a> {
2867 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 pub fn style_sheet_id(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.style_sheet_id.as_ref() }
2882 pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
2884 pub fn key_text(&self) -> &ProtocolValue<'a> { &self.key_text }
2886 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2915#[serde(rename_all = "camelCase")]
2916pub struct StyleDeclarationEdit<'a> {
2917 #[serde(rename = "styleSheetId")]
2919 style_sheet_id: crate::dom::StyleSheetId<'a>,
2920 range: SourceRange,
2922 text: Cow<'a, str>,
2924}
2925
2926impl<'a> StyleDeclarationEdit<'a> {
2927 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 pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
2940 pub fn range(&self) -> &SourceRange { &self.range }
2942 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2967#[serde(rename_all = "camelCase")]
2968pub struct AddRuleParams<'a> {
2969 #[serde(rename = "styleSheetId")]
2971 style_sheet_id: crate::dom::StyleSheetId<'a>,
2972 #[serde(rename = "ruleText")]
2974 rule_text: Cow<'a, str>,
2975 location: SourceRange,
2977 #[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 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 pub fn style_sheet_id(&self) -> &crate::dom::StyleSheetId<'a> { &self.style_sheet_id }
2999 pub fn rule_text(&self) -> &str { self.rule_text.as_ref() }
3001 pub fn location(&self) -> &SourceRange { &self.location }
3003 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3036#[serde(rename_all = "camelCase")]
3037pub struct AddRuleReturns<'a> {
3038 rule: CSSRule<'a>,
3040}
3041
3042impl<'a> AddRuleReturns<'a> {
3043 pub fn builder(rule: CSSRule<'a>) -> AddRuleReturnsBuilder<'a> {
3046 AddRuleReturnsBuilder {
3047 rule: rule,
3048 }
3049 }
3050 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3110#[serde(rename_all = "camelCase")]
3111pub struct CollectClassNamesReturns<'a> {
3112 #[serde(rename = "classNames")]
3114 class_names: Vec<Cow<'a, str>>,
3115}
3116
3117impl<'a> CollectClassNamesReturns<'a> {
3118 pub fn builder(class_names: Vec<Cow<'a, str>>) -> CollectClassNamesReturnsBuilder<'a> {
3121 CollectClassNamesReturnsBuilder {
3122 class_names: class_names,
3123 }
3124 }
3125 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3152#[serde(rename_all = "camelCase")]
3153pub struct CreateStyleSheetParams<'a> {
3154 #[serde(rename = "frameId")]
3156 frame_id: crate::page::FrameId<'a>,
3157 #[serde(skip_serializing_if = "Option::is_none")]
3162 force: Option<bool>,
3163}
3164
3165impl<'a> CreateStyleSheetParams<'a> {
3166 pub fn builder(frame_id: crate::page::FrameId<'a>) -> CreateStyleSheetParamsBuilder<'a> {
3169 CreateStyleSheetParamsBuilder {
3170 frame_id: frame_id,
3171 force: None,
3172 }
3173 }
3174 pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
3176 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3206#[serde(rename_all = "camelCase")]
3207pub struct CreateStyleSheetReturns<'a> {
3208 #[serde(rename = "styleSheetId")]
3210 style_sheet_id: crate::dom::StyleSheetId<'a>,
3211}
3212
3213impl<'a> CreateStyleSheetReturns<'a> {
3214 pub fn builder(style_sheet_id: crate::dom::StyleSheetId<'a>) -> CreateStyleSheetReturnsBuilder<'a> {
3217 CreateStyleSheetReturnsBuilder {
3218 style_sheet_id: style_sheet_id,
3219 }
3220 }
3221 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3269#[serde(rename_all = "camelCase")]
3270pub struct ForcePseudoStateParams<'a> {
3271 #[serde(rename = "nodeId")]
3273 node_id: crate::dom::NodeId,
3274 #[serde(rename = "forcedPseudoClasses")]
3276 forced_pseudo_classes: Vec<Cow<'a, str>>,
3277}
3278
3279impl<'a> ForcePseudoStateParams<'a> {
3280 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 pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3291 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3320#[serde(rename_all = "camelCase")]
3321pub struct ForceStartingStyleParams {
3322 #[serde(rename = "nodeId")]
3324 node_id: crate::dom::NodeId,
3325 forced: bool,
3327}
3328
3329impl ForceStartingStyleParams {
3330 pub fn builder(node_id: crate::dom::NodeId, forced: bool) -> ForceStartingStyleParamsBuilder {
3334 ForceStartingStyleParamsBuilder {
3335 node_id: node_id,
3336 forced: forced,
3337 }
3338 }
3339 pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3341 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 #[serde(rename = "nodeId")]
3373 node_id: crate::dom::NodeId,
3374}
3375
3376impl GetBackgroundColorsParams {
3377 pub fn builder(node_id: crate::dom::NodeId) -> GetBackgroundColorsParamsBuilder {
3380 GetBackgroundColorsParamsBuilder {
3381 node_id: node_id,
3382 }
3383 }
3384 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 #[serde(skip_serializing_if = "Option::is_none", rename = "backgroundColors")]
3411 background_colors: Option<Vec<Cow<'a, str>>>,
3412 #[serde(skip_serializing_if = "Option::is_none", rename = "computedFontSize")]
3414 computed_font_size: Option<Cow<'a, str>>,
3415 #[serde(skip_serializing_if = "Option::is_none", rename = "computedFontWeight")]
3418 computed_font_weight: Option<Cow<'a, str>>,
3419}
3420
3421impl<'a> GetBackgroundColorsReturns<'a> {
3422 pub fn builder() -> GetBackgroundColorsReturnsBuilder<'a> {
3424 GetBackgroundColorsReturnsBuilder {
3425 background_colors: None,
3426 computed_font_size: None,
3427 computed_font_weight: None,
3428 }
3429 }
3430 pub fn background_colors(&self) -> Option<&[Cow<'a, str>]> { self.background_colors.as_deref() }
3436 pub fn computed_font_size(&self) -> Option<&str> { self.computed_font_size.as_deref() }
3438 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 pub fn background_colors(mut self, background_colors: Vec<Cow<'a, str>>) -> Self { self.background_colors = Some(background_colors); self }
3457 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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3514#[serde(rename_all = "camelCase")]
3515pub struct GetComputedStyleForNodeReturns<'a> {
3516 #[serde(rename = "computedStyle")]
3518 computed_style: Vec<CSSComputedStyleProperty<'a>>,
3519 #[serde(rename = "extraFields")]
3522 extra_fields: ComputedStyleExtraFields,
3523}
3524
3525impl<'a> GetComputedStyleForNodeReturns<'a> {
3526 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 pub fn computed_style(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computed_style }
3537 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3577#[serde(rename_all = "camelCase")]
3578pub struct ResolveValuesParams<'a> {
3579 values: Vec<Cow<'a, str>>,
3581 #[serde(rename = "nodeId")]
3583 node_id: crate::dom::NodeId,
3584 #[serde(skip_serializing_if = "Option::is_none", rename = "propertyName")]
3586 property_name: Option<Cow<'a, str>>,
3587 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
3590 pseudo_type: Option<crate::dom::PseudoType>,
3591 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
3593 pseudo_identifier: Option<Cow<'a, str>>,
3594}
3595
3596impl<'a> ResolveValuesParams<'a> {
3597 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 pub fn values(&self) -> &[Cow<'a, str>] { &self.values }
3611 pub fn node_id(&self) -> &crate::dom::NodeId { &self.node_id }
3613 pub fn property_name(&self) -> Option<&str> { self.property_name.as_deref() }
3615 pub fn pseudo_type(&self) -> Option<&crate::dom::PseudoType> { self.pseudo_type.as_ref() }
3618 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 pub fn property_name(mut self, property_name: impl Into<Cow<'a, str>>) -> Self { self.property_name = Some(property_name.into()); self }
3634 pub fn pseudo_type(mut self, pseudo_type: crate::dom::PseudoType) -> Self { self.pseudo_type = Some(pseudo_type); self }
3637 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#[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 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 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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3814#[serde(rename_all = "camelCase")]
3815pub struct GetInlineStylesForNodeReturns<'a> {
3816 #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
3818 inline_style: Option<CSSStyle<'a>>,
3819 #[serde(skip_serializing_if = "Option::is_none", rename = "attributesStyle")]
3821 attributes_style: Option<CSSStyle<'a>>,
3822}
3823
3824impl<'a> GetInlineStylesForNodeReturns<'a> {
3825 pub fn builder() -> GetInlineStylesForNodeReturnsBuilder<'a> {
3827 GetInlineStylesForNodeReturnsBuilder {
3828 inline_style: None,
3829 attributes_style: None,
3830 }
3831 }
3832 pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
3834 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 pub fn inline_style(mut self, inline_style: CSSStyle<'a>) -> Self { self.inline_style = Some(inline_style); self }
3847 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3902#[serde(rename_all = "camelCase")]
3903pub struct GetAnimatedStylesForNodeReturns<'a> {
3904 #[serde(skip_serializing_if = "Option::is_none", rename = "animationStyles")]
3906 animation_styles: Option<Vec<CSSAnimationStyle<'a>>>,
3907 #[serde(skip_serializing_if = "Option::is_none", rename = "transitionsStyle")]
3909 transitions_style: Option<CSSStyle<'a>>,
3910 #[serde(skip_serializing_if = "Option::is_none")]
3913 inherited: Option<Vec<InheritedAnimatedStyleEntry<'a>>>,
3914}
3915
3916impl<'a> GetAnimatedStylesForNodeReturns<'a> {
3917 pub fn builder() -> GetAnimatedStylesForNodeReturnsBuilder<'a> {
3919 GetAnimatedStylesForNodeReturnsBuilder {
3920 animation_styles: None,
3921 transitions_style: None,
3922 inherited: None,
3923 }
3924 }
3925 pub fn animation_styles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animation_styles.as_deref() }
3927 pub fn transitions_style(&self) -> Option<&CSSStyle<'a>> { self.transitions_style.as_ref() }
3929 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 pub fn animation_styles(mut self, animation_styles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animation_styles = Some(animation_styles); self }
3944 pub fn transitions_style(mut self, transitions_style: CSSStyle<'a>) -> Self { self.transitions_style = Some(transitions_style); self }
3946 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4001#[serde(rename_all = "camelCase")]
4002pub struct GetMatchedStylesForNodeReturns<'a> {
4003 #[serde(skip_serializing_if = "Option::is_none", rename = "inlineStyle")]
4005 inline_style: Option<CSSStyle<'a>>,
4006 #[serde(skip_serializing_if = "Option::is_none", rename = "attributesStyle")]
4008 attributes_style: Option<CSSStyle<'a>>,
4009 #[serde(skip_serializing_if = "Option::is_none", rename = "matchedCSSRules")]
4011 matched_css_rules: Option<Vec<RuleMatch<'a>>>,
4012 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoElements")]
4014 pseudo_elements: Option<Vec<PseudoElementMatches<'a>>>,
4015 #[serde(skip_serializing_if = "Option::is_none")]
4017 inherited: Option<Vec<InheritedStyleEntry<'a>>>,
4018 #[serde(skip_serializing_if = "Option::is_none", rename = "inheritedPseudoElements")]
4020 inherited_pseudo_elements: Option<Vec<InheritedPseudoElementMatches<'a>>>,
4021 #[serde(skip_serializing_if = "Option::is_none", rename = "cssKeyframesRules")]
4023 css_keyframes_rules: Option<Vec<CSSKeyframesRule<'a>>>,
4024 #[serde(skip_serializing_if = "Option::is_none", rename = "cssPositionTryRules")]
4026 css_position_try_rules: Option<Vec<CSSPositionTryRule<'a>>>,
4027 #[serde(skip_serializing_if = "Option::is_none", rename = "activePositionFallbackIndex")]
4030 active_position_fallback_index: Option<u64>,
4031 #[serde(skip_serializing_if = "Option::is_none", rename = "cssPropertyRules")]
4033 css_property_rules: Option<Vec<CSSPropertyRule<'a>>>,
4034 #[serde(skip_serializing_if = "Option::is_none", rename = "cssPropertyRegistrations")]
4036 css_property_registrations: Option<Vec<CSSPropertyRegistration<'a>>>,
4037 #[serde(skip_serializing_if = "Option::is_none", rename = "cssAtRules")]
4039 css_at_rules: Option<Vec<CSSAtRule<'a>>>,
4040 #[serde(skip_serializing_if = "Option::is_none", rename = "parentLayoutNodeId")]
4042 parent_layout_node_id: Option<crate::dom::NodeId>,
4043 #[serde(skip_serializing_if = "Option::is_none", rename = "cssFunctionRules")]
4045 css_function_rules: Option<Vec<CSSFunctionRule<'a>>>,
4046}
4047
4048impl<'a> GetMatchedStylesForNodeReturns<'a> {
4049 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 pub fn inline_style(&self) -> Option<&CSSStyle<'a>> { self.inline_style.as_ref() }
4070 pub fn attributes_style(&self) -> Option<&CSSStyle<'a>> { self.attributes_style.as_ref() }
4072 pub fn matched_css_rules(&self) -> Option<&[RuleMatch<'a>]> { self.matched_css_rules.as_deref() }
4074 pub fn pseudo_elements(&self) -> Option<&[PseudoElementMatches<'a>]> { self.pseudo_elements.as_deref() }
4076 pub fn inherited(&self) -> Option<&[InheritedStyleEntry<'a>]> { self.inherited.as_deref() }
4078 pub fn inherited_pseudo_elements(&self) -> Option<&[InheritedPseudoElementMatches<'a>]> { self.inherited_pseudo_elements.as_deref() }
4080 pub fn css_keyframes_rules(&self) -> Option<&[CSSKeyframesRule<'a>]> { self.css_keyframes_rules.as_deref() }
4082 pub fn css_position_try_rules(&self) -> Option<&[CSSPositionTryRule<'a>]> { self.css_position_try_rules.as_deref() }
4084 pub fn active_position_fallback_index(&self) -> Option<u64> { self.active_position_fallback_index }
4087 pub fn css_property_rules(&self) -> Option<&[CSSPropertyRule<'a>]> { self.css_property_rules.as_deref() }
4089 pub fn css_property_registrations(&self) -> Option<&[CSSPropertyRegistration<'a>]> { self.css_property_registrations.as_deref() }
4091 pub fn css_at_rules(&self) -> Option<&[CSSAtRule<'a>]> { self.css_at_rules.as_deref() }
4093 pub fn parent_layout_node_id(&self) -> Option<&crate::dom::NodeId> { self.parent_layout_node_id.as_ref() }
4095 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 pub fn inline_style(mut self, inline_style: CSSStyle<'a>) -> Self { self.inline_style = Some(inline_style); self }
4120 pub fn attributes_style(mut self, attributes_style: CSSStyle<'a>) -> Self { self.attributes_style = Some(attributes_style); self }
4122 pub fn matched_css_rules(mut self, matched_css_rules: Vec<RuleMatch<'a>>) -> Self { self.matched_css_rules = Some(matched_css_rules); self }
4124 pub fn pseudo_elements(mut self, pseudo_elements: Vec<PseudoElementMatches<'a>>) -> Self { self.pseudo_elements = Some(pseudo_elements); self }
4126 pub fn inherited(mut self, inherited: Vec<InheritedStyleEntry<'a>>) -> Self { self.inherited = Some(inherited); self }
4128 pub fn inherited_pseudo_elements(mut self, inherited_pseudo_elements: Vec<InheritedPseudoElementMatches<'a>>) -> Self { self.inherited_pseudo_elements = Some(inherited_pseudo_elements); self }
4130 pub fn css_keyframes_rules(mut self, css_keyframes_rules: Vec<CSSKeyframesRule<'a>>) -> Self { self.css_keyframes_rules = Some(css_keyframes_rules); self }
4132 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 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 pub fn css_property_rules(mut self, css_property_rules: Vec<CSSPropertyRule<'a>>) -> Self { self.css_property_rules = Some(css_property_rules); self }
4139 pub fn css_property_registrations(mut self, css_property_registrations: Vec<CSSPropertyRegistration<'a>>) -> Self { self.css_property_registrations = Some(css_property_registrations); self }
4141 pub fn css_at_rules(mut self, css_at_rules: Vec<CSSAtRule<'a>>) -> Self { self.css_at_rules = Some(css_at_rules); self }
4143 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 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#[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 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#[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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4297#[serde(rename_all = "camelCase")]
4298pub struct GetPlatformFontsForNodeReturns<'a> {
4299 fonts: Vec<PlatformFontUsage<'a>>,
4301}
4302
4303impl<'a> GetPlatformFontsForNodeReturns<'a> {
4304 pub fn builder(fonts: Vec<PlatformFontUsage<'a>>) -> GetPlatformFontsForNodeReturnsBuilder<'a> {
4307 GetPlatformFontsForNodeReturnsBuilder {
4308 fonts: fonts,
4309 }
4310 }
4311 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4371#[serde(rename_all = "camelCase")]
4372pub struct GetStyleSheetTextReturns<'a> {
4373 text: Cow<'a, str>,
4375}
4376
4377impl<'a> GetStyleSheetTextReturns<'a> {
4378 pub fn builder(text: impl Into<Cow<'a, str>>) -> GetStyleSheetTextReturnsBuilder<'a> {
4381 GetStyleSheetTextReturnsBuilder {
4382 text: text.into(),
4383 }
4384 }
4385 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#[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 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#[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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4533#[serde(rename_all = "camelCase")]
4534pub struct GetLocationForSelectorReturns {
4535 ranges: Vec<SourceRange>,
4536}
4537
4538impl GetLocationForSelectorReturns {
4539 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#[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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4662#[serde(rename_all = "camelCase")]
4663pub struct TakeComputedStyleUpdatesReturns {
4664 #[serde(rename = "nodeIds")]
4666 node_ids: Vec<crate::dom::NodeId>,
4667}
4668
4669impl TakeComputedStyleUpdatesReturns {
4670 pub fn builder(node_ids: Vec<crate::dom::NodeId>) -> TakeComputedStyleUpdatesReturnsBuilder {
4673 TakeComputedStyleUpdatesReturnsBuilder {
4674 node_ids: node_ids,
4675 }
4676 }
4677 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4708#[serde(rename_all = "camelCase")]
4709pub struct SetEffectivePropertyValueForNodeParams<'a> {
4710 #[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 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 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4809#[serde(rename_all = "camelCase")]
4810pub struct SetPropertyRulePropertyNameReturns<'a> {
4811 #[serde(rename = "propertyName")]
4813 property_name: ProtocolValue<'a>,
4814}
4815
4816impl<'a> SetPropertyRulePropertyNameReturns<'a> {
4817 pub fn builder(property_name: ProtocolValue<'a>) -> SetPropertyRulePropertyNameReturnsBuilder<'a> {
4820 SetPropertyRulePropertyNameReturnsBuilder {
4821 property_name: property_name,
4822 }
4823 }
4824 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4897#[serde(rename_all = "camelCase")]
4898pub struct SetKeyframeKeyReturns<'a> {
4899 #[serde(rename = "keyText")]
4901 key_text: ProtocolValue<'a>,
4902}
4903
4904impl<'a> SetKeyframeKeyReturns<'a> {
4905 pub fn builder(key_text: ProtocolValue<'a>) -> SetKeyframeKeyReturnsBuilder<'a> {
4908 SetKeyframeKeyReturnsBuilder {
4909 key_text: key_text,
4910 }
4911 }
4912 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4984#[serde(rename_all = "camelCase")]
4985pub struct SetMediaTextReturns<'a> {
4986 media: CSSMedia<'a>,
4988}
4989
4990impl<'a> SetMediaTextReturns<'a> {
4991 pub fn builder(media: CSSMedia<'a>) -> SetMediaTextReturnsBuilder<'a> {
4994 SetMediaTextReturnsBuilder {
4995 media: media,
4996 }
4997 }
4998 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5072#[serde(rename_all = "camelCase")]
5073pub struct SetContainerQueryTextReturns<'a> {
5074 #[serde(rename = "containerQuery")]
5076 container_query: CSSContainerQuery<'a>,
5077}
5078
5079impl<'a> SetContainerQueryTextReturns<'a> {
5080 pub fn builder(container_query: CSSContainerQuery<'a>) -> SetContainerQueryTextReturnsBuilder<'a> {
5083 SetContainerQueryTextReturnsBuilder {
5084 container_query: container_query,
5085 }
5086 }
5087 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 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 #[serde(rename = "containerQuery")]
5161 container_query: CSSContainerQuery<'a>,
5162}
5163
5164impl<'a> SetContainerQueryConditionTextReturns<'a> {
5165 pub fn builder(container_query: CSSContainerQuery<'a>) -> SetContainerQueryConditionTextReturnsBuilder<'a> {
5168 SetContainerQueryConditionTextReturnsBuilder {
5169 container_query: container_query,
5170 }
5171 }
5172 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5244#[serde(rename_all = "camelCase")]
5245pub struct SetSupportsTextReturns<'a> {
5246 supports: CSSSupports<'a>,
5248}
5249
5250impl<'a> SetSupportsTextReturns<'a> {
5251 pub fn builder(supports: CSSSupports<'a>) -> SetSupportsTextReturnsBuilder<'a> {
5254 SetSupportsTextReturnsBuilder {
5255 supports: supports,
5256 }
5257 }
5258 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5330#[serde(rename_all = "camelCase")]
5331pub struct SetNavigationTextReturns<'a> {
5332 navigation: CSSNavigation<'a>,
5334}
5335
5336impl<'a> SetNavigationTextReturns<'a> {
5337 pub fn builder(navigation: CSSNavigation<'a>) -> SetNavigationTextReturnsBuilder<'a> {
5340 SetNavigationTextReturnsBuilder {
5341 navigation: navigation,
5342 }
5343 }
5344 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5416#[serde(rename_all = "camelCase")]
5417pub struct SetScopeTextReturns<'a> {
5418 scope: CSSScope<'a>,
5420}
5421
5422impl<'a> SetScopeTextReturns<'a> {
5423 pub fn builder(scope: CSSScope<'a>) -> SetScopeTextReturnsBuilder<'a> {
5426 SetScopeTextReturnsBuilder {
5427 scope: scope,
5428 }
5429 }
5430 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5502#[serde(rename_all = "camelCase")]
5503pub struct SetRuleSelectorReturns<'a> {
5504 #[serde(rename = "selectorList")]
5506 selector_list: SelectorList<'a>,
5507}
5508
5509impl<'a> SetRuleSelectorReturns<'a> {
5510 pub fn builder(selector_list: SelectorList<'a>) -> SetRuleSelectorReturnsBuilder<'a> {
5513 SetRuleSelectorReturnsBuilder {
5514 selector_list: selector_list,
5515 }
5516 }
5517 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5583#[serde(rename_all = "camelCase")]
5584pub struct SetStyleSheetTextReturns<'a> {
5585 #[serde(skip_serializing_if = "Option::is_none", rename = "sourceMapURL")]
5587 source_map_url: Option<Cow<'a, str>>,
5588}
5589
5590impl<'a> SetStyleSheetTextReturns<'a> {
5591 pub fn builder() -> SetStyleSheetTextReturnsBuilder<'a> {
5593 SetStyleSheetTextReturnsBuilder {
5594 source_map_url: None,
5595 }
5596 }
5597 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5626#[serde(rename_all = "camelCase")]
5627pub struct SetStyleTextsParams<'a> {
5628 edits: Vec<StyleDeclarationEdit<'a>>,
5629 #[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 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 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5674#[serde(rename_all = "camelCase")]
5675pub struct SetStyleTextsReturns<'a> {
5676 styles: Vec<CSSStyle<'a>>,
5678}
5679
5680impl<'a> SetStyleTextsReturns<'a> {
5681 pub fn builder(styles: Vec<CSSStyle<'a>>) -> SetStyleTextsReturnsBuilder<'a> {
5684 SetStyleTextsReturnsBuilder {
5685 styles: styles,
5686 }
5687 }
5688 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#[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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5770#[serde(rename_all = "camelCase")]
5771pub struct TakeCoverageDeltaReturns<'a> {
5772 coverage: Vec<RuleUsage<'a>>,
5773 timestamp: f64,
5775}
5776
5777impl<'a> TakeCoverageDeltaReturns<'a> {
5778 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 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#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5820#[serde(rename_all = "camelCase")]
5821pub struct SetLocalFontsEnabledParams {
5822 enabled: bool,
5824}
5825
5826impl SetLocalFontsEnabledParams {
5827 pub fn builder(enabled: bool) -> SetLocalFontsEnabledParamsBuilder {
5830 SetLocalFontsEnabledParamsBuilder {
5831 enabled: enabled,
5832 }
5833 }
5834 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}