css

package
v0.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 5 Imported by: 8

Documentation

Overview

Package css implements the 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the CSS domain with the connection set to conn.

Types

type AddRuleArgs

type AddRuleArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier where a new rule should be inserted.
	RuleText     string       `json:"ruleText"`     // The text of a new rule.
	Location     SourceRange  `json:"location"`     // Text position of a new rule in the target style sheet.
}

AddRuleArgs represents the arguments for AddRule in the CSS domain.

func NewAddRuleArgs

func NewAddRuleArgs(styleSheetID StyleSheetID, ruleText string, location SourceRange) *AddRuleArgs

NewAddRuleArgs initializes AddRuleArgs with the required arguments.

type AddRuleReply

type AddRuleReply struct {
	Rule Rule `json:"rule"` // The newly created rule.
}

AddRuleReply represents the return values for AddRule in the CSS domain.

type CollectClassNamesArgs

type CollectClassNamesArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
}

CollectClassNamesArgs represents the arguments for CollectClassNames in the CSS domain.

func NewCollectClassNamesArgs

func NewCollectClassNamesArgs(styleSheetID StyleSheetID) *CollectClassNamesArgs

NewCollectClassNamesArgs initializes CollectClassNamesArgs with the required arguments.

type CollectClassNamesReply

type CollectClassNamesReply struct {
	ClassNames []string `json:"classNames"` // Class name list.
}

CollectClassNamesReply represents the return values for CollectClassNames in the CSS domain.

type ComputedStyleProperty

type ComputedStyleProperty struct {
	Name  string `json:"name"`  // Computed style property name.
	Value string `json:"value"` // Computed style property value.
}

ComputedStyleProperty

type ContainerQuery added in v0.32.0

type ContainerQuery struct {
	Text         string        `json:"text"`                   // Container query text.
	Range        *SourceRange  `json:"range,omitempty"`        // The associated rule header range in the enclosing stylesheet (if available).
	StyleSheetID *StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
	Name         *string       `json:"name,omitempty"`         // Optional name for the container.
}

ContainerQuery CSS container query rule descriptor.

Note: This type is experimental.

type CreateStyleSheetArgs

type CreateStyleSheetArgs struct {
	FrameID page.FrameID `json:"frameId"` // Identifier of the frame where "via-inspector" stylesheet should be created.
}

CreateStyleSheetArgs represents the arguments for CreateStyleSheet in the CSS domain.

func NewCreateStyleSheetArgs

func NewCreateStyleSheetArgs(frameID page.FrameID) *CreateStyleSheetArgs

NewCreateStyleSheetArgs initializes CreateStyleSheetArgs with the required arguments.

type CreateStyleSheetReply

type CreateStyleSheetReply struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // Identifier of the created "via-inspector" stylesheet.
}

CreateStyleSheetReply represents the return values for CreateStyleSheet in the CSS domain.

type FontFace added in v0.17.1

type FontFace struct {
	FontFamily         string              `json:"fontFamily"`                  // The font-family.
	FontStyle          string              `json:"fontStyle"`                   // The font-style.
	FontVariant        string              `json:"fontVariant"`                 // The font-variant.
	FontWeight         string              `json:"fontWeight"`                  // The font-weight.
	FontStretch        string              `json:"fontStretch"`                 // The font-stretch.
	UnicodeRange       string              `json:"unicodeRange"`                // The unicode-range.
	Src                string              `json:"src"`                         // The src.
	PlatformFontFamily string              `json:"platformFontFamily"`          // The resolved platform font family
	FontVariationAxes  []FontVariationAxis `json:"fontVariationAxes,omitempty"` // Available variation settings (a.k.a. "axes").
}

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 FontVariationAxis added in v0.31.0

type FontVariationAxis struct {
	Tag          string  `json:"tag"`          // The font-variation-setting tag (a.k.a. "axis tag").
	Name         string  `json:"name"`         // Human-readable variation name in the default language (normally, "en").
	MinValue     float64 `json:"minValue"`     // The minimum value (inclusive) the font supports for this tag.
	MaxValue     float64 `json:"maxValue"`     // The maximum value (inclusive) the font supports for this tag.
	DefaultValue float64 `json:"defaultValue"` // The default value.
}

