CSS

class CSS(cdp: CDP) : 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.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class AddRuleParameter(val styleSheetId: String, val ruleText: String, val location: CSS.SourceRange, val nodeForPropertySyntaxValidation: Int? = null)
Link copied to clipboard
@Serializable
data class AddRuleReturn(val rule: CSS.CSSRule)
Link copied to clipboard
@Serializable
data class CollectClassNamesParameter(val styleSheetId: String)
Link copied to clipboard
@Serializable
data class CollectClassNamesReturn(val classNames: List<String>)
Link copied to clipboard
@Serializable
data class ComputedStyleUpdatedParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class CreateStyleSheetParameter(val frameId: String, val force: Boolean? = null)
Link copied to clipboard
@Serializable
data class CreateStyleSheetReturn(val styleSheetId: String)
Link copied to clipboard
@Serializable
data class CSSAnimationStyle(val name: String? = null, val style: CSS.CSSStyle)

CSS style coming from animations with the name of the animation.

Link copied to clipboard
@Serializable
data class CSSComputedStyleProperty(val name: String, val value: String)
Link copied to clipboard
@Serializable
data class CSSContainerQuery(val text: String, val range: CSS.SourceRange? = null, val styleSheetId: String? = null, val name: String? = null, val physicalAxes: DOM.PhysicalAxes? = null, val logicalAxes: DOM.LogicalAxes? = null, val queriesScrollState: Boolean? = null)

CSS container query rule descriptor.

Link copied to clipboard
@Serializable
data class CSSFontPaletteValuesRule(val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val fontPaletteName: CSS.Value, val style: CSS.CSSStyle)

CSS font-palette-values rule representation.

Link copied to clipboard
@Serializable
data class CSSFunctionConditionNode(val media: CSS.CSSMedia? = null, val containerQueries: CSS.CSSContainerQuery? = null, val supports: CSS.CSSSupports? = null, val children: List<CSS.CSSFunctionNode>, val conditionText: String)

CSS function conditional block representation.

Link copied to clipboard
@Serializable
data class CSSFunctionNode(val condition: CSS.CSSFunctionConditionNode? = null, val style: CSS.CSSStyle? = null)

Section of the body of a CSS function rule.

Link copied to clipboard
@Serializable
data class CSSFunctionParameter(val name: String, val type: String)

CSS function argument representation.

Link copied to clipboard
@Serializable
data class CSSFunctionRule(val name: CSS.Value, val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val parameters: List<CSS.CSSFunctionParameter>, val children: List<CSS.CSSFunctionNode>)

CSS function at-rule representation.

Link copied to clipboard
@Serializable
data class CSSKeyframeRule(val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val keyText: CSS.Value, val style: CSS.CSSStyle)

CSS keyframe rule representation.

Link copied to clipboard
@Serializable
data class CSSKeyframesRule(val animationName: CSS.Value, val keyframes: List<CSS.CSSKeyframeRule>)

CSS keyframes rule representation.

Link copied to clipboard
@Serializable
data class CSSLayer(val text: String, val range: CSS.SourceRange? = null, val styleSheetId: String? = null)

CSS Layer at-rule descriptor.

Link copied to clipboard
@Serializable
data class CSSLayerData(val name: String, val subLayers: List<CSS.CSSLayerData>? = null, val order: Double)

CSS Layer data.

Link copied to clipboard
@Serializable
data class CSSMedia(val text: String, val source: String, val sourceURL: String? = null, val range: CSS.SourceRange? = null, val styleSheetId: String? = null, val mediaList: List<CSS.MediaQuery>? = null)

CSS media rule descriptor.

Link copied to clipboard
@Serializable
data class CSSPositionTryRule(val name: CSS.Value, val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val style: CSS.CSSStyle, val active: Boolean)

CSS @position-try rule representation.

Link copied to clipboard
@Serializable
data class CSSProperty(val name: String, val value: String, val important: Boolean? = null, val implicit: Boolean? = null, val text: String? = null, val parsedOk: Boolean? = null, val disabled: Boolean? = null, val range: CSS.SourceRange? = null, val longhandProperties: List<CSS.CSSProperty>? = null)

