pub struct CSSClient { /* private fields */ }Expand description
Client for CSS domain commands.
Implementations§
Source§impl CSSClient
impl CSSClient
Sourcepub async fn add_rule(
&self,
params: AddRuleParams,
session_id: Option<&str>,
) -> Result<AddRuleReturns, CdpError>
pub async fn add_rule( &self, params: AddRuleParams, session_id: Option<&str>, ) -> Result<AddRuleReturns, CdpError>
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the
position specified by location.
Sourcepub async fn collect_class_names(
&self,
params: CollectClassNamesParams,
session_id: Option<&str>,
) -> Result<CollectClassNamesReturns, CdpError>
pub async fn collect_class_names( &self, params: CollectClassNamesParams, session_id: Option<&str>, ) -> Result<CollectClassNamesReturns, CdpError>
Returns all class names from specified stylesheet.
Sourcepub async fn create_style_sheet(
&self,
params: CreateStyleSheetParams,
session_id: Option<&str>,
) -> Result<CreateStyleSheetReturns, CdpError>
pub async fn create_style_sheet( &self, params: CreateStyleSheetParams, session_id: Option<&str>, ) -> Result<CreateStyleSheetReturns, CdpError>
Creates a new special “via-inspector” stylesheet in the frame with given frameId.
Sourcepub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Disables the CSS agent for the given page.
Sourcepub async fn enable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn enable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.
Sourcepub async fn force_pseudo_state(
&self,
params: ForcePseudoStateParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn force_pseudo_state( &self, params: ForcePseudoStateParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
Sourcepub async fn force_starting_style(
&self,
params: ForceStartingStyleParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn force_starting_style( &self, params: ForceStartingStyleParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Ensures that the given node is in its starting-style state.
pub async fn get_background_colors( &self, params: GetBackgroundColorsParams, session_id: Option<&str>, ) -> Result<GetBackgroundColorsReturns, CdpError>
Sourcepub async fn get_computed_style_for_node(
&self,
params: GetComputedStyleForNodeParams,
session_id: Option<&str>,
) -> Result<GetComputedStyleForNodeReturns, CdpError>
pub async fn get_computed_style_for_node( &self, params: GetComputedStyleForNodeParams, session_id: Option<&str>, ) -> Result<GetComputedStyleForNodeReturns, CdpError>
Returns the computed style for a DOM node identified by nodeId.
Sourcepub async fn resolve_values(
&self,
params: ResolveValuesParams,
session_id: Option<&str>,
) -> Result<ResolveValuesReturns, CdpError>
pub async fn resolve_values( &self, params: ResolveValuesParams, session_id: Option<&str>, ) -> Result<ResolveValuesReturns, CdpError>
Resolve the specified values in the context of the provided element.
For example, a value of ‘1em’ is evaluated according to the computed
‘font-size’ of the element and a value ‘calc(1px + 2px)’ will be
resolved to ‘3px’.
If the propertyName was specified the values are resolved as if
they were property’s declaration. If a value cannot be parsed according
to the provided property syntax, the value is parsed using combined
syntax as if null propertyName was provided. If the value cannot be
resolved even then, return the provided value without any changes.
pub async fn get_longhand_properties( &self, params: GetLonghandPropertiesParams, session_id: Option<&str>, ) -> Result<GetLonghandPropertiesReturns, CdpError>
Sourcepub async fn get_inline_styles_for_node(
&self,
params: GetInlineStylesForNodeParams,
session_id: Option<&str>,
) -> Result<GetInlineStylesForNodeReturns, CdpError>
pub async fn get_inline_styles_for_node( &self, params: GetInlineStylesForNodeParams, session_id: Option<&str>, ) -> Result<GetInlineStylesForNodeReturns, CdpError>
Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM
attributes) for a DOM node identified by nodeId.
Sourcepub async fn get_animated_styles_for_node(
&self,
params: GetAnimatedStylesForNodeParams,
session_id: Option<&str>,
) -> Result<GetAnimatedStylesForNodeReturns, CdpError>
pub async fn get_animated_styles_for_node( &self, params: GetAnimatedStylesForNodeParams, session_id: Option<&str>, ) -> Result<GetAnimatedStylesForNodeReturns, CdpError>
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
Sourcepub async fn get_matched_styles_for_node(
&self,
params: GetMatchedStylesForNodeParams,
session_id: Option<&str>,
) -> Result<GetMatchedStylesForNodeReturns, CdpError>
pub async fn get_matched_styles_for_node( &self, params: GetMatchedStylesForNodeParams, session_id: Option<&str>, ) -> Result<GetMatchedStylesForNodeReturns, CdpError>
Returns requested styles for a DOM node identified by nodeId.
Sourcepub async fn get_environment_variables(
&self,
session_id: Option<&str>,
) -> Result<GetEnvironmentVariablesReturns, CdpError>
pub async fn get_environment_variables( &self, session_id: Option<&str>, ) -> Result<GetEnvironmentVariablesReturns, CdpError>
Returns the values of the default UA-defined environment variables used in env()
Sourcepub async fn get_media_queries(
&self,
session_id: Option<&str>,
) -> Result<GetMediaQueriesReturns, CdpError>
pub async fn get_media_queries( &self, session_id: Option<&str>, ) -> Result<GetMediaQueriesReturns, CdpError>
Returns all media queries parsed by the rendering engine.
Sourcepub async fn get_platform_fonts_for_node(
&self,
params: GetPlatformFontsForNodeParams,
session_id: Option<&str>,
) -> Result<GetPlatformFontsForNodeReturns, CdpError>
pub async fn get_platform_fonts_for_node( &self, params: GetPlatformFontsForNodeParams, session_id: Option<&str>, ) -> Result<GetPlatformFontsForNodeReturns, CdpError>
Requests information about platform fonts which we used to render child TextNodes in the given node.
Sourcepub async fn get_style_sheet_text(
&self,
params: GetStyleSheetTextParams,
session_id: Option<&str>,
) -> Result<GetStyleSheetTextReturns, CdpError>
pub async fn get_style_sheet_text( &self, params: GetStyleSheetTextParams, session_id: Option<&str>, ) -> Result<GetStyleSheetTextReturns, CdpError>
Returns the current textual content for a stylesheet.
Sourcepub async fn get_layers_for_node(
&self,
params: GetLayersForNodeParams,
session_id: Option<&str>,
) -> Result<GetLayersForNodeReturns, CdpError>
pub async fn get_layers_for_node( &self, params: GetLayersForNodeParams, session_id: Option<&str>, ) -> Result<GetLayersForNodeReturns, CdpError>
Returns all layers parsed by the rendering engine for the tree scope of a node. Given a DOM element identified by nodeId, getLayersForNode returns the root layer for the nearest ancestor document or shadow root. The layer root contains the full layer tree for the tree scope and their ordering.
Sourcepub async fn get_location_for_selector(
&self,
params: GetLocationForSelectorParams,
session_id: Option<&str>,
) -> Result<GetLocationForSelectorReturns, CdpError>
pub async fn get_location_for_selector( &self, params: GetLocationForSelectorParams, session_id: Option<&str>, ) -> Result<GetLocationForSelectorReturns, CdpError>
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.
Sourcepub async fn track_computed_style_updates_for_node(
&self,
params: TrackComputedStyleUpdatesForNodeParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn track_computed_style_updates_for_node( &self, params: TrackComputedStyleUpdatesForNodeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Starts tracking the given node for the computed style updates
and whenever the computed style is updated for node, it queues
a computedStyleUpdated event with throttling.
There can only be 1 node tracked for computed style updates
so passing a new node id removes tracking from the previous node.
Pass undefined to disable tracking.
Sourcepub async fn track_computed_style_updates(
&self,
params: TrackComputedStyleUpdatesParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn track_computed_style_updates( &self, params: TrackComputedStyleUpdatesParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Starts tracking the given computed styles for updates. The specified array of properties replaces the one previously specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. The changes to computed style properties are only tracked for nodes pushed to the front-end by the DOM agent. If no changes to the tracked properties occur after the node has been pushed to the front-end, no updates will be issued for the node.
Sourcepub async fn take_computed_style_updates(
&self,
session_id: Option<&str>,
) -> Result<TakeComputedStyleUpdatesReturns, CdpError>
pub async fn take_computed_style_updates( &self, session_id: Option<&str>, ) -> Result<TakeComputedStyleUpdatesReturns, CdpError>
Polls the next batch of computed style updates.
Sourcepub async fn set_effective_property_value_for_node(
&self,
params: SetEffectivePropertyValueForNodeParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_effective_property_value_for_node( &self, params: SetEffectivePropertyValueForNodeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Find a rule with the given active property for the given node and set the new value for this property
Sourcepub async fn set_property_rule_property_name(
&self,
params: SetPropertyRulePropertyNameParams,
session_id: Option<&str>,
) -> Result<SetPropertyRulePropertyNameReturns, CdpError>
pub async fn set_property_rule_property_name( &self, params: SetPropertyRulePropertyNameParams, session_id: Option<&str>, ) -> Result<SetPropertyRulePropertyNameReturns, CdpError>
Modifies the property rule property name.
Sourcepub async fn set_keyframe_key(
&self,
params: SetKeyframeKeyParams,
session_id: Option<&str>,
) -> Result<SetKeyframeKeyReturns, CdpError>
pub async fn set_keyframe_key( &self, params: SetKeyframeKeyParams, session_id: Option<&str>, ) -> Result<SetKeyframeKeyReturns, CdpError>
Modifies the keyframe rule key text.
Sourcepub async fn set_media_text(
&self,
params: SetMediaTextParams,
session_id: Option<&str>,
) -> Result<SetMediaTextReturns, CdpError>
pub async fn set_media_text( &self, params: SetMediaTextParams, session_id: Option<&str>, ) -> Result<SetMediaTextReturns, CdpError>
Modifies the rule selector.
Sourcepub async fn set_container_query_text(
&self,
params: SetContainerQueryTextParams,
session_id: Option<&str>,
) -> Result<SetContainerQueryTextReturns, CdpError>
pub async fn set_container_query_text( &self, params: SetContainerQueryTextParams, session_id: Option<&str>, ) -> Result<SetContainerQueryTextReturns, CdpError>
Modifies the expression of a container query.
Sourcepub async fn set_supports_text(
&self,
params: SetSupportsTextParams,
session_id: Option<&str>,
) -> Result<SetSupportsTextReturns, CdpError>
pub async fn set_supports_text( &self, params: SetSupportsTextParams, session_id: Option<&str>, ) -> Result<SetSupportsTextReturns, CdpError>
Modifies the expression of a supports at-rule.
Sourcepub async fn set_scope_text(
&self,
params: SetScopeTextParams,
session_id: Option<&str>,
) -> Result<SetScopeTextReturns, CdpError>
pub async fn set_scope_text( &self, params: SetScopeTextParams, session_id: Option<&str>, ) -> Result<SetScopeTextReturns, CdpError>
Modifies the expression of a scope at-rule.
Sourcepub async fn set_rule_selector(
&self,
params: SetRuleSelectorParams,
session_id: Option<&str>,
) -> Result<SetRuleSelectorReturns, CdpError>
pub async fn set_rule_selector( &self, params: SetRuleSelectorParams, session_id: Option<&str>, ) -> Result<SetRuleSelectorReturns, CdpError>
Modifies the rule selector.
Sourcepub async fn set_style_sheet_text(
&self,
params: SetStyleSheetTextParams,
session_id: Option<&str>,
) -> Result<SetStyleSheetTextReturns, CdpError>
pub async fn set_style_sheet_text( &self, params: SetStyleSheetTextParams, session_id: Option<&str>, ) -> Result<SetStyleSheetTextReturns, CdpError>
Sets the new stylesheet text.
Sourcepub async fn set_style_texts(
&self,
params: SetStyleTextsParams,
session_id: Option<&str>,
) -> Result<SetStyleTextsReturns, CdpError>
pub async fn set_style_texts( &self, params: SetStyleTextsParams, session_id: Option<&str>, ) -> Result<SetStyleTextsReturns, CdpError>
Applies specified style edits one after another in the given order.
Sourcepub async fn start_rule_usage_tracking(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn start_rule_usage_tracking( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Enables the selector recording.
Sourcepub async fn stop_rule_usage_tracking(
&self,
session_id: Option<&str>,
) -> Result<StopRuleUsageTrackingReturns, CdpError>
pub async fn stop_rule_usage_tracking( &self, session_id: Option<&str>, ) -> Result<StopRuleUsageTrackingReturns, CdpError>
Stop tracking rule usage and return the list of rules that were used since last call to
takeCoverageDelta (or since start of coverage instrumentation).
Sourcepub async fn take_coverage_delta(
&self,
session_id: Option<&str>,
) -> Result<TakeCoverageDeltaReturns, CdpError>
pub async fn take_coverage_delta( &self, session_id: Option<&str>, ) -> Result<TakeCoverageDeltaReturns, CdpError>
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).
Sourcepub async fn set_local_fonts_enabled(
&self,
params: SetLocalFontsEnabledParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_local_fonts_enabled( &self, params: SetLocalFontsEnabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Enables/disables rendering of local CSS fonts (enabled by default).