FontVariationAxis Information about font variation axes for variable fonts

type FontsUpdatedClient

type FontsUpdatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FontsUpdatedReply, error)
	rpcc.Stream
}

FontsUpdatedClient is a client for FontsUpdated events. Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font

type FontsUpdatedReply

type FontsUpdatedReply struct {
	Font *FontFace `json:"font,omitempty"` // The web font that has loaded.
}

FontsUpdatedReply is the reply for FontsUpdated events.

type ForcePseudoStateArgs

type ForcePseudoStateArgs struct {
	NodeID              dom.NodeID `json:"nodeId"`              // The element id for which to force the pseudo state.
	ForcedPseudoClasses []string   `json:"forcedPseudoClasses"` // Element pseudo classes to force when computing the element's style.
}

ForcePseudoStateArgs represents the arguments for ForcePseudoState in the CSS domain.

func NewForcePseudoStateArgs

func NewForcePseudoStateArgs(nodeID dom.NodeID, forcedPseudoClasses []string) *ForcePseudoStateArgs

NewForcePseudoStateArgs initializes ForcePseudoStateArgs with the required arguments.

type GetBackgroundColorsArgs

type GetBackgroundColorsArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // Id of the node to get background colors for.
}

GetBackgroundColorsArgs represents the arguments for GetBackgroundColors in the CSS domain.

func NewGetBackgroundColorsArgs

func NewGetBackgroundColorsArgs(nodeID dom.NodeID) *GetBackgroundColorsArgs

NewGetBackgroundColorsArgs initializes GetBackgroundColorsArgs with the required arguments.

type GetBackgroundColorsReply

type GetBackgroundColorsReply struct {
	BackgroundColors   []string `json:"backgroundColors,omitempty"`   // 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   *string  `json:"computedFontSize,omitempty"`   // The computed font size for this node, as a CSS computed value string (e.g. '12px').
	ComputedFontWeight *string  `json:"computedFontWeight,omitempty"` // The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').
}

GetBackgroundColorsReply represents the return values for GetBackgroundColors in the CSS domain.

type GetComputedStyleForNodeArgs

type GetComputedStyleForNodeArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // No description.
}

GetComputedStyleForNodeArgs represents the arguments for GetComputedStyleForNode in the CSS domain.

func NewGetComputedStyleForNodeArgs

func NewGetComputedStyleForNodeArgs(nodeID dom.NodeID) *GetComputedStyleForNodeArgs

NewGetComputedStyleForNodeArgs initializes GetComputedStyleForNodeArgs with the required arguments.

type GetComputedStyleForNodeReply

type GetComputedStyleForNodeReply struct {
	ComputedStyle []ComputedStyleProperty `json:"computedStyle"` // Computed style for the specified DOM node.
}

GetComputedStyleForNodeReply represents the return values for GetComputedStyleForNode in the CSS domain.

type GetInlineStylesForNodeArgs

type GetInlineStylesForNodeArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // No description.
}

GetInlineStylesForNodeArgs represents the arguments for GetInlineStylesForNode in the CSS domain.

func NewGetInlineStylesForNodeArgs

func NewGetInlineStylesForNodeArgs(nodeID dom.NodeID) *GetInlineStylesForNodeArgs

NewGetInlineStylesForNodeArgs initializes GetInlineStylesForNodeArgs with the required arguments.

type GetInlineStylesForNodeReply

type GetInlineStylesForNodeReply struct {
	InlineStyle     *Style `json:"inlineStyle,omitempty"`     // Inline style for the specified DOM node.
	AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
}

GetInlineStylesForNodeReply represents the return values for GetInlineStylesForNode in the CSS domain.

type GetLayersForNodeArgs added in v0.33.0

type GetLayersForNodeArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // No description.
}

GetLayersForNodeArgs represents the arguments for GetLayersForNode in the CSS domain.

func NewGetLayersForNodeArgs added in v0.33.0

func NewGetLayersForNodeArgs(nodeID dom.NodeID) *GetLayersForNodeArgs

NewGetLayersForNodeArgs initializes GetLayersForNodeArgs with the required arguments.

type GetLayersForNodeReply added in v0.33.0

type GetLayersForNodeReply struct {
	RootLayer LayerData `json:"rootLayer"` // No description.
}

