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§
- AddRule
Params - Inserts a new rule with the given
ruleText
in a stylesheet with givenstyleSheetId
, at the position specified bylocation
. addRule - AddRule
Params Builder - AddRule
Returns - Inserts a new rule with the given
ruleText
in a stylesheet with givenstyleSheetId
, at the position specified bylocation
. addRule - AddRule
Returns Builder - Collect
Class Names Params - Returns all class names from specified stylesheet. collectClassNames
- Collect
Class Names Params Builder - Collect
Class Names Returns - Returns all class names from specified stylesheet. collectClassNames
- Collect
Class Names Returns Builder - Create
Style Sheet Params - Creates a new special “via-inspector” stylesheet in the frame with given
frameId
. createStyleSheet - Create
Style Sheet Params Builder - Create
Style Sheet Returns - Creates a new special “via-inspector” stylesheet in the frame with given
frameId
. createStyleSheet - Create
Style Sheet Returns Builder - CssComputed
Style Property - CssComputed
Style Property Builder - CssContainer
Query - CSS container query rule descriptor. CSSContainerQuery
- CssContainer
Query Builder - CssFont
Palette Values Rule - CSS font-palette-values rule representation. CSSFontPaletteValuesRule
- CssFont
Palette Values Rule Builder - CssKeyframe
Rule - CSS keyframe rule representation. CSSKeyframeRule
- CssKeyframe
Rule Builder - CssKeyframes
Rule - CSS keyframes rule representation. CSSKeyframesRule
- CssKeyframes
Rule Builder - CssLayer
- CSS Layer at-rule descriptor. CSSLayer
- CssLayer
Builder - CssLayer
Data - CSS Layer data. CSSLayerData
- CssLayer
Data Builder - CssMedia
- CSS media rule descriptor. CSSMedia
- CssMedia
Builder - CssPosition
TryRule - CSS @position-try rule representation. CSSPositionTryRule
- CssPosition
TryRule Builder - CssProperty
- CSS property declaration data. CSSProperty
- CssProperty
Builder - CssProperty
Registration - Representation of a custom property registration through CSS.registerProperty CSSPropertyRegistration
- CssProperty
Registration Builder - CssProperty
Rule - CSS property at-rule representation. CSSPropertyRule
- CssProperty
Rule Builder - CssRule
- CSS rule representation. CSSRule
- CssRule
Builder - CssScope
- CSS Scope at-rule descriptor. CSSScope
- CssScope
Builder - CssStyle
- CSS style representation. CSSStyle
- CssStyle
Builder - CssStyle
Sheet Header - CSS stylesheet metainformation. CSSStyleSheetHeader
- CssStyle
Sheet Header Builder - CssSupports
- CSS Supports at-rule descriptor. CSSSupports
- CssSupports
Builder - CssTry
Rule - CSS try rule representation. CSSTryRule
- CssTry
Rule Builder - Disable
Params - Disables the CSS agent for the given page. disable
- Disable
Returns - Disables the CSS agent for the given page. disable
- Enable
Params - 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
- Enable
Returns - 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
- Event
Fonts Updated - Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font. fontsUpdated
- Event
Media Query Result Changed - 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
- Event
Style Sheet Added - Fired whenever an active document stylesheet is added. styleSheetAdded
- Event
Style Sheet Changed - Fired whenever a stylesheet is changed as a result of the client operation. styleSheetChanged
- Event
Style Sheet Removed - Fired whenever an active document stylesheet is removed. styleSheetRemoved
- Font
Face - 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
- Font
Face Builder - Font
Variation Axis - Information about font variation axes for variable fonts FontVariationAxis
- Font
Variation Axis Builder - Force
Pseudo State Params - Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. forcePseudoState
- Force
Pseudo State Params Builder - Force
Pseudo State Returns - Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. forcePseudoState
- GetBackground
Colors Params - GetBackground
Colors Params Builder - GetBackground
Colors Returns - GetBackground
Colors Returns Builder - GetComputed
Style ForNode Params - Returns the computed style for a DOM node identified by
nodeId
. getComputedStyleForNode - GetComputed
Style ForNode Params Builder - GetComputed
Style ForNode Returns - Returns the computed style for a DOM node identified by
nodeId
. getComputedStyleForNode - GetComputed
Style ForNode Returns Builder - GetInline
Styles ForNode Params - Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM
attributes) for a DOM node identified by
nodeId
. getInlineStylesForNode - GetInline
Styles ForNode Params Builder - GetInline
Styles ForNode Returns - Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM
attributes) for a DOM node identified by
nodeId
. getInlineStylesForNode - GetInline
Styles ForNode Returns Builder - GetLayers
ForNode Params - 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
- GetLayers
ForNode Params Builder - GetLayers
ForNode Returns - 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
- GetLayers
ForNode Returns Builder - GetLocation
ForSelector Params - 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
- GetLocation
ForSelector Params Builder - GetLocation
ForSelector Returns - 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
- GetLocation
ForSelector Returns Builder - GetMatched
Styles ForNode Params - Returns requested styles for a DOM node identified by
nodeId
. getMatchedStylesForNode - GetMatched
Styles ForNode Params Builder - GetMatched
Styles ForNode Returns - Returns requested styles for a DOM node identified by
nodeId
. getMatchedStylesForNode - GetMatched
Styles ForNode Returns Builder - GetMedia
Queries Params - Returns all media queries parsed by the rendering engine. getMediaQueries
- GetMedia
Queries Returns - Returns all media queries parsed by the rendering engine. getMediaQueries
- GetMedia
Queries Returns Builder - GetPlatform
Fonts ForNode Params - Requests information about platform fonts which we used to render child TextNodes in the given node. getPlatformFontsForNode
- GetPlatform
Fonts ForNode Params Builder - GetPlatform
Fonts ForNode Returns - Requests information about platform fonts which we used to render child TextNodes in the given node. getPlatformFontsForNode
- GetPlatform
Fonts ForNode Returns Builder - GetStyle
Sheet Text Params - Returns the current textual content for a stylesheet. getStyleSheetText
- GetStyle
Sheet Text Params Builder - GetStyle
Sheet Text Returns - Returns the current textual content for a stylesheet. getStyleSheetText
- GetStyle
Sheet Text Returns Builder - Inherited
Pseudo Element Matches - Inherited pseudo element matches from pseudos of an ancestor node. InheritedPseudoElementMatches
- Inherited
Pseudo Element Matches Builder - Inherited
Style Entry - Inherited CSS rule collection from ancestor node. InheritedStyleEntry
- Inherited
Style Entry Builder - Media
Query - Media query descriptor. MediaQuery
- Media
Query Builder - Media
Query Expression - Media query expression descriptor. MediaQueryExpression
- Media
Query Expression Builder - Platform
Font Usage - Information about amount of glyphs that were rendered with given font. PlatformFontUsage
- Platform
Font Usage Builder - Pseudo
Element Matches - CSS rule collection for a single pseudo style. PseudoElementMatches
- Pseudo
Element Matches Builder - Rule
Match - Match data for a CSS rule. RuleMatch
- Rule
Match Builder - Rule
Usage - CSS coverage information. RuleUsage
- Rule
Usage Builder - Selector
List - Selector list data. SelectorList
- Selector
List Builder - SetContainer
Query Text Params - Modifies the expression of a container query. setContainerQueryText
- SetContainer
Query Text Params Builder - SetContainer
Query Text Returns - Modifies the expression of a container query. setContainerQueryText
- SetContainer
Query Text Returns Builder - SetEffective
Property Value ForNode Params - Find a rule with the given active property for the given node and set the new value for this property setEffectivePropertyValueForNode
- SetEffective
Property Value ForNode Params Builder - SetEffective
Property Value ForNode Returns - Find a rule with the given active property for the given node and set the new value for this property setEffectivePropertyValueForNode
- SetKeyframe
KeyParams - Modifies the keyframe rule key text. setKeyframeKey
- SetKeyframe
KeyParams Builder - SetKeyframe
KeyReturns - Modifies the keyframe rule key text. setKeyframeKey
- SetKeyframe
KeyReturns Builder - SetLocal
Fonts Enabled Params - Enables/disables rendering of local CSS fonts (enabled by default). setLocalFontsEnabled
- SetLocal
Fonts Enabled Params Builder - SetLocal
Fonts Enabled Returns - Enables/disables rendering of local CSS fonts (enabled by default). setLocalFontsEnabled
- SetMedia
Text Params - Modifies the rule selector. setMediaText
- SetMedia
Text Params Builder - SetMedia
Text Returns - Modifies the rule selector. setMediaText
- SetMedia
Text Returns Builder - SetProperty
Rule Property Name Params - Modifies the property rule property name. setPropertyRulePropertyName
- SetProperty
Rule Property Name Params Builder - SetProperty
Rule Property Name Returns - Modifies the property rule property name. setPropertyRulePropertyName
- SetProperty
Rule Property Name Returns Builder - SetRule
Selector Params - Modifies the rule selector. setRuleSelector
- SetRule
Selector Params Builder - SetRule
Selector Returns - Modifies the rule selector. setRuleSelector
- SetRule
Selector Returns Builder - SetScope
Text Params - Modifies the expression of a scope at-rule. setScopeText
- SetScope
Text Params Builder - SetScope
Text Returns - Modifies the expression of a scope at-rule. setScopeText
- SetScope
Text Returns Builder - SetStyle
Sheet Text Params - Sets the new stylesheet text. setStyleSheetText
- SetStyle
Sheet Text Params Builder - SetStyle
Sheet Text Returns - Sets the new stylesheet text. setStyleSheetText
- SetStyle
Sheet Text Returns Builder - SetStyle
Texts Params - Applies specified style edits one after another in the given order. setStyleTexts
- SetStyle
Texts Params Builder - SetStyle
Texts Returns - Applies specified style edits one after another in the given order. setStyleTexts
- SetStyle
Texts Returns Builder - SetSupports
Text Params - Modifies the expression of a supports at-rule. setSupportsText
- SetSupports
Text Params Builder - SetSupports
Text Returns - Modifies the expression of a supports at-rule. setSupportsText
- SetSupports
Text Returns Builder - Shorthand
Entry - Shorthand
Entry Builder - Source
Range - Text range within a resource. All numbers are zero-based. SourceRange
- Source
Range Builder - Specificity
- Specificity: https://drafts.csswg.org/selectors/#specificity-rules Specificity
- Specificity
Builder - Start
Rule Usage Tracking Params - Enables the selector recording. startRuleUsageTracking
- Start
Rule Usage Tracking Returns - Enables the selector recording. startRuleUsageTracking
- Stop
Rule Usage Tracking Params - 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 - Stop
Rule Usage Tracking Returns - 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 - Stop
Rule Usage Tracking Returns Builder - Style
Declaration Edit - A descriptor of operation to mutate style declaration text. StyleDeclarationEdit
- Style
Declaration Edit Builder - Style
Sheet Id - Take
Computed Style Updates Params - Polls the next batch of computed style updates. takeComputedStyleUpdates
- Take
Computed Style Updates Returns - Polls the next batch of computed style updates. takeComputedStyleUpdates
- Take
Computed Style Updates Returns Builder - Take
Coverage Delta Params - Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation). takeCoverageDelta
- Take
Coverage Delta Returns - Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation). takeCoverageDelta
- Take
Coverage Delta Returns Builder - Track
Computed Style Updates Params - 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
- Track
Computed Style Updates Params Builder - Track
Computed Style Updates Returns - 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
- Value
Builder
Enums§
- CssMedia
Source - Source of the media query: “mediaRule” if specified by a @media rule, “importRule” if specified by an @import rule, “linkedSheet” if specified by a “media” attribute in a linked stylesheet’s LINK tag, “inlineSheet” if specified by a “media” attribute in an inline stylesheet’s STYLE tag.
- CssRule
Type - 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.
- Style
Sheet Origin - 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.