CSS property declaration data.

Link copied to clipboard
@Serializable
data class CSSPropertyRegistration(val propertyName: String, val initialValue: CSS.Value? = null, val inherits: Boolean, val syntax: String)

Representation of a custom property registration through CSS.registerProperty

Link copied to clipboard
@Serializable
data class CSSPropertyRule(val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val propertyName: CSS.Value, val style: CSS.CSSStyle)

CSS property at-rule representation.

Link copied to clipboard
@Serializable
data class CSSRule(val styleSheetId: String? = null, val selectorList: CSS.SelectorList, val nestingSelectors: List<String>? = null, val origin: CSS.StyleSheetOrigin, val style: CSS.CSSStyle, val media: List<CSS.CSSMedia>? = null, val containerQueries: List<CSS.CSSContainerQuery>? = null, val supports: List<CSS.CSSSupports>? = null, val layers: List<CSS.CSSLayer>? = null, val scopes: List<CSS.CSSScope>? = null, val ruleTypes: List<CSS.CSSRuleType>? = null, val startingStyles: List<CSS.CSSStartingStyle>? = null)

CSS rule representation.

Link copied to clipboard
@Serializable
enum CSSRuleType : Enum<CSS.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.

Link copied to clipboard
@Serializable
data class CSSScope(val text: String, val range: CSS.SourceRange? = null, val styleSheetId: String? = null)

CSS Scope at-rule descriptor.

Link copied to clipboard
@Serializable
data class CSSStartingStyle(val range: CSS.SourceRange? = null, val styleSheetId: String? = null)

CSS Starting Style at-rule descriptor.

Link copied to clipboard
@Serializable
data class CSSStyle(val styleSheetId: String? = null, val cssProperties: List<CSS.CSSProperty>, val shorthandEntries: List<CSS.ShorthandEntry>, val cssText: String? = null, val range: CSS.SourceRange? = null)

CSS style representation.

Link copied to clipboard
@Serializable
data class CSSStyleSheetHeader(val styleSheetId: String, val frameId: String, val sourceURL: String, val sourceMapURL: String? = null, val origin: CSS.StyleSheetOrigin, val title: String, val ownerNode: Int? = null, val disabled: Boolean, val hasSourceURL: Boolean? = null, val isInline: Boolean, val isMutable: Boolean, val isConstructed: Boolean, val startLine: Double, val startColumn: Double, val length: Double, val endLine: Double, val endColumn: Double, val loadingFailed: Boolean? = null)

CSS stylesheet metainformation.

Link copied to clipboard
@Serializable
data class CSSSupports(val text: String, val active: Boolean, val range: CSS.SourceRange? = null, val styleSheetId: String? = null)

CSS Supports at-rule descriptor.

Link copied to clipboard
@Serializable
data class CSSTryRule(val styleSheetId: String? = null, val origin: CSS.StyleSheetOrigin, val style: CSS.CSSStyle)

CSS try rule representation.

Link copied to clipboard
@Serializable
data class FontFace(val fontFamily: String, val fontStyle: String, val fontVariant: String, val fontWeight: String, val fontStretch: String, val fontDisplay: String, val unicodeRange: String, val src: String, val platformFontFamily: String, val fontVariationAxes: List<CSS.FontVariationAxis>? = null)

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.

Link copied to clipboard
@Serializable
data class FontsUpdatedParameter(val font: CSS.FontFace? = null)

Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font.

Link copied to clipboard
@Serializable
data class FontVariationAxis(val tag: String, val name: String, val minValue: Double, val maxValue: Double, val defaultValue: Double)

Information about font variation axes for variable fonts