GetLayersForNodeReply represents the return values for GetLayersForNode in the CSS domain.

type GetMatchedStylesForNodeArgs

type GetMatchedStylesForNodeArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // No description.
}

GetMatchedStylesForNodeArgs represents the arguments for GetMatchedStylesForNode in the CSS domain.

func NewGetMatchedStylesForNodeArgs

func NewGetMatchedStylesForNodeArgs(nodeID dom.NodeID) *GetMatchedStylesForNodeArgs

NewGetMatchedStylesForNodeArgs initializes GetMatchedStylesForNodeArgs with the required arguments.

type GetMatchedStylesForNodeReply

type GetMatchedStylesForNodeReply struct {
	InlineStyle             *Style                          `json:"inlineStyle,omitempty"`             // Inline style for the specified DOM node.
	AttributesStyle         *Style                          `json:"attributesStyle,omitempty"`         // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
	MatchedCSSRules         []RuleMatch                     `json:"matchedCSSRules,omitempty"`         // CSS rules matching this node, from all applicable stylesheets.
	PseudoElements          []PseudoElementMatches          `json:"pseudoElements,omitempty"`          // Pseudo style matches for this node.
	Inherited               []InheritedStyleEntry           `json:"inherited,omitempty"`               // A chain of inherited styles (from the immediate node parent up to the DOM tree root).
	InheritedPseudoElements []InheritedPseudoElementMatches `json:"inheritedPseudoElements,omitempty"` // A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
	CSSKeyframesRules       []KeyframesRule                 `json:"cssKeyframesRules,omitempty"`       // A list of CSS keyframed animations matching this node.
}

GetMatchedStylesForNodeReply represents the return values for GetMatchedStylesForNode in the CSS domain.

type GetMediaQueriesReply

type GetMediaQueriesReply struct {
	Medias []Media `json:"medias"` // No description.
}

GetMediaQueriesReply represents the return values for GetMediaQueries in the CSS domain.

type GetPlatformFontsForNodeArgs

type GetPlatformFontsForNodeArgs struct {
	NodeID dom.NodeID `json:"nodeId"` // No description.
}

GetPlatformFontsForNodeArgs represents the arguments for GetPlatformFontsForNode in the CSS domain.

func NewGetPlatformFontsForNodeArgs

func NewGetPlatformFontsForNodeArgs(nodeID dom.NodeID) *GetPlatformFontsForNodeArgs

NewGetPlatformFontsForNodeArgs initializes GetPlatformFontsForNodeArgs with the required arguments.

type GetPlatformFontsForNodeReply

type GetPlatformFontsForNodeReply struct {
	Fonts []PlatformFontUsage `json:"fonts"` // Usage statistics for every employed platform font.
}

GetPlatformFontsForNodeReply represents the return values for GetPlatformFontsForNode in the CSS domain.

type GetStyleSheetTextArgs

type GetStyleSheetTextArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
}

GetStyleSheetTextArgs represents the arguments for GetStyleSheetText in the CSS domain.

func NewGetStyleSheetTextArgs

func NewGetStyleSheetTextArgs(styleSheetID StyleSheetID) *GetStyleSheetTextArgs

NewGetStyleSheetTextArgs initializes GetStyleSheetTextArgs with the required arguments.

type GetStyleSheetTextReply

type GetStyleSheetTextReply struct {
	Text string `json:"text"` // The stylesheet text.
}

GetStyleSheetTextReply represents the return values for GetStyleSheetText in the CSS domain.

type InheritedPseudoElementMatches added in v0.33.0

type InheritedPseudoElementMatches struct {
	PseudoElements []PseudoElementMatches `json:"pseudoElements"` // Matches of pseudo styles from the pseudos of an ancestor node.
}

InheritedPseudoElementMatches Inherited pseudo element matches from pseudos of an ancestor node.

type InheritedStyleEntry

type InheritedStyleEntry struct {
	InlineStyle     *Style      `json:"inlineStyle,omitempty"` // The ancestor node's inline style, if any, in the style inheritance chain.
	MatchedCSSRules []RuleMatch `json:"matchedCSSRules"`       // Matches of CSS rules matching the ancestor node in the style inheritance chain.
}

InheritedStyleEntry Inherited CSS rule collection from ancestor node.

