chromiumoxide::cdp::browser_protocol

Module css

Source
Expand description

This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded/styleSheetRemoved events and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods.

Structs§

AddRuleParams
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location. addRule
AddRuleParamsBuilder
AddRuleReturns
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location. addRule
AddRuleReturnsBuilder
CollectClassNamesParams
Returns all class names from specified stylesheet. collectClassNames
CollectClassNamesParamsBuilder
CollectClassNamesReturns
Returns all class names from specified stylesheet. collectClassNames
CollectClassNamesReturnsBuilder
CreateStyleSheetParams
Creates a new special “via-inspector” stylesheet in the frame with given frameId. createStyleSheet
CreateStyleSheetParamsBuilder
CreateStyleSheetReturns
Creates a new special “via-inspector” stylesheet in the frame with given frameId. createStyleSheet
CreateStyleSheetReturnsBuilder
CssComputedStyleProperty
CssComputedStylePropertyBuilder
CssContainerQuery
CSS container query rule descriptor. CSSContainerQuery
CssContainerQueryBuilder
CssFontPaletteValuesRule
CSS font-palette-values rule representation. CSSFontPaletteValuesRule
CssFontPaletteValuesRuleBuilder
CssKeyframeRule
CSS keyframe rule representation. CSSKeyframeRule
CssKeyframeRuleBuilder
CssKeyframesRule
CSS keyframes rule representation. CSSKeyframesRule
CssKeyframesRuleBuilder
CssLayer
CSS Layer at-rule descriptor. CSSLayer
CssLayerBuilder
CssLayerData
CSS Layer data. CSSLayerData
CssLayerDataBuilder
CssMedia
CSS media rule descriptor. CSSMedia
CssMediaBuilder
CssPositionTryRule
CSS @position-try rule representation. CSSPositionTryRule
CssPositionTryRuleBuilder
CssProperty
CSS property declaration data. CSSProperty
CssPropertyBuilder
CssPropertyRegistration
Representation of a custom property registration through CSS.registerProperty CSSPropertyRegistration
CssPropertyRegistrationBuilder
CssPropertyRule
CSS property at-rule representation. CSSPropertyRule
CssPropertyRuleBuilder
CssRule
CSS rule representation. CSSRule
CssRuleBuilder
CssScope
CSS Scope at-rule descriptor. CSSScope
CssScopeBuilder
CssStyle
CSS style representation. CSSStyle
CssStyleBuilder
CssStyleSheetHeader
CSS stylesheet metainformation. CSSStyleSheetHeader
CssStyleSheetHeaderBuilder
CssSupports
CSS Supports at-rule descriptor. CSSSupports
CssSupportsBuilder
CssTryRule
CSS try rule representation. CSSTryRule
CssTryRuleBuilder
DisableParams
Disables the CSS agent for the given page. disable
DisableReturns
Disables the CSS agent for the given page. disable
EnableParams
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. enable
EnableReturns
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. enable
EventFontsUpdated
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font. fontsUpdated
EventMediaQueryResultChanged
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features. mediaQueryResultChanged
EventStyleSheetAdded
Fired whenever an active document stylesheet is added. styleSheetAdded
EventStyleSheetChanged
Fired whenever a stylesheet is changed as a result of the client operation. styleSheetChanged
EventStyleSheetRemoved
Fired whenever an active document stylesheet is removed. styleSheetRemoved
FontFace
Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions and additional information such as platformFontFamily and fontVariationAxes. FontFace
FontFaceBuilder
FontVariationAxis
Information about font variation axes for variable fonts FontVariationAxis
FontVariationAxisBuilder
ForcePseudoStateParams
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. forcePseudoState
ForcePseudoStateParamsBuilder
ForcePseudoStateReturns
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. forcePseudoState
GetBackgroundColorsParams
GetBackgroundColorsParamsBuilder
GetBackgroundColorsReturns
GetBackgroundColorsReturnsBuilder
GetComputedStyleForNodeParams
Returns the computed style for a DOM node identified by nodeId. getComputedStyleForNode
GetComputedStyleForNodeParamsBuilder
GetComputedStyleForNodeReturns
Returns the computed style for a DOM node identified by nodeId. getComputedStyleForNode
GetComputedStyleForNodeReturnsBuilder
GetInlineStylesForNodeParams
Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId. getInlineStylesForNode
GetInlineStylesForNodeParamsBuilder
GetInlineStylesForNodeReturns
Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId. getInlineStylesForNode
GetInlineStylesForNodeReturnsBuilder
GetLayersForNodeParams
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. getLayersForNode
GetLayersForNodeParamsBuilder
GetLayersForNodeReturns
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. getLayersForNode
GetLayersForNodeReturnsBuilder
GetLocationForSelectorParams
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet. getLocationForSelector
GetLocationForSelectorParamsBuilder
GetLocationForSelectorReturns
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet. getLocationForSelector
GetLocationForSelectorReturnsBuilder
GetMatchedStylesForNodeParams
Returns requested styles for a DOM node identified by nodeId. getMatchedStylesForNode
GetMatchedStylesForNodeParamsBuilder
GetMatchedStylesForNodeReturns
Returns requested styles for a DOM node identified by nodeId. getMatchedStylesForNode
GetMatchedStylesForNodeReturnsBuilder
GetMediaQueriesParams
Returns all media queries parsed by the rendering engine. getMediaQueries
GetMediaQueriesReturns
Returns all media queries parsed by the rendering engine. getMediaQueries
GetMediaQueriesReturnsBuilder
GetPlatformFontsForNodeParams
Requests information about platform fonts which we used to render child TextNodes in the given node. getPlatformFontsForNode
GetPlatformFontsForNodeParamsBuilder
GetPlatformFontsForNodeReturns
Requests information about platform fonts which we used to render child TextNodes in the given node. getPlatformFontsForNode
GetPlatformFontsForNodeReturnsBuilder
GetStyleSheetTextParams
Returns the current textual content for a stylesheet. getStyleSheetText
GetStyleSheetTextParamsBuilder
GetStyleSheetTextReturns
Returns the current textual content for a stylesheet. getStyleSheetText
GetStyleSheetTextReturnsBuilder
InheritedPseudoElementMatches
Inherited pseudo element matches from pseudos of an ancestor node. InheritedPseudoElementMatches
InheritedPseudoElementMatchesBuilder
InheritedStyleEntry
Inherited CSS rule collection from ancestor node. InheritedStyleEntry
InheritedStyleEntryBuilder
MediaQuery
Media query descriptor. MediaQuery
MediaQueryBuilder
MediaQueryExpression
Media query expression descriptor. MediaQueryExpression
MediaQueryExpressionBuilder
PlatformFontUsage
Information about amount of glyphs that were rendered with given font. PlatformFontUsage
PlatformFontUsageBuilder
PseudoElementMatches
CSS rule collection for a single pseudo style. PseudoElementMatches
PseudoElementMatchesBuilder
RuleMatch
Match data for a CSS rule. RuleMatch
RuleMatchBuilder
RuleUsage
CSS coverage information. RuleUsage
RuleUsageBuilder
SelectorList
Selector list data. SelectorList
SelectorListBuilder
SetContainerQueryTextParams
Modifies the expression of a container query. setContainerQueryText
SetContainerQueryTextParamsBuilder
SetContainerQueryTextReturns
Modifies the expression of a container query. setContainerQueryText
SetContainerQueryTextReturnsBuilder
SetEffectivePropertyValueForNodeParams
Find a rule with the given active property for the given node and set the new value for this property setEffectivePropertyValueForNode
SetEffectivePropertyValueForNodeParamsBuilder
SetEffectivePropertyValueForNodeReturns
Find a rule with the given active property for the given node and set the new value for this property setEffectivePropertyValueForNode
SetKeyframeKeyParams
Modifies the keyframe rule key text. setKeyframeKey
SetKeyframeKeyParamsBuilder
SetKeyframeKeyReturns
Modifies the keyframe rule key text. setKeyframeKey
SetKeyframeKeyReturnsBuilder
SetLocalFontsEnabledParams
Enables/disables rendering of local CSS fonts (enabled by default). setLocalFontsEnabled
SetLocalFontsEnabledParamsBuilder
SetLocalFontsEnabledReturns
Enables/disables rendering of local CSS fonts (enabled by default). setLocalFontsEnabled
SetMediaTextParams
Modifies the rule selector. setMediaText
SetMediaTextParamsBuilder
SetMediaTextReturns
Modifies the rule selector. setMediaText
SetMediaTextReturnsBuilder
SetPropertyRulePropertyNameParams
Modifies the property rule property name. setPropertyRulePropertyName
SetPropertyRulePropertyNameParamsBuilder
SetPropertyRulePropertyNameReturns
Modifies the property rule property name. setPropertyRulePropertyName
SetPropertyRulePropertyNameReturnsBuilder
SetRuleSelectorParams
Modifies the rule selector. setRuleSelector
SetRuleSelectorParamsBuilder
SetRuleSelectorReturns
Modifies the rule selector. setRuleSelector
SetRuleSelectorReturnsBuilder
SetScopeTextParams
Modifies the expression of a scope at-rule. setScopeText
SetScopeTextParamsBuilder
SetScopeTextReturns
Modifies the expression of a scope at-rule. setScopeText
SetScopeTextReturnsBuilder
SetStyleSheetTextParams
Sets the new stylesheet text. setStyleSheetText
SetStyleSheetTextParamsBuilder
SetStyleSheetTextReturns
Sets the new stylesheet text. setStyleSheetText
SetStyleSheetTextReturnsBuilder
SetStyleTextsParams
Applies specified style edits one after another in the given order. setStyleTexts
SetStyleTextsParamsBuilder
SetStyleTextsReturns
Applies specified style edits one after another in the given order. setStyleTexts
SetStyleTextsReturnsBuilder
SetSupportsTextParams
Modifies the expression of a supports at-rule. setSupportsText
SetSupportsTextParamsBuilder
SetSupportsTextReturns
Modifies the expression of a supports at-rule. setSupportsText
SetSupportsTextReturnsBuilder
ShorthandEntry
ShorthandEntryBuilder
SourceRange
Text range within a resource. All numbers are zero-based. SourceRange
SourceRangeBuilder
Specificity
Specificity: https://drafts.csswg.org/selectors/#specificity-rules Specificity
SpecificityBuilder
StartRuleUsageTrackingParams
Enables the selector recording. startRuleUsageTracking
StartRuleUsageTrackingReturns
Enables the selector recording. startRuleUsageTracking
StopRuleUsageTrackingParams
Stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation). stopRuleUsageTracking
StopRuleUsageTrackingReturns
Stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation). stopRuleUsageTracking
StopRuleUsageTrackingReturnsBuilder
StyleDeclarationEdit
A descriptor of operation to mutate style declaration text. StyleDeclarationEdit
StyleDeclarationEditBuilder
StyleSheetId
TakeComputedStyleUpdatesParams
Polls the next batch of computed style updates. takeComputedStyleUpdates
TakeComputedStyleUpdatesReturns
Polls the next batch of computed style updates. takeComputedStyleUpdates
TakeComputedStyleUpdatesReturnsBuilder
TakeCoverageDeltaParams
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation). takeCoverageDelta
TakeCoverageDeltaReturns
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation). takeCoverageDelta
TakeCoverageDeltaReturnsBuilder
TrackComputedStyleUpdatesParams
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. trackComputedStyleUpdates
TrackComputedStyleUpdatesParamsBuilder
TrackComputedStyleUpdatesReturns
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. trackComputedStyleUpdates
Value
Data for a simple selector (these are delimited by commas in a selector list). Value
ValueBuilder

Enums§

CssMediaSource
Source of the media query: “mediaRule” if specified by a @media rule, “importRule” if specified by an @import rule, “linkedSheet” if specified by a “media” attribute in a linked stylesheet’s LINK tag, “inlineSheet” if specified by a “media” attribute in an inline stylesheet’s STYLE tag.
CssRuleType
Enum indicating the type of a CSS rule, used to represent the order of a style rule’s ancestors. This list only contains rule types that are collected during the ancestor rule collection.
StyleSheetOrigin
Stylesheet type: “injected” for stylesheets injected via extension, “user-agent” for user-agent stylesheets, “inspector” for stylesheets created by the inspector (i.e. those holding the “via inspector” rules), “regular” for regular stylesheets.