Link copied to clipboard
@Serializable
data class ForcePseudoStateParameter(val nodeId: Int, val forcedPseudoClasses: List<String>)
Link copied to clipboard
@Serializable
data class ForceStartingStyleParameter(val nodeId: Int, val forced: Boolean)
Link copied to clipboard
@Serializable
data class GetAnimatedStylesForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetAnimatedStylesForNodeReturn(val animationStyles: List<CSS.CSSAnimationStyle>?, val transitionsStyle: CSS.CSSStyle?, val inherited: List<CSS.InheritedAnimatedStyleEntry>?)
Link copied to clipboard
@Serializable
data class GetBackgroundColorsParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetBackgroundColorsReturn(val backgroundColors: List<String>?, val computedFontSize: String?, val computedFontWeight: String?)
Link copied to clipboard
@Serializable
data class GetComputedStyleForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetComputedStyleForNodeReturn(val computedStyle: List<CSS.CSSComputedStyleProperty>)
Link copied to clipboard
@Serializable
data class GetInlineStylesForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetInlineStylesForNodeReturn(val inlineStyle: CSS.CSSStyle?, val attributesStyle: CSS.CSSStyle?)
Link copied to clipboard
@Serializable
data class GetLayersForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetLayersForNodeReturn(val rootLayer: CSS.CSSLayerData)
Link copied to clipboard
@Serializable
data class GetLocationForSelectorParameter(val styleSheetId: String, val selectorText: String)
Link copied to clipboard
@Serializable
data class GetLocationForSelectorReturn(val ranges: List<CSS.SourceRange>)
Link copied to clipboard
@Serializable
data class GetLonghandPropertiesParameter(val shorthandName: String, val value: String)
Link copied to clipboard
@Serializable
data class GetLonghandPropertiesReturn(val longhandProperties: List<CSS.CSSProperty>)
Link copied to clipboard
@Serializable
data class GetMatchedStylesForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetMatchedStylesForNodeReturn(val inlineStyle: CSS.CSSStyle?, val attributesStyle: CSS.CSSStyle?, val matchedCSSRules: List<CSS.RuleMatch>?, val pseudoElements: List<CSS.PseudoElementMatches>?, val inherited: List<CSS.InheritedStyleEntry>?, val inheritedPseudoElements: List<CSS.InheritedPseudoElementMatches>?, val cssKeyframesRules: List<CSS.CSSKeyframesRule>?, val cssPositionTryRules: List<CSS.CSSPositionTryRule>?, val activePositionFallbackIndex: Int?, val cssPropertyRules: List<CSS.CSSPropertyRule>?, val cssPropertyRegistrations: List<CSS.CSSPropertyRegistration>?, val cssFontPaletteValuesRule: CSS.CSSFontPaletteValuesRule?, val parentLayoutNodeId: Int?, val cssFunctionRules: List<CSS.CSSFunctionRule>?)
Link copied to clipboard
@Serializable
data class GetMediaQueriesReturn(val medias: List<CSS.CSSMedia>)
Link copied to clipboard
@Serializable
data class GetPlatformFontsForNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetPlatformFontsForNodeReturn(val fonts: List<CSS.PlatformFontUsage>)
Link copied to clipboard
@Serializable
data class GetStyleSheetTextParameter(val styleSheetId: String)
Link copied to clipboard
@Serializable
data class GetStyleSheetTextReturn(val text: String)
Link copied to clipboard
@Serializable
data class InheritedAnimatedStyleEntry(val animationStyles: List<CSS.CSSAnimationStyle>? = null, val transitionsStyle: CSS.CSSStyle? = null)

Inherited CSS style collection for animated styles from ancestor node.

Link copied to clipboard
@Serializable
data class InheritedPseudoElementMatches(val pseudoElements: List<CSS.PseudoElementMatches>)

Inherited pseudo element matches from pseudos of an ancestor node.

Link copied to clipboard
@Serializable
data class InheritedStyleEntry(val inlineStyle: CSS.CSSStyle? = null, val matchedCSSRules: List<CSS.RuleMatch>)

Inherited CSS rule collection from ancestor node.

Link copied to clipboard
@Serializable
data class MediaQuery(val expressions: List<CSS.MediaQueryExpression>, val active: Boolean)

Media query descriptor.

