Chrome Remote Interface v0.2.0 ChromeRemoteInterface.RPC.CSS View Source

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.

Link to this section Summary

Functions

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

Returns all class names from specified stylesheet

Creates a new special “via-inspector” stylesheet in the frame with given frameId

Disables the CSS agent for the given page

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

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

Returns the computed style for a DOM node identified by nodeId

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

Returns requested styles for a DOM node identified by nodeId

Returns all media queries parsed by the rendering engine

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

Returns the current textual content and the URL for a stylesheet

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

Modifies the keyframe rule key text

Modifies the rule selector

Modifies the rule selector

Sets the new stylesheet text

Applies specified style edits one after another in the given order

Enables the selector recording

The list of rules with an indication of whether these were used

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

Link to this section Functions

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

Parameters: styleSheetId - - The css style sheet identifier where a new rule should be inserted.ruleText - - The text of a new rule.location - - Text position of a new rule in the target style sheet.

Link to this function addRule(page_pid, parameters) View Source
Link to this function addRule(page_pid, parameters, opts) View Source
Link to this function collectClassNames(page_pid) View Source

Returns all class names from specified stylesheet.

Parameters: styleSheetId - -

Link to this function collectClassNames(page_pid, parameters) View Source
Link to this function collectClassNames(page_pid, parameters, opts) View Source
Link to this function createStyleSheet(page_pid) View Source

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

Parameters: frameId - - Identifier of the frame where “via-inspector” stylesheet should be created.

Link to this function createStyleSheet(page_pid, parameters) View Source
Link to this function createStyleSheet(page_pid, parameters, opts) View Source

Disables the CSS agent for the given page.

Parameters:

Link to this function disable(page_pid, parameters) View Source
Link to this function disable(page_pid, parameters, opts) View Source

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.

Parameters:

Link to this function enable(page_pid, parameters) View Source
Link to this function enable(page_pid, parameters, opts) View Source
Link to this function forcePseudoState(page_pid) View Source

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

Parameters: nodeId - - The element id for which to force the pseudo state.forcedPseudoClasses - - Element pseudo classes to force when computing the element’s style.

Link to this function forcePseudoState(page_pid, parameters) View Source
Link to this function forcePseudoState(page_pid, parameters, opts) View Source
Link to this function getBackgroundColors(page_pid) View Source

Parameters: nodeId - - Id of the node to get background colors for.

Link to this function getBackgroundColors(page_pid, parameters) View Source
Link to this function getBackgroundColors(page_pid, parameters, opts) View Source
Link to this function getComputedStyleForNode(page_pid) View Source

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

Parameters: nodeId - -

Link to this function getComputedStyleForNode(page_pid, parameters) View Source
Link to this function getComputedStyleForNode(page_pid, parameters, opts) View Source
Link to this function getInlineStylesForNode(page_pid) View Source

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

Parameters: nodeId - -

Link to this function getInlineStylesForNode(page_pid, parameters) View Source
Link to this function getInlineStylesForNode(page_pid, parameters, opts) View Source
Link to this function getMatchedStylesForNode(page_pid) View Source

Returns requested styles for a DOM node identified by nodeId.

Parameters: nodeId - -

Link to this function getMatchedStylesForNode(page_pid, parameters) View Source
Link to this function getMatchedStylesForNode(page_pid, parameters, opts) View Source
Link to this function getMediaQueries(page_pid) View Source

Returns all media queries parsed by the rendering engine.

Parameters:

Link to this function getMediaQueries(page_pid, parameters) View Source
Link to this function getMediaQueries(page_pid, parameters, opts) View Source
Link to this function getPlatformFontsForNode(page_pid) View Source

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

Parameters: nodeId - -

Link to this function getPlatformFontsForNode(page_pid, parameters) View Source
Link to this function getPlatformFontsForNode(page_pid, parameters, opts) View Source
Link to this function getStyleSheetText(page_pid) View Source

Returns the current textual content and the URL for a stylesheet.

Parameters: styleSheetId - -

Link to this function getStyleSheetText(page_pid, parameters) View Source
Link to this function getStyleSheetText(page_pid, parameters, opts) View Source
Link to this function setEffectivePropertyValueForNode(page_pid) View Source

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

Parameters: nodeId - - The element id for which to set property.propertyName - - value - -

Link to this function setEffectivePropertyValueForNode(page_pid, parameters) View Source
Link to this function setEffectivePropertyValueForNode(page_pid, parameters, opts) View Source
Link to this function setKeyframeKey(page_pid) View Source

Modifies the keyframe rule key text.

Parameters: styleSheetId - - range - - keyText - -

Link to this function setKeyframeKey(page_pid, parameters) View Source
Link to this function setKeyframeKey(page_pid, parameters, opts) View Source

Modifies the rule selector.

Parameters: styleSheetId - - range - - text - -

Link to this function setMediaText(page_pid, parameters) View Source
Link to this function setMediaText(page_pid, parameters, opts) View Source
Link to this function setRuleSelector(page_pid) View Source

Modifies the rule selector.

Parameters: styleSheetId - - range - - selector - -

Link to this function setRuleSelector(page_pid, parameters) View Source
Link to this function setRuleSelector(page_pid, parameters, opts) View Source
Link to this function setStyleSheetText(page_pid) View Source

Sets the new stylesheet text.

Parameters: styleSheetId - - text - -

Link to this function setStyleSheetText(page_pid, parameters) View Source
Link to this function setStyleSheetText(page_pid, parameters, opts) View Source

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

Parameters: edits - -

Link to this function setStyleTexts(page_pid, parameters) View Source
Link to this function setStyleTexts(page_pid, parameters, opts) View Source
Link to this function startRuleUsageTracking(page_pid) View Source

Enables the selector recording.

Parameters:

Link to this function startRuleUsageTracking(page_pid, parameters) View Source
Link to this function startRuleUsageTracking(page_pid, parameters, opts) View Source
Link to this function stopRuleUsageTracking(page_pid) View Source

The list of rules with an indication of whether these were used

Parameters:

Link to this function stopRuleUsageTracking(page_pid, parameters) View Source
Link to this function stopRuleUsageTracking(page_pid, parameters, opts) View Source
Link to this function takeCoverageDelta(page_pid) View Source

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

Parameters:

Link to this function takeCoverageDelta(page_pid, parameters) View Source
Link to this function takeCoverageDelta(page_pid, parameters, opts) View Source