CSS Domain
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.
Methods
- CSS.addRule
- CSS.collectClassNames
- CSS.createStyleSheet
- CSS.disable
- CSS.enable
- CSS.forcePseudoState
- CSS.forceStartingStyle
- CSS.getBackgroundColors
- CSS.getComputedStyleForNode
- CSS.getInlineStylesForNode
- CSS.getMatchedStylesForNode
- CSS.getMediaQueries
- CSS.getPlatformFontsForNode
- CSS.getStyleSheetText
- CSS.setEffectivePropertyValueForNode
- CSS.setKeyframeKey
- CSS.setMediaText
- CSS.setPropertyRulePropertyName
- CSS.setRuleSelector
- CSS.setStyleSheetText
- CSS.setStyleTexts
- CSS.startRuleUsageTracking
- CSS.stopRuleUsageTracking
- CSS.takeCoverageDelta
- CSS.getAnimatedStylesForNode Experimental
- CSS.getEnvironmentVariables Experimental
- CSS.getLayersForNode Experimental
- CSS.getLocationForSelector Experimental
- CSS.getLonghandProperties Experimental
- CSS.resolveValues Experimental
- CSS.setContainerQueryText Experimental
- CSS.setLocalFontsEnabled Experimental
- CSS.setScopeText Experimental
- CSS.setSupportsText Experimental
- CSS.takeComputedStyleUpdates Experimental
- CSS.trackComputedStyleUpdates Experimental
- CSS.trackComputedStyleUpdatesForNode Experimental
Events
- CSS.fontsUpdated
- CSS.mediaQueryResultChanged
- CSS.styleSheetAdded
- CSS.styleSheetChanged
- CSS.styleSheetRemoved
- CSS.computedStyleUpdated Experimental
Types
- CSS.CSSAnimationStyle
- CSS.CSSComputedStyleProperty
- CSS.CSSFontPaletteValuesRule
- CSS.CSSFunctionConditionNode
- CSS.CSSFunctionNode
- CSS.CSSFunctionParameter
- CSS.CSSFunctionRule
- CSS.CSSKeyframeRule
- CSS.CSSKeyframesRule
- CSS.CSSMedia
- CSS.CSSPositionTryRule
- CSS.CSSProperty
- CSS.CSSPropertyRegistration
- CSS.CSSPropertyRule
- CSS.CSSRule
- CSS.CSSStyle
- CSS.CSSStyleSheetHeader
- CSS.CSSTryRule
- CSS.FontFace
- CSS.FontVariationAxis
- CSS.InheritedAnimatedStyleEntry
- CSS.InheritedPseudoElementMatches
- CSS.InheritedStyleEntry
- CSS.MediaQuery
- CSS.MediaQueryExpression
- CSS.PlatformFontUsage
- CSS.PseudoElementMatches
- CSS.RuleMatch
- CSS.RuleUsage
- CSS.SelectorList
- CSS.ShorthandEntry
- CSS.SourceRange
- CSS.StyleDeclarationEdit
- CSS.StyleSheetId
- CSS.StyleSheetOrigin
- CSS.Value
- CSS.ComputedStyleExtraFields Experimental
- CSS.CSSContainerQuery Experimental
- CSS.CSSLayer Experimental
- CSS.CSSLayerData Experimental
- CSS.CSSRuleType Experimental
- CSS.CSSScope Experimental
- CSS.CSSStartingStyle Experimental
- CSS.CSSSupports Experimental
- CSS.Specificity Experimental
Methods
CSS.addRule #
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the
position specified by location.
Parameters
styleSheetId The css style sheet identifier where a new rule should be inserted.
ruleText stringThe text of a new rule.
location Text position of a new rule in the target style sheet.
nodeForPropertySyntaxValidationOptional
NodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example.
Return object
rule The newly created rule.
CSS.collectClassNames #
Returns all class names from specified stylesheet.
Parameters
styleSheetId Return object
classNames array[ string ]Class name list.
CSS.createStyleSheet #
Creates a new special "via-inspector" stylesheet in the frame with given frameId.
Parameters
frameId Identifier of the frame where "via-inspector" stylesheet should be created.
forceOptional
booleanIf true, creates a new stylesheet for every call. If false, returns a stylesheet previously created by a call with force=false for the frame's document if it exists or creates a new stylesheet (default: false).
Return object
styleSheetId Identifier of the created "via-inspector" stylesheet.
CSS.enable #
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.
CSS.forcePseudoState #
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
Parameters
nodeId The element id for which to force the pseudo state.
forcedPseudoClasses array[ string ]Element pseudo classes to force when computing the element's style.
CSS.forceStartingStyle #
Ensures that the given node is in its starting-style state.
Parameters
nodeId The element id for which to force the starting-style state.
forced booleanBoolean indicating if this is on or off.
CSS.getBackgroundColors #
Parameters
nodeId Id of the node to get background colors for.
Return object
backgroundColorsOptional
array[ string ]The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load).
computedFontSizeOptional
stringThe computed font size for this node, as a CSS computed value string (e.g. '12px').
computedFontWeightOptional
stringThe computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').
CSS.getComputedStyleForNode #
Returns the computed style for a DOM node identified by nodeId.
Parameters
nodeId Return object
computedStyle array[ CSSComputedStyleProperty ]Computed style for the specified DOM node.
extraFields A list of non-standard "extra fields" which blink stores alongside each computed style.
CSS.getInlineStylesForNode #
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM
attributes) for a DOM node identified by nodeId.
Parameters
nodeId Return object
inlineStyleOptional
Inline style for the specified DOM node.
attributesStyleOptional
Attribute-defined element style (e.g. resulting from "width=20 height=100%").
CSS.getMatchedStylesForNode #
Returns requested styles for a DOM node identified by nodeId.
Parameters
nodeId Return object
inlineStyleOptional
Inline style for the specified DOM node.
attributesStyleOptional
Attribute-defined element style (e.g. resulting from "width=20 height=100%").
matchedCSSRulesOptional
array[ RuleMatch ]CSS rules matching this node, from all applicable stylesheets.
pseudoElementsOptional
array[ PseudoElementMatches ]Pseudo style matches for this node.
inheritedOptional
array[ InheritedStyleEntry ]A chain of inherited styles (from the immediate node parent up to the DOM tree root).
inheritedPseudoElementsOptional
array[ InheritedPseudoElementMatches ]A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
cssKeyframesRulesOptional
array[ CSSKeyframesRule ]A list of CSS keyframed animations matching this node.
cssPositionTryRulesOptional
array[ CSSPositionTryRule ]A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
activePositionFallbackIndexOptional
integerIndex of the active fallback in the applied position-try-fallback property, will not be set if there is no active position-try fallback.
cssPropertyRulesOptional
array[ CSSPropertyRule ]A list of CSS at-property rules matching this node.
cssPropertyRegistrationsOptional
array[ CSSPropertyRegistration ]A list of CSS property registrations matching this node.
cssFontPaletteValuesRuleOptional
A font-palette-values rule matching this node.
parentLayoutNodeIdOptional
cssFunctionRulesOptional
array[ CSSFunctionRule ]A list of CSS at-function rules referenced by styles of this node.
CSS.getMediaQueries #
Returns all media queries parsed by the rendering engine.
Return object
medias array[ CSSMedia ]CSS.getPlatformFontsForNode #
Requests information about platform fonts which we used to render child TextNodes in the given node.
Parameters
nodeId Return object
fonts array[ PlatformFontUsage ]Usage statistics for every employed platform font.
CSS.getStyleSheetText #
Returns the current textual content for a stylesheet.
Parameters
styleSheetId Return object
text stringThe stylesheet text.
CSS.setEffectivePropertyValueForNode #
Find a rule with the given active property for the given node and set the new value for this property
Parameters
nodeId The element id for which to set property.
propertyName stringvalue stringCSS.setKeyframeKey #
Modifies the keyframe rule key text.
Parameters
styleSheetId range keyText stringReturn object
keyText The resulting key text after modification.
CSS.setMediaText #
Modifies the rule selector.
Parameters
styleSheetId range text stringReturn object
media The resulting CSS media rule after modification.
CSS.setPropertyRulePropertyName #
Modifies the property rule property name.
Parameters
styleSheetId range propertyName stringReturn object
propertyName The resulting key text after modification.
CSS.setRuleSelector #
Modifies the rule selector.
Parameters
styleSheetId range selector stringReturn object
selectorList The resulting selector list after modification.
CSS.setStyleSheetText #
Sets the new stylesheet text.
Parameters
styleSheetId text stringReturn object
sourceMapURLOptional
stringURL of source map associated with script (if any).
CSS.setStyleTexts #
Applies specified style edits one after another in the given order.
Parameters
edits array[ StyleDeclarationEdit ]nodeForPropertySyntaxValidationOptional
NodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example.
Return object
styles array[ CSSStyle ]The resulting styles after modification.
CSS.stopRuleUsageTracking #
Stop tracking rule usage and return the list of rules that were used since last call to
takeCoverageDelta (or since start of coverage instrumentation).
Return object
ruleUsage array[ RuleUsage ]CSS.takeCoverageDelta #
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).
Return object
coverage array[ RuleUsage ]timestamp numberMonotonically increasing time, in seconds.
CSS.getAnimatedStylesForNode Experimental#
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
Parameters
nodeId Return object
animationStylesOptional
array[ CSSAnimationStyle ]Styles coming from animations.
transitionsStyleOptional
Style coming from transitions.
inheritedOptional
array[ InheritedAnimatedStyleEntry ]Inherited style entries for animationsStyle and transitionsStyle from the inheritance chain of the element.
CSS.getEnvironmentVariables Experimental#
Returns the values of the default UA-defined environment variables used in env()
Return object
environmentVariables objectCSS.getLayersForNode Experimental#
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.
Parameters
nodeId Return object
rootLayer CSS.getLocationForSelector Experimental#
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.
Parameters
styleSheetId selectorText stringReturn object
ranges array[ SourceRange ]CSS.getLonghandProperties Experimental#
Parameters
shorthandName stringvalue stringReturn object
longhandProperties array[ CSSProperty ]CSS.resolveValues Experimental#
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.
Parameters
values array[ string ]Cascade-dependent keywords (revert/revert-layer) do not work.
nodeId Id of the node in whose context the expression is evaluated
propertyNameOptional
stringOnly longhands and custom property names are accepted.
pseudoTypeOptional
Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after.
pseudoIdentifierOptional
stringPseudo element custom ident.
Return object
results array[ string ]CSS.setContainerQueryText Experimental#
Modifies the expression of a container query.
Parameters
styleSheetId range text stringReturn object
containerQuery The resulting CSS container query rule after modification.
CSS.setLocalFontsEnabled Experimental#
Enables/disables rendering of local CSS fonts (enabled by default).
Parameters
enabled booleanWhether rendering of local fonts is enabled.
CSS.setScopeText Experimental#
Modifies the expression of a scope at-rule.
Parameters
styleSheetId range text stringReturn object
scope The resulting CSS Scope rule after modification.
CSS.setSupportsText Experimental#
Modifies the expression of a supports at-rule.
Parameters
styleSheetId range text stringReturn object
supports The resulting CSS Supports rule after modification.
CSS.takeComputedStyleUpdates Experimental#
Polls the next batch of computed style updates.
Return object
nodeIds array[ DOM.NodeId ]The list of node Ids that have their tracked computed styles updated.
CSS.trackComputedStyleUpdates Experimental#
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.
Parameters
propertiesToTrack array[ CSSComputedStyleProperty ]CSS.trackComputedStyleUpdatesForNode Experimental#
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.
Parameters
nodeIdOptional
Events
CSS.fontsUpdated #
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font.
Parameters
fontOptional
The web font that has loaded.
CSS.mediaQueryResultChanged #
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
CSS.styleSheetAdded #
Fired whenever an active document stylesheet is added.
Parameters
header Added stylesheet metainfo.
CSS.styleSheetChanged #
Fired whenever a stylesheet is changed as a result of the client operation.
Parameters
styleSheetId CSS.styleSheetRemoved #
Fired whenever an active document stylesheet is removed.
Parameters
styleSheetId Identifier of the removed stylesheet.
CSS.computedStyleUpdated Experimental#
Parameters
nodeId The node id that has updated computed styles.
Types
CSS.CSSAnimationStyle #
CSS style coming from animations with the name of the animation.
Type: object
Properties
nameOptional
stringThe name of the animation.
style The style coming from the animation.
CSS.CSSComputedStyleProperty #
Type: object
Properties
name stringComputed style property name.
value stringComputed style property value.
CSS.CSSFontPaletteValuesRule #
CSS font-palette-values rule representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
fontPaletteName Associated font palette name.
style Associated style declaration.
CSS.CSSFunctionConditionNode #
CSS function conditional block representation.
Type: object
Properties
mediaOptional
Media query for this conditional block. Only one type of condition should be set.
containerQueriesOptional
Container query for this conditional block. Only one type of condition should be set.
supportsOptional
@supports CSS at-rule condition. Only one type of condition should be set.
children array[ CSSFunctionNode ]Block body.
conditionText stringThe condition text.
CSS.CSSFunctionNode #
Section of the body of a CSS function rule.
Type: object
Properties
conditionOptional
A conditional block. If set, style should not be set.
styleOptional
Values set by this node. If set, condition should not be set.
CSS.CSSFunctionParameter #
CSS function argument representation.
Type: object
Properties
name stringThe parameter name.
type stringThe parameter type.
CSS.CSSFunctionRule #
CSS function at-rule representation.
Type: object
Properties
name Name of the function.
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
parameters array[ CSSFunctionParameter ]List of parameters.
children array[ CSSFunctionNode ]Function body.
CSS.CSSKeyframeRule #
CSS keyframe rule representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
keyText Associated key text.
style Associated style declaration.
CSS.CSSKeyframesRule #
CSS keyframes rule representation.
Type: object
Properties
animationName Animation name.
keyframes array[ CSSKeyframeRule ]List of keyframes.
CSS.CSSMedia #
CSS media rule descriptor.
Type: object
Properties
text stringMedia query text.
source stringSource 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.
Allowed values: mediaRule, importRule, linkedSheet, inlineSheet
sourceURLOptional
stringURL of the document containing the media query description.
rangeOptional
The associated rule (@media or @import) header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
mediaListOptional
array[ MediaQuery ]Array of media queries.
CSS.CSSPositionTryRule #
CSS @position-try rule representation.
Type: object
Properties
name The prelude dashed-ident name
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
style Associated style declaration.
active booleanCSS.CSSProperty #
CSS property declaration data.
Type: object
Properties
name stringThe property name.
value stringThe property value.
importantOptional
booleanWhether the property has "!important" annotation (implies false if absent).
implicitOptional
booleanWhether the property is implicit (implies false if absent).
textOptional
stringThe full property text as specified in the style.
parsedOkOptional
booleanWhether the property is understood by the browser (implies true if absent).
disabledOptional
booleanWhether the property is disabled by the user (present for source-based properties only).
rangeOptional
The entire property range in the enclosing style declaration (if available).
longhandPropertiesOptional
array[ CSSProperty ]Parsed longhand components of this property if it is a shorthand. This field will be empty if the given property is not a shorthand.
CSS.CSSPropertyRegistration #
Representation of a custom property registration through CSS.registerProperty
Type: object
Properties
propertyName stringinitialValueOptional
inherits booleansyntax stringCSS.CSSPropertyRule #
CSS property at-rule representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
propertyName Associated property name.
style Associated style declaration.
CSS.CSSRule #
CSS rule representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
selectorList Rule selector data.
nestingSelectorsOptional
array[ string ]Array of selectors from ancestor style rules, sorted by distance from the current rule.
origin Parent stylesheet's origin.
style Associated style declaration.
mediaOptional
array[ CSSMedia ]Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
containerQueriesOptional
array[ CSSContainerQuery ]Container query list array (for rules involving container queries). The array enumerates container queries starting with the innermost one, going outwards.
supportsOptional
array[ CSSSupports ]@supports CSS at-rule array. The array enumerates @supports at-rules starting with the innermost one, going outwards.
layersOptional
array[ CSSLayer ]Cascade layer array. Contains the layer hierarchy that this rule belongs to starting with the innermost layer and going outwards.
scopesOptional
array[ CSSScope ]@scope CSS at-rule array. The array enumerates @scope at-rules starting with the innermost one, going outwards.
ruleTypesOptional
array[ CSSRuleType ]The array keeps the types of ancestor CSSRules from the innermost going outwards.
startingStylesOptional
array[ CSSStartingStyle ]@starting-style CSS at-rule array. The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
CSS.CSSStyle #
CSS style representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
cssProperties array[ CSSProperty ]CSS properties in the style.
shorthandEntries array[ ShorthandEntry ]Computed values for all shorthands found in the style.
cssTextOptional
stringStyle declaration text (if available).
rangeOptional
Style declaration range in the enclosing stylesheet (if available).
CSS.CSSStyleSheetHeader #
CSS stylesheet metainformation.
Type: object
Properties
styleSheetId The stylesheet identifier.
frameId Owner frame identifier.
sourceURL stringStylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported as a CSS module script).
sourceMapURLOptional
stringURL of source map associated with the stylesheet (if any).
origin Stylesheet origin.
title stringStylesheet title.
ownerNodeOptional
The backend id for the owner node of the stylesheet.
disabled booleanDenotes whether the stylesheet is disabled.
hasSourceURLOptional
booleanWhether the sourceURL field value comes from the sourceURL comment.
isInline booleanWhether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
isMutable booleanWhether this stylesheet is mutable. Inline stylesheets become mutable
after they have been modified via CSSOM API.
<link> element's stylesheets become mutable only if DevTools modifies them.
Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
isConstructed booleanTrue if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script.
startLine numberLine offset of the stylesheet within the resource (zero based).
startColumn numberColumn offset of the stylesheet within the resource (zero based).
length numberSize of the content (in characters).
endLine numberLine offset of the end of the stylesheet within the resource (zero based).
endColumn numberColumn offset of the end of the stylesheet within the resource (zero based).
loadingFailedOptional
booleanIf the style sheet was loaded from a network resource, this indicates when the resource failed to load
CSS.CSSTryRule #
CSS try rule representation.
Type: object
Properties
styleSheetIdOptional
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
origin Parent stylesheet's origin.
style Associated style declaration.
CSS.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.
Type: object
Properties
fontFamily stringThe font-family.
fontStyle stringThe font-style.
fontVariant stringThe font-variant.
fontWeight stringThe font-weight.
fontStretch stringThe font-stretch.
fontDisplay stringThe font-display.
unicodeRange stringThe unicode-range.
src stringThe src.
platformFontFamily stringThe resolved platform font family
fontVariationAxesOptional
array[ FontVariationAxis ]Available variation settings (a.k.a. "axes").
CSS.FontVariationAxis #
Information about font variation axes for variable fonts
Type: object
Properties
tag stringThe font-variation-setting tag (a.k.a. "axis tag").
name stringHuman-readable variation name in the default language (normally, "en").
minValue numberThe minimum value (inclusive) the font supports for this tag.
maxValue numberThe maximum value (inclusive) the font supports for this tag.
defaultValue numberThe default value.
CSS.InheritedAnimatedStyleEntry #
Inherited CSS style collection for animated styles from ancestor node.
Type: object
Properties
animationStylesOptional
array[ CSSAnimationStyle ]Styles coming from the animations of the ancestor, if any, in the style inheritance chain.
transitionsStyleOptional
The style coming from the transitions of the ancestor, if any, in the style inheritance chain.
CSS.InheritedPseudoElementMatches #
Inherited pseudo element matches from pseudos of an ancestor node.
Type: object
Properties
pseudoElements array[ PseudoElementMatches ]Matches of pseudo styles from the pseudos of an ancestor node.
CSS.InheritedStyleEntry #
Inherited CSS rule collection from ancestor node.
Type: object
Properties
inlineStyleOptional
The ancestor node's inline style, if any, in the style inheritance chain.
matchedCSSRules array[ RuleMatch ]Matches of CSS rules matching the ancestor node in the style inheritance chain.
CSS.MediaQuery #
Media query descriptor.
Type: object
Properties
expressions array[ MediaQueryExpression ]Array of media query expressions.
active booleanWhether the media query condition is satisfied.
CSS.MediaQueryExpression #
Media query expression descriptor.
Type: object
Properties
value numberMedia query expression value.
unit stringMedia query expression units.
feature stringMedia query expression feature.
valueRangeOptional
The associated range of the value text in the enclosing stylesheet (if available).
computedLengthOptional
numberComputed length of media query expression (if applicable).
CSS.PlatformFontUsage #
Information about amount of glyphs that were rendered with given font.
Type: object
Properties
familyName stringFont's family name reported by platform.
postScriptName stringFont's PostScript name reported by platform.
isCustomFont booleanIndicates if the font was downloaded or resolved locally.
glyphCount numberAmount of glyphs that were rendered with this font.
CSS.PseudoElementMatches #
CSS rule collection for a single pseudo style.
Type: object
Properties
pseudoType Pseudo element type.
pseudoIdentifierOptional
stringPseudo element custom ident.
matches array[ RuleMatch ]Matches of CSS rules applicable to the pseudo style.
CSS.RuleMatch #
Match data for a CSS rule.
Type: object
Properties
rule CSS rule in the match.
matchingSelectors array[ integer ]Matching selector indices in the rule's selectorList selectors (0-based).
CSS.RuleUsage #
CSS coverage information.
Type: object
Properties
styleSheetId The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
startOffset numberOffset of the start of the rule (including selector) from the beginning of the stylesheet.
endOffset numberOffset of the end of the rule body from the beginning of the stylesheet.
used booleanIndicates whether the rule was actually used by some element in the page.
CSS.SelectorList #
Selector list data.
Type: object
Properties
selectors array[ Value ]Selectors in the list.
text stringRule selector text.
CSS.ShorthandEntry #
Type: object
Properties
name stringShorthand name.
value stringShorthand value.
importantOptional
booleanWhether the property has "!important" annotation (implies false if absent).
CSS.SourceRange #
Text range within a resource. All numbers are zero-based.
Type: object
Properties
startLine integerStart line of range.
startColumn integerStart column of range (inclusive).
endLine integerEnd line of range
endColumn integerEnd column of range (exclusive).
CSS.StyleDeclarationEdit #
A descriptor of operation to mutate style declaration text.
Type: object
Properties
styleSheetId The css style sheet identifier.
range The range of the style text in the enclosing stylesheet.
text stringNew style text.
CSS.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.
Type: string
Allowed values: injected, user-agent, inspector, regular
CSS.Value #
Data for a simple selector (these are delimited by commas in a selector list).
Type: object
Properties
text stringValue text.
rangeOptional
Value range in the underlying resource (if available).
specificityOptional
CSS.ComputedStyleExtraFields Experimental#
Type: object
Properties
isAppearanceBase booleanReturns whether or not this node is being rendered with base appearance, which happens when it has its appearance property set to base/base-select or it is in the subtree of an element being rendered with base appearance.
CSS.CSSContainerQuery Experimental#
CSS container query rule descriptor.
Type: object
Properties
text stringContainer query text.
rangeOptional
The associated rule header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
nameOptional
stringOptional name for the container.
physicalAxesOptional
Optional physical axes queried for the container.
logicalAxesOptional
Optional logical axes queried for the container.
queriesScrollStateOptional
booleantrue if the query contains scroll-state() queries.
queriesAnchoredOptional
booleantrue if the query contains anchored() queries.
CSS.CSSLayer Experimental#
CSS Layer at-rule descriptor.
Type: object
Properties
text stringLayer name.
rangeOptional
The associated rule header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
CSS.CSSLayerData Experimental#
CSS Layer data.
Type: object
Properties
name stringLayer name.
subLayersOptional
array[ CSSLayerData ]Direct sub-layers
order numberLayer order. The order determines the order of the layer in the cascade order. A higher number has higher priority in the cascade order.
CSS.CSSRuleType Experimental#
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.
Type: string
Allowed values: MediaRule, SupportsRule, ContainerRule, LayerRule, ScopeRule, StyleRule, StartingStyleRule
CSS.CSSScope Experimental#
CSS Scope at-rule descriptor.
Type: object
Properties
text stringScope rule text.
rangeOptional
The associated rule header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
CSS.CSSStartingStyle Experimental#
CSS Starting Style at-rule descriptor.
Type: object
Properties
rangeOptional
The associated rule header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
CSS.CSSSupports Experimental#
CSS Supports at-rule descriptor.
Type: object
Properties
text stringSupports rule text.
active booleanWhether the supports condition is satisfied.
rangeOptional
The associated rule header range in the enclosing stylesheet (if available).
styleSheetIdOptional
Identifier of the stylesheet containing this object (if exists).
CSS.Specificity Experimental#
Specificity: https://drafts.csswg.org/selectors/#specificity-rules
Type: object
Properties
a integerThe a component, which represents the number of ID selectors.
b integerThe b component, which represents the number of class selectors, attributes selectors, and pseudo-classes.
c integerThe c component, which represents the number of type selectors and pseudo-elements.