Link copied to clipboard
@Serializable
data class MediaQueryExpression(val value: Double, val unit: String, val feature: String, val valueRange: CSS.SourceRange? = null, val computedLength: Double? = null)

Media query expression descriptor.

Link copied to clipboard
@Serializable
data class PlatformFontUsage(val familyName: String, val postScriptName: String, val isCustomFont: Boolean, val glyphCount: Double)

Information about amount of glyphs that were rendered with given font.

Link copied to clipboard
@Serializable
data class PseudoElementMatches(val pseudoType: DOM.PseudoType, val pseudoIdentifier: String? = null, val matches: List<CSS.RuleMatch>)

CSS rule collection for a single pseudo style.

Link copied to clipboard
@Serializable
data class ResolveValuesParameter(val values: List<String>, val nodeId: Int, val propertyName: String? = null, val pseudoType: DOM.PseudoType? = null, val pseudoIdentifier: String? = null)
Link copied to clipboard
@Serializable
data class ResolveValuesReturn(val results: List<String>)
Link copied to clipboard
@Serializable
data class RuleMatch(val rule: CSS.CSSRule, val matchingSelectors: List<Int>)

Match data for a CSS rule.

Link copied to clipboard
@Serializable
data class RuleUsage(val styleSheetId: String, val startOffset: Double, val endOffset: Double, val used: Boolean)

CSS coverage information.

Link copied to clipboard
@Serializable
data class SelectorList(val selectors: List<CSS.Value>, val text: String)

Selector list data.

Link copied to clipboard
@Serializable
data class SetContainerQueryTextParameter(val styleSheetId: String, val range: CSS.SourceRange, val text: String)
Link copied to clipboard
@Serializable
data class SetContainerQueryTextReturn(val containerQuery: CSS.CSSContainerQuery)
@Serializable
data class SetEffectivePropertyValueForNodeParameter(val nodeId: Int, val propertyName: String, val value: String)
Link copied to clipboard
@Serializable
data class SetKeyframeKeyParameter(val styleSheetId: String, val range: CSS.SourceRange, val keyText: String)
Link copied to clipboard
@Serializable
data class SetKeyframeKeyReturn(val keyText: CSS.Value)
Link copied to clipboard
@Serializable
data class SetLocalFontsEnabledParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetMediaTextParameter(val styleSheetId: String, val range: CSS.SourceRange, val text: String)
Link copied to clipboard
@Serializable
data class SetMediaTextReturn(val media: CSS.CSSMedia)
Link copied to clipboard
@Serializable
data class SetPropertyRulePropertyNameParameter(val styleSheetId: String, val range: CSS.SourceRange, val propertyName: String)
Link copied to clipboard
@Serializable
data class SetPropertyRulePropertyNameReturn(val propertyName: CSS.Value)
Link copied to clipboard
@Serializable
data class SetRuleSelectorParameter(val styleSheetId: String, val range: CSS.SourceRange, val selector: String)
Link copied to clipboard
@Serializable
data class SetRuleSelectorReturn(val selectorList: CSS.SelectorList)
Link copied to clipboard
@Serializable
data class SetScopeTextParameter(val styleSheetId: String, val range: CSS.SourceRange, val text: String)
Link copied to clipboard
@Serializable
data class SetScopeTextReturn(val scope: CSS.CSSScope)
Link copied to clipboard
@Serializable
data class SetStyleSheetTextParameter(val styleSheetId: String, val text: String)
Link copied to clipboard
@Serializable
data class SetStyleSheetTextReturn(val sourceMapURL: String?)
Link copied to clipboard
@Serializable
data class SetStyleTextsParameter(val edits: List<CSS.StyleDeclarationEdit>, val nodeForPropertySyntaxValidation: Int? = null)
Link copied to clipboard
@Serializable
data class SetStyleTextsReturn(val styles: List<CSS.CSSStyle>)
Link copied to clipboard
@Serializable
data class SetSupportsTextParameter(val styleSheetId: String, val range: CSS.SourceRange, val text: String)
Link copied to clipboard
@Serializable
data class SetSupportsTextReturn(val supports: CSS.CSSSupports)
Link copied to clipboard
@Serializable
data class ShorthandEntry(val name: String, val value: String, val important: Boolean? = null)
Link copied to clipboard
@Serializable
data class SourceRange(val startLine: Int, val startColumn: Int, val endLine: Int, val endColumn: Int)

