CSS
ExperimentalThis 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.
No symbols match your filter.
Commands
CSS.addRule
Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the
position specified by `location`.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
The css style sheet identifier where a new rule should be inserted. |
ruleText
|
string |
The text of a new rule. |
location
|
SourceRange |
Text position of a new rule in the target style sheet. |
nodeForPropertySyntaxValidation
(optional) Experimental |
DOM.NodeId |
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
| Name | Type | Description |
|---|---|---|
rule
|
CSSRule |
The newly created rule. |
CSS.collectClassNames
Returns all class names from specified stylesheet.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
Return Object
| Name | Type | Description |
|---|---|---|
classNames
|
array<string> |
Class name list. |
CSS.createStyleSheet
Creates a new special "via-inspector" stylesheet in the frame with given `frameId`.
Parameters
| Name | Type | Description |
|---|---|---|
frameId
|
Page.FrameId |
Identifier of the frame where "via-inspector" stylesheet should be created. |
force
(optional) |
boolean |
If 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
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
Identifier of the created "via-inspector" stylesheet. |
CSS.disable
Disables the CSS agent for the given page.
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
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.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
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
The element id for which to force the starting-style state. |
forced
|
boolean |
Boolean indicating if this is on or off. |
CSS.getBackgroundColors
Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Id of the node to get background colors for. |
Return Object
| Name | Type | Description |
|---|---|---|
backgroundColors
(optional) |
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). |
computedFontSize
(optional) |
string |
The computed font size for this node, as a CSS computed value string (e.g. '12px'). |
computedFontWeight
(optional) |
string |
The 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
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
| Name | Type | Description |
|---|---|---|
computedStyle
|
array<CSSComputedStyleProperty> |
Computed style for the specified DOM node. |
extraFields
Experimental |
ComputedStyleExtraFields |
A list of non-standard "extra fields" which blink stores alongside each computed style. |
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.
Note: this function currently does not resolve CSS random() function,
it returns unmodified random() function parts.`
Parameters
| Name | Type | Description |
|---|---|---|
values
|
array<string> |
Cascade-dependent keywords (revert/revert-layer) do not work. |
nodeId
|
DOM.NodeId |
Id of the node in whose context the expression is evaluated |
propertyName
(optional) |
string |
Only longhands and custom property names are accepted. |
pseudoType
(optional) |
DOM.PseudoType |
Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after. |
pseudoIdentifier
(optional) |
string |
Pseudo element custom ident. |
Return Object
| Name | Type | Description |
|---|---|---|
results
|
array<string> |
CSS.getLonghandProperties
Experimental Parameters
| Name | Type | Description |
|---|---|---|
shorthandName
|
string |
|
value
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
longhandProperties
|
array<CSSProperty> |
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
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
CSS.getAnimatedStylesForNode
Experimental Returns the styles coming from animations & transitions
including the animation & transition styles coming from inheritance chain.
Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
| Name | Type | Description |
|---|---|---|
animationStyles
(optional) |
array<CSSAnimationStyle> |
Styles coming from animations. |
transitionsStyle
(optional) |
CSSStyle |
Style coming from transitions. |
inherited
(optional) |
array<InheritedAnimatedStyleEntry> |
Inherited style entries for animationsStyle and transitionsStyle from the inheritance chain of the element. |
CSS.getMatchedStylesForNode
Returns requested styles for a DOM node identified by `nodeId`.
Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
| Name | Type | Description |
|---|---|---|
inlineStyle
(optional) |
CSSStyle |
Inline style for the specified DOM node. |
attributesStyle
(optional) |
CSSStyle |
Attribute-defined element style (e.g. resulting from "width=20 height=100%"). |
matchedCSSRules
(optional) |
array<RuleMatch> |
CSS rules matching this node, from all applicable stylesheets. |
pseudoElements
(optional) |
array<PseudoElementMatches> |
Pseudo style matches for this node. |
inherited
(optional) |
array<InheritedStyleEntry> |
A chain of inherited styles (from the immediate node parent up to the DOM tree root). |
inheritedPseudoElements
(optional) |
array<InheritedPseudoElementMatches> |
A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root). |
cssKeyframesRules
(optional) |
array<CSSKeyframesRule> |
A list of CSS keyframed animations matching this node. |
cssPositionTryRules
(optional) |
array<CSSPositionTryRule> |
A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property. |
activePositionFallbackIndex
(optional) |
integer |
Index of the active fallback in the applied position-try-fallback property, will not be set if there is no active position-try fallback. |
cssPropertyRules
(optional) |
array<CSSPropertyRule> |
A list of CSS at-property rules matching this node. |
cssPropertyRegistrations
(optional) |
array<CSSPropertyRegistration> |
A list of CSS property registrations matching this node. |
cssAtRules
(optional) |
array<CSSAtRule> |
A list of simple @rules matching this node or its pseudo-elements. |
parentLayoutNodeId
(optional) Experimental |
DOM.NodeId |
Id of the first parent element that does not have display: contents. |
cssFunctionRules
(optional) Experimental |
array<CSSFunctionRule> |
A list of CSS at-function rules referenced by styles of this node. |
CSS.getEnvironmentVariables
Experimental Returns the values of the default UA-defined environment variables used in env()
Return Object
| Name | Type | Description |
|---|---|---|
environmentVariables
|
object |
CSS.getMediaQueries
Returns all media queries parsed by the rendering engine.
Return Object
| Name | Type | Description |
|---|---|---|
medias
|
array<CSSMedia> |
CSS.getPlatformFontsForNode
Requests information about platform fonts which we used to render child TextNodes in the given
node.
Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
| Name | Type | Description |
|---|---|---|
fonts
|
array<PlatformFontUsage> |
Usage statistics for every employed platform font. |
CSS.getStyleSheetText
Returns the current textual content for a stylesheet.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
Return Object
| Name | Type | Description |
|---|---|---|
text
|
string |
The stylesheet text. |
CSS.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
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
Return Object
| Name | Type | Description |
|---|---|---|
rootLayer
|
CSSLayerData |
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
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
selectorText
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
ranges
|
array<SourceRange> |
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
| Name | Type | Description |
|---|---|---|
nodeId
(optional) |
DOM.NodeId |
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
| Name | Type | Description |
|---|---|---|
propertiesToTrack
|
array<CSSComputedStyleProperty> |
CSS.takeComputedStyleUpdates
Experimental Polls the next batch of computed style updates.
Return Object
| Name | Type | Description |
|---|---|---|
nodeIds
|
array<DOM.NodeId> |
The list of node Ids that have their tracked computed styles updated. |
CSS.setEffectivePropertyValueForNode
Find a rule with the given active property for the given node and set the new value for this
property
Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
The element id for which to set property. |
propertyName
|
string |
|
value
|
string |
CSS.setPropertyRulePropertyName
Modifies the property rule property name.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
propertyName
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
propertyName
|
Value |
The resulting key text after modification. |
CSS.setKeyframeKey
Modifies the keyframe rule key text.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
keyText
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
keyText
|
Value |
The resulting key text after modification. |
CSS.setMediaText
Modifies the rule selector.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
text
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
media
|
CSSMedia |
The resulting CSS media rule after modification. |
CSS.setContainerQueryText
Experimental Modifies the expression of a container query.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
text
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
containerQuery
|
CSSContainerQuery |
The resulting CSS container query rule after modification. |
CSS.setSupportsText
Experimental Modifies the expression of a supports at-rule.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
text
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
supports
|
CSSSupports |
The resulting CSS Supports rule after modification. |
CSS.setScopeText
Experimental Modifies the expression of a scope at-rule.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
text
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
scope
|
CSSScope |
The resulting CSS Scope rule after modification. |
CSS.setRuleSelector
Modifies the rule selector.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
range
|
SourceRange |
|
selector
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
selectorList
|
SelectorList |
The resulting selector list after modification. |
CSS.setStyleSheetText
Sets the new stylesheet text.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
|
text
|
string |
Return Object
| Name | Type | Description |
|---|---|---|
sourceMapURL
(optional) |
string |
URL of source map associated with script (if any). |
CSS.setStyleTexts
Applies specified style edits one after another in the given order.
Parameters
| Name | Type | Description |
|---|---|---|
edits
|
array<StyleDeclarationEdit> |
|
nodeForPropertySyntaxValidation
(optional) Experimental |
DOM.NodeId |
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
| Name | Type | Description |
|---|---|---|
styles
|
array<CSSStyle> |
The resulting styles after modification. |
CSS.startRuleUsageTracking
Enables the selector recording.
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
coverage
|
array<RuleUsage> |
|
timestamp
|
number |
Monotonically increasing time, in seconds. |
CSS.setLocalFontsEnabled
Experimental Enables/disables rendering of local CSS fonts (enabled by default).
Parameters
| Name | Type | Description |
|---|---|---|
enabled
|
boolean |
Whether rendering of local fonts is enabled. |
Events
CSS.fontsUpdated
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded
web font.
Parameters
| Name | Type | Description |
|---|---|---|
font
(optional) |
FontFace |
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
| Name | Type | Description |
|---|---|---|
header
|
CSSStyleSheetHeader |
Added stylesheet metainfo. |
CSS.styleSheetChanged
Fired whenever a stylesheet is changed as a result of the client operation.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
CSS.styleSheetRemoved
Fired whenever an active document stylesheet is removed.
Parameters
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
Identifier of the removed stylesheet. |
CSS.computedStyleUpdated
Experimental Parameters
| Name | Type | Description |
|---|---|---|
nodeId
|
DOM.NodeId |
The node id that has updated computed styles. |
Types
StyleSheetOrigin
(string)
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.
Allowed Values
injecteduser-agentinspectorregular
PseudoElementMatches
(object)
CSS rule collection for a single pseudo style.
Properties
| Name | Type | Description |
|---|---|---|
pseudoType
|
DOM.PseudoType |
Pseudo element type. |
pseudoIdentifier
(optional) |
string |
Pseudo element custom ident. |
matches
|
array<RuleMatch> |
Matches of CSS rules applicable to the pseudo style. |
CSSAnimationStyle
(object)
CSS style coming from animations with the name of the animation.
Properties
| Name | Type | Description |
|---|---|---|
name
(optional) |
string |
The name of the animation. |
style
|
CSSStyle |
The style coming from the animation. |
InheritedStyleEntry
(object)
Inherited CSS rule collection from ancestor node.
Properties
InheritedAnimatedStyleEntry
(object)
Inherited CSS style collection for animated styles from ancestor node.
Properties
| Name | Type | Description |
|---|---|---|
animationStyles
(optional) |
array<CSSAnimationStyle> |
Styles coming from the animations of the ancestor, if any, in the style inheritance chain. |
transitionsStyle
(optional) |
CSSStyle |
The style coming from the transitions of the ancestor, if any, in the style inheritance chain. |
InheritedPseudoElementMatches
(object)
Inherited pseudo element matches from pseudos of an ancestor node.
Properties
| Name | Type | Description |
|---|---|---|
pseudoElements
|
array<PseudoElementMatches> |
Matches of pseudo styles from the pseudos of an ancestor node. |
Value
(object)
Data for a simple selector (these are delimited by commas in a selector list).
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Value text. |
range
(optional) |
SourceRange |
Value range in the underlying resource (if available). |
specificity
(optional) Experimental |
Specificity |
Specificity of the selector. |
Specificity
(object)
Experimental Specificity:
https://drafts.csswg.org/selectors/#specificity-rules
Properties
| Name | Type | Description |
|---|---|---|
a
|
integer |
The a component, which represents the number of ID selectors. |
b
|
integer |
The b component, which represents the number of class selectors, attributes selectors, and pseudo-classes. |
c
|
integer |
The c component, which represents the number of type selectors and pseudo-elements. |
SelectorList
(object)
Selector list data.
Properties
| Name | Type | Description |
|---|---|---|
selectors
|
array<Value> |
Selectors in the list. |
text
|
string |
Rule selector text. |
CSSStyleSheetHeader
(object)
CSS stylesheet metainformation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
The stylesheet identifier. |
frameId
|
Page.FrameId |
Owner frame identifier. |
sourceURL
|
string |
Stylesheet 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). |
sourceMapURL
(optional) |
string |
URL of source map associated with the stylesheet (if any). |
origin
|
StyleSheetOrigin |
Stylesheet origin. |
title
|
string |
Stylesheet title. |
ownerNode
(optional) |
DOM.BackendNodeId |
The backend id for the owner node of the stylesheet. |
disabled
|
boolean |
Denotes whether the stylesheet is disabled. |
hasSourceURL
(optional) |
boolean |
Whether the sourceURL field value comes from the sourceURL comment. |
isInline
|
boolean |
Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags. |
isMutable
|
boolean |
Whether 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
|
boolean |
True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script. |
startLine
|
number |
Line offset of the stylesheet within the resource (zero based). |
startColumn
|
number |
Column offset of the stylesheet within the resource (zero based). |
length
|
number |
Size of the content (in characters). |
endLine
|
number |
Line offset of the end of the stylesheet within the resource (zero based). |
endColumn
|
number |
Column offset of the end of the stylesheet within the resource (zero based). |
loadingFailed
(optional) Experimental |
boolean |
If the style sheet was loaded from a network resource, this indicates when the resource failed to load |
CSSRule
(object)
CSS rule representation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
selectorList
|
SelectorList |
Rule selector data. |
nestingSelectors
(optional) Experimental |
array<string> |
Array of selectors from ancestor style rules, sorted by distance from the current rule. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
style
|
CSSStyle |
Associated style declaration. |
originTreeScopeNodeId
(optional) Experimental |
DOM.BackendNodeId |
The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule. |
media
(optional) |
array<CSSMedia> |
Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards. |
containerQueries
(optional) Experimental |
array<CSSContainerQuery> |
Container query list array (for rules involving container queries). The array enumerates container queries starting with the innermost one, going outwards. |
supports
(optional) Experimental |
array<CSSSupports> |
@supports CSS at-rule array. The array enumerates @supports at-rules starting with the innermost one, going outwards. |
layers
(optional) Experimental |
array<CSSLayer> |
Cascade layer array. Contains the layer hierarchy that this rule belongs to starting with the innermost layer and going outwards. |
scopes
(optional) Experimental |
array<CSSScope> |
@scope CSS at-rule array. The array enumerates @scope at-rules starting with the innermost one, going outwards. |
ruleTypes
(optional) Experimental |
array<CSSRuleType> |
The array keeps the types of ancestor CSSRules from the innermost going outwards. |
startingStyles
(optional) Experimental |
array<CSSStartingStyle> |
@starting-style CSS at-rule array. The array enumerates @starting-style at-rules starting with the innermost one, going outwards. |
navigations
(optional) Experimental |
array<CSSNavigation> |
@navigation CSS at-rule array. The array enumerates @navigation at-rules starting with the innermost one, going outwards. |
CSSRuleType
(string)
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.
Allowed Values
MediaRuleSupportsRuleContainerRuleLayerRuleScopeRuleStyleRuleStartingStyleRuleNavigationRule
RuleUsage
(object)
CSS coverage information.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
startOffset
|
number |
Offset of the start of the rule (including selector) from the beginning of the stylesheet. |
endOffset
|
number |
Offset of the end of the rule body from the beginning of the stylesheet. |
used
|
boolean |
Indicates whether the rule was actually used by some element in the page. |
SourceRange
(object)
Text range within a resource. All numbers are zero-based.
Properties
| Name | Type | Description |
|---|---|---|
startLine
|
integer |
Start line of range. |
startColumn
|
integer |
Start column of range (inclusive). |
endLine
|
integer |
End line of range |
endColumn
|
integer |
End column of range (exclusive). |
ShorthandEntry
(object)
Properties
| Name | Type | Description |
|---|---|---|
name
|
string |
Shorthand name. |
value
|
string |
Shorthand value. |
important
(optional) |
boolean |
Whether the property has "!important" annotation (implies `false` if absent). |
CSSComputedStyleProperty
(object)
Properties
| Name | Type | Description |
|---|---|---|
name
|
string |
Computed style property name. |
value
|
string |
Computed style property value. |
ComputedStyleExtraFields
(object)
Experimental Properties
| Name | Type | Description |
|---|---|---|
isAppearanceBase
|
boolean |
Returns 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. |
CSSStyle
(object)
CSS style representation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
(optional) |
DOM.StyleSheetId |
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. |
cssText
(optional) |
string |
Style declaration text (if available). |
range
(optional) |
SourceRange |
Style declaration range in the enclosing stylesheet (if available). |
CSSProperty
(object)
CSS property declaration data.
Properties
| Name | Type | Description |
|---|---|---|
name
|
string |
The property name. |
value
|
string |
The property value. |
important
(optional) |
boolean |
Whether the property has "!important" annotation (implies `false` if absent). |
implicit
(optional) |
boolean |
Whether the property is implicit (implies `false` if absent). |
text
(optional) |
string |
The full property text as specified in the style. |
parsedOk
(optional) |
boolean |
Whether the property is understood by the browser (implies `true` if absent). |
disabled
(optional) |
boolean |
Whether the property is disabled by the user (present for source-based properties only). |
range
(optional) |
SourceRange |
The entire property range in the enclosing style declaration (if available). |
longhandProperties
(optional) Experimental |
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. |
CSSMedia
(object)
CSS media rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Media query text. |
source
|
string |
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. |
sourceURL
(optional) |
string |
URL of the document containing the media query description. |
range
(optional) |
SourceRange |
The associated rule (@media or @import) header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
mediaList
(optional) |
array<MediaQuery> |
Array of media queries. |
MediaQuery
(object)
Media query descriptor.
Properties
| Name | Type | Description |
|---|---|---|
expressions
|
array<MediaQueryExpression> |
Array of media query expressions. |
active
|
boolean |
Whether the media query condition is satisfied. |
MediaQueryExpression
(object)
Media query expression descriptor.
Properties
| Name | Type | Description |
|---|---|---|
value
|
number |
Media query expression value. |
unit
|
string |
Media query expression units. |
feature
|
string |
Media query expression feature. |
valueRange
(optional) |
SourceRange |
The associated range of the value text in the enclosing stylesheet (if available). |
computedLength
(optional) |
number |
Computed length of media query expression (if applicable). |
CSSContainerQuery
(object)
Experimental CSS container query rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Container query text. |
range
(optional) |
SourceRange |
The associated rule header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
name
(optional) |
string |
Optional name for the container. |
physicalAxes
(optional) |
DOM.PhysicalAxes |
Optional physical axes queried for the container. |
logicalAxes
(optional) |
DOM.LogicalAxes |
Optional logical axes queried for the container. |
queriesScrollState
(optional) |
boolean |
true if the query contains scroll-state() queries. |
queriesAnchored
(optional) |
boolean |
true if the query contains anchored() queries. |
CSSSupports
(object)
Experimental CSS Supports at-rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Supports rule text. |
active
|
boolean |
Whether the supports condition is satisfied. |
range
(optional) |
SourceRange |
The associated rule header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
CSSScope
(object)
Experimental CSS Scope at-rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Scope rule text. |
range
(optional) |
SourceRange |
The associated rule header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
CSSLayer
(object)
Experimental CSS Layer at-rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
text
|
string |
Layer name. |
range
(optional) |
SourceRange |
The associated rule header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
CSSStartingStyle
(object)
Experimental CSS Starting Style at-rule descriptor.
Properties
| Name | Type | Description |
|---|---|---|
range
(optional) |
SourceRange |
The associated rule header range in the enclosing stylesheet (if available). |
styleSheetId
(optional) |
DOM.StyleSheetId |
Identifier of the stylesheet containing this object (if exists). |
CSSLayerData
(object)
Experimental CSS Layer data.
Properties
| Name | Type | Description |
|---|---|---|
name
|
string |
Layer name. |
subLayers
(optional) |
array<CSSLayerData> |
Direct sub-layers |
order
|
number |
Layer order. The order determines the order of the layer in the cascade order. A higher number has higher priority in the cascade order. |
PlatformFontUsage
(object)
Information about amount of glyphs that were rendered with given font.
Properties
| Name | Type | Description |
|---|---|---|
familyName
|
string |
Font's family name reported by platform. |
postScriptName
|
string |
Font's PostScript name reported by platform. |
isCustomFont
|
boolean |
Indicates if the font was downloaded or resolved locally. |
glyphCount
|
number |
Amount of glyphs that were rendered with this font. |
FontVariationAxis
(object)
Information about font variation axes for variable fonts
Properties
| Name | Type | Description |
|---|---|---|
tag
|
string |
The font-variation-setting tag (a.k.a. "axis tag"). |
name
|
string |
Human-readable variation name in the default language (normally, "en"). |
minValue
|
number |
The minimum value (inclusive) the font supports for this tag. |
maxValue
|
number |
The maximum value (inclusive) the font supports for this tag. |
defaultValue
|
number |
The default value. |
FontFace
(object)
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.
Properties
| Name | Type | Description |
|---|---|---|
fontFamily
|
string |
The font-family. |
fontStyle
|
string |
The font-style. |
fontVariant
|
string |
The font-variant. |
fontWeight
|
string |
The font-weight. |
fontStretch
|
string |
The font-stretch. |
fontDisplay
|
string |
The font-display. |
unicodeRange
|
string |
The unicode-range. |
src
|
string |
The src. |
platformFontFamily
|
string |
The resolved platform font family |
fontVariationAxes
(optional) |
array<FontVariationAxis> |
Available variation settings (a.k.a. "axes"). |
CSSTryRule
(object)
CSS try rule representation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
style
|
CSSStyle |
Associated style declaration. |
CSSPositionTryRule
(object)
CSS @position-try rule representation.
Properties
| Name | Type | Description |
|---|---|---|
name
|
Value |
The prelude dashed-ident name |
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
style
|
CSSStyle |
Associated style declaration. |
active
|
boolean |
CSSKeyframesRule
(object)
CSS keyframes rule representation.
Properties
| Name | Type | Description |
|---|---|---|
animationName
|
Value |
Animation name. |
keyframes
|
array<CSSKeyframeRule> |
List of keyframes. |
CSSPropertyRegistration
(object)
Representation of a custom property registration through CSS.registerProperty
Properties
| Name | Type | Description |
|---|---|---|
propertyName
|
string |
|
initialValue
(optional) |
Value |
|
inherits
|
boolean |
|
syntax
|
string |
CSSAtRule
(object)
CSS generic @rule representation.
Properties
| Name | Type | Description |
|---|---|---|
type
|
string |
Type of at-rule. |
subsection
(optional) |
string |
Subsection of font-feature-values, if this is a subsection. |
name
(optional) |
Value |
LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType) Associated name, if applicable. |
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
style
|
CSSStyle |
Associated style declaration. |
CSSPropertyRule
(object)
CSS property at-rule representation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
propertyName
|
Value |
Associated property name. |
style
|
CSSStyle |
Associated style declaration. |
CSSFunctionParameter
(object)
CSS function argument representation.
Properties
| Name | Type | Description |
|---|---|---|
name
|
string |
The parameter name. |
type
|
string |
The parameter type. |
CSSFunctionConditionNode
(object)
CSS function conditional block representation.
Properties
| Name | Type | Description |
|---|---|---|
media
(optional) |
CSSMedia |
Media query for this conditional block. Only one type of condition should be set. |
containerQueries
(optional) |
CSSContainerQuery |
Container query for this conditional block. Only one type of condition should be set. |
supports
(optional) |
CSSSupports |
@supports CSS at-rule condition. Only one type of condition should be set. |
navigation
(optional) |
CSSNavigation |
@navigation condition. Only one type of condition should be set. |
children
|
array<CSSFunctionNode> |
Block body. |
conditionText
|
string |
The condition text. |
CSSFunctionNode
(object)
Section of the body of a CSS function rule.
Properties
| Name | Type | Description |
|---|---|---|
condition
(optional) |
CSSFunctionConditionNode |
A conditional block. If set, style should not be set. |
style
(optional) |
CSSStyle |
Values set by this node. If set, condition should not be set. |
CSSFunctionRule
(object)
CSS function at-rule representation.
Properties
| Name | Type | Description |
|---|---|---|
name
|
Value |
Name of the function. |
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
parameters
|
array<CSSFunctionParameter> |
List of parameters. |
children
|
array<CSSFunctionNode> |
Function body. |
CSSKeyframeRule
(object)
CSS keyframe rule representation.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
(optional) |
DOM.StyleSheetId |
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from. |
origin
|
StyleSheetOrigin |
Parent stylesheet's origin. |
keyText
|
Value |
Associated key text. |
style
|
CSSStyle |
Associated style declaration. |
StyleDeclarationEdit
(object)
A descriptor of operation to mutate style declaration text.
Properties
| Name | Type | Description |
|---|---|---|
styleSheetId
|
DOM.StyleSheetId |
The css style sheet identifier. |
range
|
SourceRange |
The range of the style text in the enclosing stylesheet. |
text
|
string |
New style text. |