Skip to main content

Module css

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 ‘getStyleSheetText’ methods.

Structs§

AddRuleParams
Inserts a new rule with the given ‘ruleText’ in a stylesheet with given ‘styleSheetId’, at the position specified by ‘location’.
AddRuleParamsBuilder
AddRuleReturns
Inserts a new rule with the given ‘ruleText’ in a stylesheet with given ‘styleSheetId’, at the position specified by ‘location’.
AddRuleReturnsBuilder
CSSAnimationStyle
CSS style coming from animations with the name of the animation.
CSSAnimationStyleBuilder
CSSAtRule
CSS generic @rule representation.
CSSAtRuleBuilder
CSSComputedStyleProperty
CSSComputedStylePropertyBuilder
CSSContainerQuery
CSS container query rule descriptor.
CSSContainerQueryBuilder
CSSFunctionConditionNode
CSS function conditional block representation.
CSSFunctionConditionNodeBuilder
CSSFunctionNode
Section of the body of a CSS function rule.
CSSFunctionNodeBuilder
CSSFunctionParameter
CSS function argument representation.
CSSFunctionParameterBuilder
CSSFunctionRule
CSS function at-rule representation.
CSSFunctionRuleBuilder
CSSKeyframeRule
CSS keyframe rule representation.
CSSKeyframeRuleBuilder
CSSKeyframesRule
CSS keyframes rule representation.
CSSKeyframesRuleBuilder
CSSLayer
CSS Layer at-rule descriptor.
CSSLayerBuilder
CSSLayerData
CSS Layer data.
CSSLayerDataBuilder
CSSMedia
CSS media rule descriptor.
CSSMediaBuilder
CSSNavigation
CSS Navigation at-rule descriptor.
CSSNavigationBuilder
CSSPositionTryRule
CSS @position-try rule representation.
CSSPositionTryRuleBuilder
CSSProperty
CSS property declaration data.
CSSPropertyBuilder
CSSPropertyRegistration
Representation of a custom property registration through CSS.registerProperty
CSSPropertyRegistrationBuilder
CSSPropertyRule
CSS property at-rule representation.
CSSPropertyRuleBuilder
CSSRule
CSS rule representation.
CSSRuleBuilder
CSSScope
CSS Scope at-rule descriptor.
CSSScopeBuilder
CSSStartingStyle
CSS Starting Style at-rule descriptor.
CSSStartingStyleBuilder
CSSStyle
CSS style representation.
CSSStyleBuilder
CSSStyleSheetHeader
CSS stylesheet metainformation.
CSSStyleSheetHeaderBuilder
CSSSupports
CSS Supports at-rule descriptor.
CSSSupportsBuilder
CSSTryRule
CSS try rule representation.
CSSTryRuleBuilder
CollectClassNamesParams
Returns all class names from specified stylesheet.
CollectClassNamesParamsBuilder
CollectClassNamesReturns
Returns all class names from specified stylesheet.
CollectClassNamesReturnsBuilder
ComputedStyleExtraFields
ComputedStyleExtraFieldsBuilder
CreateStyleSheetParams
Creates a new special “via-inspector” stylesheet in the frame with given ‘frameId’.
CreateStyleSheetParamsBuilder
CreateStyleSheetReturns
Creates a new special “via-inspector” stylesheet in the frame with given ‘frameId’.
CreateStyleSheetReturnsBuilder
DisableParams
EnableParams
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.
FontFaceBuilder
FontVariationAxis
Information about font variation axes for variable fonts
FontVariationAxisBuilder
ForcePseudoStateParams
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
ForcePseudoStateParamsBuilder
ForceStartingStyleParams
Ensures that the given node is in its starting-style state.
ForceStartingStyleParamsBuilder
GetAnimatedStylesForNodeParams
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
GetAnimatedStylesForNodeParamsBuilder
GetAnimatedStylesForNodeReturns
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
GetAnimatedStylesForNodeReturnsBuilder
GetBackgroundColorsParams
GetBackgroundColorsParamsBuilder
GetBackgroundColorsReturns
GetBackgroundColorsReturnsBuilder
GetComputedStyleForNodeParams
Returns the computed style for a DOM node identified by ‘nodeId’.
GetComputedStyleForNodeParamsBuilder
GetComputedStyleForNodeReturns
Returns the computed style for a DOM node identified by ‘nodeId’.
GetComputedStyleForNodeReturnsBuilder
GetEnvironmentVariablesParams
GetEnvironmentVariablesReturns
Returns the values of the default UA-defined environment variables used in env()
GetEnvironmentVariablesReturnsBuilder
GetInlineStylesForNodeParams
Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM attributes) for a DOM node identified by ‘nodeId’.
GetInlineStylesForNodeParamsBuilder
GetInlineStylesForNodeReturns
Returns the styles defined inline (explicitly in the “style” attribute and implicitly, using DOM attributes) for a DOM node identified by ‘nodeId’.
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.
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.
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.
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.
GetLocationForSelectorReturnsBuilder
GetLonghandPropertiesParams
GetLonghandPropertiesParamsBuilder
GetLonghandPropertiesReturns
GetLonghandPropertiesReturnsBuilder
GetMatchedStylesForNodeParams
Returns requested styles for a DOM node identified by ‘nodeId’.
GetMatchedStylesForNodeParamsBuilder
GetMatchedStylesForNodeReturns
Returns requested styles for a DOM node identified by ‘nodeId’.
GetMatchedStylesForNodeReturnsBuilder
GetMediaQueriesParams
GetMediaQueriesReturns
Returns all media queries parsed by the rendering engine.
GetMediaQueriesReturnsBuilder
GetPlatformFontsForNodeParams
Requests information about platform fonts which we used to render child TextNodes in the given node.
GetPlatformFontsForNodeParamsBuilder
GetPlatformFontsForNodeReturns
Requests information about platform fonts which we used to render child TextNodes in the given node.
GetPlatformFontsForNodeReturnsBuilder
GetStyleSheetTextParams
Returns the current textual content for a stylesheet.
GetStyleSheetTextParamsBuilder
GetStyleSheetTextReturns
Returns the current textual content for a stylesheet.
GetStyleSheetTextReturnsBuilder
InheritedAnimatedStyleEntry
Inherited CSS style collection for animated styles from ancestor node.
InheritedAnimatedStyleEntryBuilder
InheritedPseudoElementMatches
Inherited pseudo element matches from pseudos of an ancestor node.
InheritedPseudoElementMatchesBuilder
InheritedStyleEntry
Inherited CSS rule collection from ancestor node.
InheritedStyleEntryBuilder
MediaQuery
Media query descriptor.
MediaQueryBuilder
MediaQueryExpression
Media query expression descriptor.
MediaQueryExpressionBuilder
PlatformFontUsage
Information about amount of glyphs that were rendered with given font.
PlatformFontUsageBuilder
ProtocolValue
Data for a simple selector (these are delimited by commas in a selector list).
ProtocolValueBuilder
PseudoElementMatches
CSS rule collection for a single pseudo style.
PseudoElementMatchesBuilder
ResolveValuesParams
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.’
ResolveValuesParamsBuilder
ResolveValuesReturns
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.’
ResolveValuesReturnsBuilder
RuleMatch
Match data for a CSS rule.
RuleMatchBuilder
RuleUsage
CSS coverage information.
RuleUsageBuilder
SelectorList
Selector list data.
SelectorListBuilder
SetContainerQueryTextParams
Modifies the expression of a container query.
SetContainerQueryTextParamsBuilder
SetContainerQueryTextReturns
Modifies the expression of a container query.
SetContainerQueryTextReturnsBuilder
SetEffectivePropertyValueForNodeParams
Find a rule with the given active property for the given node and set the new value for this property
SetEffectivePropertyValueForNodeParamsBuilder
SetKeyframeKeyParams
Modifies the keyframe rule key text.
SetKeyframeKeyParamsBuilder
SetKeyframeKeyReturns
Modifies the keyframe rule key text.
SetKeyframeKeyReturnsBuilder
SetLocalFontsEnabledParams
Enables/disables rendering of local CSS fonts (enabled by default).
SetLocalFontsEnabledParamsBuilder
SetMediaTextParams
Modifies the rule selector.
SetMediaTextParamsBuilder
SetMediaTextReturns
Modifies the rule selector.
SetMediaTextReturnsBuilder
SetNavigationTextParams
Modifies the expression of a navigation at-rule.
SetNavigationTextParamsBuilder
SetNavigationTextReturns
Modifies the expression of a navigation at-rule.
SetNavigationTextReturnsBuilder
SetPropertyRulePropertyNameParams
Modifies the property rule property name.
SetPropertyRulePropertyNameParamsBuilder
SetPropertyRulePropertyNameReturns
Modifies the property rule property name.
SetPropertyRulePropertyNameReturnsBuilder
SetRuleSelectorParams
Modifies the rule selector.
SetRuleSelectorParamsBuilder
SetRuleSelectorReturns
Modifies the rule selector.
SetRuleSelectorReturnsBuilder
SetScopeTextParams
Modifies the expression of a scope at-rule.
SetScopeTextParamsBuilder
SetScopeTextReturns
Modifies the expression of a scope at-rule.
SetScopeTextReturnsBuilder
SetStyleSheetTextParams
Sets the new stylesheet text.
SetStyleSheetTextParamsBuilder
SetStyleSheetTextReturns
Sets the new stylesheet text.
SetStyleSheetTextReturnsBuilder
SetStyleTextsParams
Applies specified style edits one after another in the given order.
SetStyleTextsParamsBuilder
SetStyleTextsReturns
Applies specified style edits one after another in the given order.
SetStyleTextsReturnsBuilder
SetSupportsTextParams
Modifies the expression of a supports at-rule.
SetSupportsTextParamsBuilder
SetSupportsTextReturns
Modifies the expression of a supports at-rule.
SetSupportsTextReturnsBuilder
ShorthandEntry
ShorthandEntryBuilder
SourceRange
Text range within a resource. All numbers are zero-based.
SourceRangeBuilder
Specificity
Specificity: https://drafts.csswg.org/selectors/#specificity-rules
SpecificityBuilder
StartRuleUsageTrackingParams
StopRuleUsageTrackingParams
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).
StopRuleUsageTrackingReturnsBuilder
StyleDeclarationEdit
A descriptor of operation to mutate style declaration text.
StyleDeclarationEditBuilder
TakeComputedStyleUpdatesParams
TakeComputedStyleUpdatesReturns
Polls the next batch of computed style updates.
TakeComputedStyleUpdatesReturnsBuilder
TakeCoverageDeltaParams
TakeCoverageDeltaReturns
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).
TakeCoverageDeltaReturnsBuilder
TrackComputedStyleUpdatesForNodeParams
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.
TrackComputedStyleUpdatesForNodeParamsBuilder
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.
TrackComputedStyleUpdatesParamsBuilder

Enums§

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.