type KeyframeRule

type KeyframeRule struct {
	StyleSheetID *StyleSheetID    `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	Origin       StyleSheetOrigin `json:"origin"`                 // Parent stylesheet's origin.
	KeyText      Value            `json:"keyText"`                // Associated key text.
	Style        Style            `json:"style"`                  // Associated style declaration.
}

KeyframeRule CSS keyframe rule representation.

type KeyframesRule

type KeyframesRule struct {
	AnimationName Value          `json:"animationName"` // Animation name.
	Keyframes     []KeyframeRule `json:"keyframes"`     // List of keyframes.
}

KeyframesRule CSS keyframes rule representation.

type Layer added in v0.33.0

type Layer struct {
	Text         string        `json:"text"`                   // Layer name.
	Range        *SourceRange  `json:"range,omitempty"`        // The associated rule header range in the enclosing stylesheet (if available).
	StyleSheetID *StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
}

Layer CSS Layer at-rule descriptor.

Note: This type is experimental.

type LayerData added in v0.33.0

type LayerData struct {
	Name      string      `json:"name"`                // Layer name.
	SubLayers []LayerData `json:"subLayers,omitempty"` // Direct sub-layers
	Order     float64     `json:"order"`               // Layer order. The order determines the order of the layer in the cascade order. A higher number has higher priority in the cascade order.
}

LayerData CSS Layer data.

Note: This type is experimental.

type Media

type Media struct {
	Text string `json:"text"` // Media query text.
	// Source Source of the media query: "mediaRule" if specified by a
	// @media rule, "importRule" if specified by an @import rule,
	// "linkedSheet" if specified by a "media" attribute in a linked
	// stylesheet's LINK tag, "inlineSheet" if specified by a "media"
	// attribute in an inline stylesheet's STYLE tag.
	//
	// Values: "mediaRule", "importRule", "linkedSheet", "inlineSheet".
	Source       string        `json:"source"`
	SourceURL    *string       `json:"sourceURL,omitempty"`    // URL of the document containing the media query description.
	Range        *SourceRange  `json:"range,omitempty"`        // The associated rule (@media or @import) header range in the enclosing stylesheet (if available).
	StyleSheetID *StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
	MediaList    []MediaQuery  `json:"mediaList,omitempty"`    // Array of media queries.
}

Media CSS media rule descriptor.

type MediaQuery

type MediaQuery struct {
	Expressions []MediaQueryExpression `json:"expressions"` // Array of media query expressions.
	Active      bool                   `json:"active"`      // Whether the media query condition is satisfied.
}

MediaQuery Media query descriptor.

type MediaQueryExpression

type MediaQueryExpression struct {
	Value          float64      `json:"value"`                    // Media query expression value.
	Unit           string       `json:"unit"`                     // Media query expression units.
	Feature        string       `json:"feature"`                  // Media query expression feature.
	ValueRange     *SourceRange `json:"valueRange,omitempty"`     // The associated range of the value text in the enclosing stylesheet (if available).
	ComputedLength *float64     `json:"computedLength,omitempty"` // Computed length of media query expression (if applicable).
}

MediaQueryExpression Media query expression descriptor.

type MediaQueryResultChangedClient

type MediaQueryResultChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*MediaQueryResultChangedReply, error)
	rpcc.Stream
}

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

type MediaQueryResultChangedReply

type MediaQueryResultChangedReply struct {
}

MediaQueryResultChangedReply is the reply for MediaQueryResultChanged events.

type PlatformFontUsage

type PlatformFontUsage struct {
	FamilyName   string  `json:"familyName"`   // Font's family name reported by platform.
	IsCustomFont bool    `json:"isCustomFont"` // Indicates if the font was downloaded or resolved locally.
	GlyphCount   float64 `json:"glyphCount"`   // Amount of glyphs that were rendered with this font.
}

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

type Property

type Property struct {
	Name      string       `json:"name"`                // The property name.
	Value     string       `json:"value"`               // The property value.
	Important *bool        `json:"important,omitempty"` // Whether the property has "!important" annotation (implies `false` if absent).
	Implicit  *bool        `json:"implicit,omitempty"`  // Whether the property is implicit (implies `false` if absent).
	Text      *string      `json:"text,omitempty"`      // The full property text as specified in the style.
	ParsedOk  *bool        `json:"parsedOk,omitempty"`  // Whether the property is understood by the browser (implies `true` if absent).
	Disabled  *bool        `json:"disabled,omitempty"`  // Whether the property is disabled by the user (present for source-based properties only).
	Range     *SourceRange `json:"range,omitempty"`     // The entire property range in the enclosing style declaration (if available).
}

Property CSS property declaration data.

type PseudoElementMatches

type PseudoElementMatches struct {
	PseudoType dom.PseudoType `json:"pseudoType"` // Pseudo element type.
	Matches    []RuleMatch    `json:"matches"`    // Matches of CSS rules applicable to the pseudo style.
}

PseudoElementMatches CSS rule collection for a single pseudo style.

type Rule

type Rule struct {
	StyleSheetID *StyleSheetID    `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	SelectorList SelectorList     `json:"selectorList"`           // Rule selector data.
	Origin       StyleSheetOrigin `json:"origin"`                 // Parent stylesheet's origin.
	Style        Style            `json:"style"`                  // Associated style declaration.
	Media        []Media          `json:"media,omitempty"`        // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
	// ContainerQueries Container query list array (for rules involving
	// container queries). The array enumerates container queries starting
	// with the innermost one, going outwards.
	//
	// Note: This property is experimental.
	ContainerQueries []ContainerQuery `json:"containerQueries,omitempty"`
	// Supports @supports CSS at-rule array. The array enumerates
	// @supports at-rules starting with the innermost one, going outwards.
	//
	// Note: This property is experimental.
	Supports []Supports `json:"supports,omitempty"`
	// Layers Cascade layer array. Contains the layer hierarchy that this
	// rule belongs to starting with the innermost layer and going
	// outwards.
	//
	// Note: This property is experimental.
	Layers []Layer `json:"layers,omitempty"`
}