Text range within a resource. All numbers are zero-based.

Link copied to clipboard
@Serializable
data class Specificity(val a: Int, val b: Int, val c: Int)

Specificity: https://drafts.csswg.org/selectors/#specificity-rules

Link copied to clipboard
@Serializable
data class StopRuleUsageTrackingReturn(val ruleUsage: List<CSS.RuleUsage>)
Link copied to clipboard
@Serializable
data class StyleDeclarationEdit(val styleSheetId: String, val range: CSS.SourceRange, val text: String)

A descriptor of operation to mutate style declaration text.

Link copied to clipboard
@Serializable
data class StyleSheetAddedParameter(val header: CSS.CSSStyleSheetHeader)

Fired whenever an active document stylesheet is added.

Link copied to clipboard
@Serializable
data class StyleSheetChangedParameter(val styleSheetId: String)

Fired whenever a stylesheet is changed as a result of the client operation.

Link copied to clipboard

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.

Link copied to clipboard
@Serializable
data class StyleSheetRemovedParameter(val styleSheetId: String)

Fired whenever an active document stylesheet is removed.

Link copied to clipboard
@Serializable
data class TakeComputedStyleUpdatesReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class TakeCoverageDeltaReturn(val coverage: List<CSS.RuleUsage>, val timestamp: Double)
@Serializable
data class TrackComputedStyleUpdatesForNodeParameter(val nodeId: Int? = null)
Link copied to clipboard
@Serializable
data class TrackComputedStyleUpdatesParameter(val propertiesToTrack: List<CSS.CSSComputedStyleProperty>)
Link copied to clipboard
@Serializable
data class Value(val text: String, val range: CSS.SourceRange? = null, val specificity: CSS.Specificity? = null)

Data for a simple selector (these are delimited by commas in a selector list).

Properties

Link copied to clipboard

Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font.

Link copied to clipboard

Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.

Link copied to clipboard

Fired whenever an active document stylesheet is added.

Link copied to clipboard

Fired whenever a stylesheet is changed as a result of the client operation.

Link copied to clipboard

Fired whenever an active document stylesheet is removed.

Functions

Link copied to clipboard
suspend fun addRule(args: CSS.AddRuleParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.AddRuleReturn
suspend fun addRule(styleSheetId: String, ruleText: String, location: CSS.SourceRange, nodeForPropertySyntaxValidation: Int? = null): CSS.AddRuleReturn

Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

Link copied to clipboard

Returns all class names from specified stylesheet.

Link copied to clipboard
suspend fun createStyleSheet(frameId: String, force: Boolean? = null): CSS.CreateStyleSheetReturn

Creates a new special "via-inspector" stylesheet in the frame with given frameId.

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables the CSS agent for the given page.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

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.

Link copied to clipboard
suspend fun forcePseudoState(args: CSS.ForcePseudoStateParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun forcePseudoState(nodeId: Int, forcedPseudoClasses: List<String>)

Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.

Link copied to clipboard
suspend fun forceStartingStyle(args: CSS.ForceStartingStyleParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun forceStartingStyle(nodeId: Int, forced: Boolean)

Ensures that the given node is in its starting-style state.

Link copied to clipboard

Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.

Link copied to clipboard

Returns the computed style for a DOM node identified by nodeId.

Link copied to clipboard

Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.

Link copied to clipboard

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.

Link copied to clipboard
suspend fun getLocationForSelector(styleSheetId: String, selectorText: String): CSS.GetLocationForSelectorReturn

Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.

Link copied to clipboard

Returns requested styles for a DOM node identified by nodeId.

Link copied to clipboard
suspend fun getMediaQueries(mode: CommandMode = CommandMode.DEFAULT): CSS.GetMediaQueriesReturn

Returns all media queries parsed by the rendering engine.

Link copied to clipboard

Requests information about platform fonts which we used to render child TextNodes in the given node.

Link copied to clipboard

Returns the current textual content for a stylesheet.

Link copied to clipboard
suspend fun resolveValues(args: CSS.ResolveValuesParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.ResolveValuesReturn
suspend fun resolveValues(values: List<String>, nodeId: Int, propertyName: String? = null, pseudoType: DOM.PseudoType? = null, pseudoIdentifier: String? = null): CSS.ResolveValuesReturn

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.

Link copied to clipboard

Modifies the expression of a container query.

Link copied to clipboard
suspend fun setEffectivePropertyValueForNode(nodeId: Int, propertyName: String, value: String)

Find a rule with the given active property for the given node and set the new value for this property

Link copied to clipboard
suspend fun setKeyframeKey(args: CSS.SetKeyframeKeyParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.SetKeyframeKeyReturn
suspend fun setKeyframeKey(styleSheetId: String, range: CSS.SourceRange, keyText: String): CSS.SetKeyframeKeyReturn

Modifies the keyframe rule key text.

Link copied to clipboard
suspend fun setLocalFontsEnabled(enabled: Boolean)
suspend fun setLocalFontsEnabled(args: CSS.SetLocalFontsEnabledParameter, mode: CommandMode = CommandMode.DEFAULT)

Enables/disables rendering of local CSS fonts (enabled by default).

Link copied to clipboard
suspend fun setMediaText(args: CSS.SetMediaTextParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.SetMediaTextReturn
suspend fun setMediaText(styleSheetId: String, range: CSS.SourceRange, text: String): CSS.SetMediaTextReturn

Modifies the rule selector.

Link copied to clipboard

Modifies the property rule property name.

Link copied to clipboard
suspend fun setRuleSelector(styleSheetId: String, range: CSS.SourceRange, selector: String): CSS.SetRuleSelectorReturn

Modifies the rule selector.

Link copied to clipboard
suspend fun setScopeText(args: CSS.SetScopeTextParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.SetScopeTextReturn
suspend fun setScopeText(styleSheetId: String, range: CSS.SourceRange, text: String): CSS.SetScopeTextReturn

Modifies the expression of a scope at-rule.

Link copied to clipboard
suspend fun setStyleSheetText(styleSheetId: String, text: String): CSS.SetStyleSheetTextReturn

Sets the new stylesheet text.

Link copied to clipboard
suspend fun setStyleTexts(args: CSS.SetStyleTextsParameter, mode: CommandMode = CommandMode.DEFAULT): CSS.SetStyleTextsReturn
suspend fun setStyleTexts(edits: List<CSS.StyleDeclarationEdit>, nodeForPropertySyntaxValidation: Int? = null): CSS.SetStyleTextsReturn

Applies specified style edits one after another in the given order.

Link copied to clipboard
suspend fun setSupportsText(styleSheetId: String, range: CSS.SourceRange, text: String): CSS.SetSupportsTextReturn

Modifies the expression of a supports at-rule.

Link copied to clipboard
suspend fun startRuleUsageTracking(mode: CommandMode = CommandMode.DEFAULT)

Enables the selector recording.

Link copied to clipboard
suspend fun stopRuleUsageTracking(mode: CommandMode = CommandMode.DEFAULT): CSS.StopRuleUsageTrackingReturn

Stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation).

Link copied to clipboard

Polls the next batch of computed style updates.

Link copied to clipboard
suspend fun takeCoverageDelta(mode: CommandMode = CommandMode.DEFAULT): CSS.TakeCoverageDeltaReturn

Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).

Link copied to clipboard
suspend fun trackComputedStyleUpdates(args: CSS.TrackComputedStyleUpdatesParameter, mode: CommandMode = CommandMode.DEFAULT)

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.

Link copied to clipboard
suspend fun trackComputedStyleUpdatesForNode(nodeId: Int? = null)

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.