Rule CSS rule representation.

type RuleMatch

type RuleMatch struct {
	Rule              Rule  `json:"rule"`              // CSS rule in the match.
	MatchingSelectors []int `json:"matchingSelectors"` // Matching selector indices in the rule's selectorList selectors (0-based).
}

RuleMatch Match data for a CSS rule.

type RuleUsage

type RuleUsage struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	StartOffset  float64      `json:"startOffset"`  // Offset of the start of the rule (including selector) from the beginning of the stylesheet.
	EndOffset    float64      `json:"endOffset"`    // Offset of the end of the rule body from the beginning of the stylesheet.
	Used         bool         `json:"used"`         // Indicates whether the rule was actually used by some element in the page.
}

RuleUsage CSS coverage information.

type SelectorList

type SelectorList struct {
	Selectors []Value `json:"selectors"` // Selectors in the list.
	Text      string  `json:"text"`      // Rule selector text.
}

SelectorList Selector list data.

type SetContainerQueryTextArgs added in v0.32.0

type SetContainerQueryTextArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Range        SourceRange  `json:"range"`        // No description.
	Text         string       `json:"text"`         // No description.
}

SetContainerQueryTextArgs represents the arguments for SetContainerQueryText in the CSS domain.

func NewSetContainerQueryTextArgs added in v0.32.0

func NewSetContainerQueryTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetContainerQueryTextArgs

NewSetContainerQueryTextArgs initializes SetContainerQueryTextArgs with the required arguments.

type SetContainerQueryTextReply added in v0.32.0

type SetContainerQueryTextReply struct {
	ContainerQuery ContainerQuery `json:"containerQuery"` // The resulting CSS container query rule after modification.
}

SetContainerQueryTextReply represents the return values for SetContainerQueryText in the CSS domain.

type SetEffectivePropertyValueForNodeArgs

type SetEffectivePropertyValueForNodeArgs struct {
	NodeID       dom.NodeID `json:"nodeId"`       // The element id for which to set property.
	PropertyName string     `json:"propertyName"` // No description.
	Value        string     `json:"value"`        // No description.
}

SetEffectivePropertyValueForNodeArgs represents the arguments for SetEffectivePropertyValueForNode in the CSS domain.

func NewSetEffectivePropertyValueForNodeArgs

func NewSetEffectivePropertyValueForNodeArgs(nodeID dom.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeArgs

NewSetEffectivePropertyValueForNodeArgs initializes SetEffectivePropertyValueForNodeArgs with the required arguments.

type SetKeyframeKeyArgs

type SetKeyframeKeyArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Range        SourceRange  `json:"range"`        // No description.
	KeyText      string       `json:"keyText"`      // No description.
}

SetKeyframeKeyArgs represents the arguments for SetKeyframeKey in the CSS domain.

func NewSetKeyframeKeyArgs

func NewSetKeyframeKeyArgs(styleSheetID StyleSheetID, rang SourceRange, keyText string) *SetKeyframeKeyArgs

NewSetKeyframeKeyArgs initializes SetKeyframeKeyArgs with the required arguments.

type SetKeyframeKeyReply

type SetKeyframeKeyReply struct {
	KeyText Value `json:"keyText"` // The resulting key text after modification.
}

SetKeyframeKeyReply represents the return values for SetKeyframeKey in the CSS domain.

type SetLocalFontsEnabledArgs added in v0.31.0

type SetLocalFontsEnabledArgs struct {
	Enabled bool `json:"enabled"` // Whether rendering of local fonts is enabled.
}

SetLocalFontsEnabledArgs represents the arguments for SetLocalFontsEnabled in the CSS domain.

func NewSetLocalFontsEnabledArgs added in v0.31.0

func NewSetLocalFontsEnabledArgs(enabled bool) *SetLocalFontsEnabledArgs

NewSetLocalFontsEnabledArgs initializes SetLocalFontsEnabledArgs with the required arguments.

type SetMediaTextArgs

type SetMediaTextArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Range        SourceRange  `json:"range"`        // No description.
	Text         string       `json:"text"`         // No description.
}

SetMediaTextArgs represents the arguments for SetMediaText in the CSS domain.

func NewSetMediaTextArgs

func NewSetMediaTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetMediaTextArgs

NewSetMediaTextArgs initializes SetMediaTextArgs with the required arguments.

type SetMediaTextReply

type SetMediaTextReply struct {
	Media Media `json:"media"` // The resulting CSS media rule after modification.
}

SetMediaTextReply represents the return values for SetMediaText in the CSS domain.

type SetRuleSelectorArgs

type SetRuleSelectorArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Range        SourceRange  `json:"range"`        // No description.
	Selector     string       `json:"selector"`     // No description.
}

SetRuleSelectorArgs represents the arguments for SetRuleSelector in the CSS domain.

func NewSetRuleSelectorArgs

func NewSetRuleSelectorArgs(styleSheetID StyleSheetID, rang SourceRange, selector string) *SetRuleSelectorArgs

NewSetRuleSelectorArgs initializes SetRuleSelectorArgs with the required arguments.

type SetRuleSelectorReply

type SetRuleSelectorReply struct {
	SelectorList SelectorList `json:"selectorList"` // The resulting selector list after modification.
}

SetRuleSelectorReply represents the return values for SetRuleSelector in the CSS domain.

type SetStyleSheetTextArgs

type SetStyleSheetTextArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Text         string       `json:"text"`         // No description.
}

SetStyleSheetTextArgs represents the arguments for SetStyleSheetText in the CSS domain.

func NewSetStyleSheetTextArgs

func NewSetStyleSheetTextArgs(styleSheetID StyleSheetID, text string) *SetStyleSheetTextArgs

NewSetStyleSheetTextArgs initializes SetStyleSheetTextArgs with the required arguments.

type SetStyleSheetTextReply

type SetStyleSheetTextReply struct {
	SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any).
}

SetStyleSheetTextReply represents the return values for SetStyleSheetText in the CSS domain.

type SetStyleTextsArgs

type SetStyleTextsArgs struct {
	Edits []StyleDeclarationEdit `json:"edits"` // No description.
}

SetStyleTextsArgs represents the arguments for SetStyleTexts in the CSS domain.

func NewSetStyleTextsArgs

func NewSetStyleTextsArgs(edits []StyleDeclarationEdit) *SetStyleTextsArgs

NewSetStyleTextsArgs initializes SetStyleTextsArgs with the required arguments.

type SetStyleTextsReply

type SetStyleTextsReply struct {
	Styles []Style `json:"styles"` // The resulting styles after modification.
}

SetStyleTextsReply represents the return values for SetStyleTexts in the CSS domain.

type SetSupportsTextArgs added in v0.33.0

type SetSupportsTextArgs struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
	Range        SourceRange  `json:"range"`        // No description.
	Text         string       `json:"text"`         // No description.
}

SetSupportsTextArgs represents the arguments for SetSupportsText in the CSS domain.

func NewSetSupportsTextArgs added in v0.33.0

func NewSetSupportsTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetSupportsTextArgs

NewSetSupportsTextArgs initializes SetSupportsTextArgs with the required arguments.

type SetSupportsTextReply added in v0.33.0

type SetSupportsTextReply struct {
	Supports Supports `json:"supports"` // The resulting CSS Supports rule after modification.
}

SetSupportsTextReply represents the return values for SetSupportsText in the CSS domain.

type ShorthandEntry

type ShorthandEntry struct {
	Name      string `json:"name"`                // Shorthand name.
	Value     string `json:"value"`               // Shorthand value.
	Important *bool  `json:"important,omitempty"` // Whether the property has "!important" annotation (implies `false` if absent).
}

ShorthandEntry

type SourceRange

type SourceRange struct {
	StartLine   int `json:"startLine"`   // Start line of range.
	StartColumn int `json:"startColumn"` // Start column of range (inclusive).
	EndLine     int `json:"endLine"`     // End line of range
	EndColumn   int `json:"endColumn"`   // End column of range (exclusive).
}

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

type StopRuleUsageTrackingReply

type StopRuleUsageTrackingReply struct {
	RuleUsage []RuleUsage `json:"ruleUsage"` // No description.
}

StopRuleUsageTrackingReply represents the return values for StopRuleUsageTracking in the CSS domain.

type Style

type Style struct {
	StyleSheetID     *StyleSheetID    `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	CSSProperties    []Property       `json:"cssProperties"`          // CSS properties in the style.
	ShorthandEntries []ShorthandEntry `json:"shorthandEntries"`       // Computed values for all shorthands found in the style.
	CSSText          *string          `json:"cssText,omitempty"`      // Style declaration text (if available).
	Range            *SourceRange     `json:"range,omitempty"`        // Style declaration range in the enclosing stylesheet (if available).
}

Style CSS style representation.

type StyleDeclarationEdit

type StyleDeclarationEdit struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier.
	Range        SourceRange  `json:"range"`        // The range of the style text in the enclosing stylesheet.
	Text         string       `json:"text"`         // New style text.
}

StyleDeclarationEdit A descriptor of operation to mutate style declaration text.

type StyleSheetAddedClient

type StyleSheetAddedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*StyleSheetAddedReply, error)
	rpcc.Stream
}

StyleSheetAddedClient is a client for StyleSheetAdded events. Fired whenever an active document stylesheet is added.

type StyleSheetAddedReply

type StyleSheetAddedReply struct {
	Header StyleSheetHeader `json:"header"` // Added stylesheet metainfo.
}

StyleSheetAddedReply is the reply for StyleSheetAdded events.

type StyleSheetChangedClient

type StyleSheetChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*StyleSheetChangedReply, error)
	rpcc.Stream
}

StyleSheetChangedClient is a client for StyleSheetChanged events. Fired whenever a stylesheet is changed as a result of the client operation.

type StyleSheetChangedReply

type StyleSheetChangedReply struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
}

StyleSheetChangedReply is the reply for StyleSheetChanged events.

type StyleSheetHeader

type StyleSheetHeader struct {
	StyleSheetID  StyleSheetID       `json:"styleSheetId"`           // The stylesheet identifier.
	FrameID       page.FrameID       `json:"frameId"`                // Owner frame identifier.
	SourceURL     string             `json:"sourceURL"`              // Stylesheet resource URL. Empty if this is a constructed stylesheet created using new CSSStyleSheet() (but non-empty if this is a constructed sylesheet imported as a CSS module script).
	SourceMapURL  *string            `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
	Origin        StyleSheetOrigin   `json:"origin"`                 // Stylesheet origin.
	Title         string             `json:"title"`                  // Stylesheet title.
	OwnerNode     *dom.BackendNodeID `json:"ownerNode,omitempty"`    // The backend id for the owner node of the stylesheet.
	Disabled      bool               `json:"disabled"`               // Denotes whether the stylesheet is disabled.
	HasSourceURL  *bool              `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
	IsInline      bool               `json:"isInline"`               // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
	IsMutable     bool               `json:"isMutable"`              // 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 bool               `json:"isConstructed"`          // True if this stylesheet is created through new CSSStyleSheet() or imported as a CSS module script.
	StartLine     float64            `json:"startLine"`              // Line offset of the stylesheet within the resource (zero based).
	StartColumn   float64            `json:"startColumn"`            // Column offset of the stylesheet within the resource (zero based).
	Length        float64            `json:"length"`                 // Size of the content (in characters).
	EndLine       float64            `json:"endLine"`                // Line offset of the end of the stylesheet within the resource (zero based).
	EndColumn     float64            `json:"endColumn"`              // Column offset of the end of the stylesheet within the resource (zero based).
}

StyleSheetHeader CSS stylesheet metainformation.

type StyleSheetID

type StyleSheetID string

StyleSheetID

type StyleSheetOrigin

type StyleSheetOrigin string

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.

const (
	StyleSheetOriginNotSet    StyleSheetOrigin = ""
	StyleSheetOriginInjected  StyleSheetOrigin = "injected"
	StyleSheetOriginUserAgent StyleSheetOrigin = "user-agent"
	StyleSheetOriginInspector StyleSheetOrigin = "inspector"
	StyleSheetOriginRegular   StyleSheetOrigin = "regular"
)

StyleSheetOrigin as enums.

func (StyleSheetOrigin) String

func (e StyleSheetOrigin) String() string

func (StyleSheetOrigin) Valid

func (e StyleSheetOrigin) Valid() bool

type StyleSheetRemovedClient

type StyleSheetRemovedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*StyleSheetRemovedReply, error)
	rpcc.Stream
}

StyleSheetRemovedClient is a client for StyleSheetRemoved events. Fired whenever an active document stylesheet is removed.

type StyleSheetRemovedReply

type StyleSheetRemovedReply struct {
	StyleSheetID StyleSheetID `json:"styleSheetId"` // Identifier of the removed stylesheet.
}

StyleSheetRemovedReply is the reply for StyleSheetRemoved events.

type Supports added in v0.33.0

type Supports struct {
	Text         string        `json:"text"`                   // Supports rule text.
	Active       bool          `json:"active"`                 // Whether the supports condition is satisfied.
	Range        *SourceRange  `json:"range,omitempty"`        // The associated rule header range in the enclosing stylesheet (if available).
	StyleSheetID *StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
}

Supports CSS Supports at-rule descriptor.

Note: This type is experimental.

type TakeComputedStyleUpdatesReply added in v0.31.0

type TakeComputedStyleUpdatesReply struct {
	NodeIDs []dom.NodeID `json:"nodeIds"` // The list of node Ids that have their tracked computed styles updated
}

TakeComputedStyleUpdatesReply represents the return values for TakeComputedStyleUpdates in the CSS domain.

type TakeCoverageDeltaReply

type TakeCoverageDeltaReply struct {
	Coverage  []RuleUsage `json:"coverage"`  // No description.
	Timestamp float64     `json:"timestamp"` // Monotonically increasing time, in seconds.
}

TakeCoverageDeltaReply represents the return values for TakeCoverageDelta in the CSS domain.

type TrackComputedStyleUpdatesArgs added in v0.31.0

type TrackComputedStyleUpdatesArgs struct {
	PropertiesToTrack []ComputedStyleProperty `json:"propertiesToTrack"` // No description.
}

TrackComputedStyleUpdatesArgs represents the arguments for TrackComputedStyleUpdates in the CSS domain.

func NewTrackComputedStyleUpdatesArgs added in v0.31.0

func NewTrackComputedStyleUpdatesArgs(propertiesToTrack []ComputedStyleProperty) *TrackComputedStyleUpdatesArgs

NewTrackComputedStyleUpdatesArgs initializes TrackComputedStyleUpdatesArgs with the required arguments.

type Value

type Value struct {
	Text  string       `json:"text"`            // Value text.
	Range *SourceRange `json:"range,omitempty"` // Value range in the underlying resource (if available).
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL