public interface CSS
| Modifier and Type | Method and Description |
|---|---|
CSSRule |
addRule(String styleSheetId,
String ruleText,
SourceRange location)
Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the
position specified by `location`.
|
List<String> |
collectClassNames(String styleSheetId)
Returns all class names from specified stylesheet.
|
String |
createStyleSheet(String frameId)
Creates a new special "via-inspector" stylesheet in the frame with given `frameId`.
|
void |
disable()
Disables the CSS agent for the given page.
|
void |
enable()
Enables the CSS agent for the given page.
|
void |
forcePseudoState(Integer nodeId,
List<String> forcedPseudoClasses)
Ensures that the given node will have specified pseudo-classes whenever its style is computed
by the browser.
|
BackgroundColors |
getBackgroundColors(Integer nodeId) |
List<CSSComputedStyleProperty> |
getComputedStyleForNode(Integer nodeId)
Returns the computed style for a DOM node identified by `nodeId`.
|
InlineStylesForNode |
getInlineStylesForNode(Integer nodeId)
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using
DOM attributes) for a DOM node identified by `nodeId`.
|
MatchedStylesForNode |
getMatchedStylesForNode(Integer nodeId)
Returns requested styles for a DOM node identified by `nodeId`.
|
List<CSSMedia> |
getMediaQueries()
Returns all media queries parsed by the rendering engine.
|
List<PlatformFontUsage> |
getPlatformFontsForNode(Integer nodeId)
Requests information about platform fonts which we used to render child TextNodes in the given
node.
|
String |
getStyleSheetText(String styleSheetId)
Returns the current textual content for a stylesheet.
|
EventListener |
onFontsUpdated(EventHandler<FontsUpdated> eventListener)
Fires whenever a web font is updated.
|
EventListener |
onMediaQueryResultChanged(EventHandler<MediaQueryResultChanged> eventListener)
Fires whenever a MediaQuery result changes (for example, after a browser window has been
resized.) The current implementation considers only viewport-dependent media features.
|
EventListener |
onStyleSheetAdded(EventHandler<StyleSheetAdded> eventListener)
Fired whenever an active document stylesheet is added.
|
EventListener |
onStyleSheetChanged(EventHandler<StyleSheetChanged> eventListener)
Fired whenever a stylesheet is changed as a result of the client operation.
|
EventListener |
onStyleSheetRemoved(EventHandler<StyleSheetRemoved> eventListener)
Fired whenever an active document stylesheet is removed.
|
void |
setEffectivePropertyValueForNode(Integer nodeId,
String propertyName,
String value)
Find a rule with the given active property for the given node and set the new value for this
property
|
Value |
setKeyframeKey(String styleSheetId,
SourceRange range,
String keyText)
Modifies the keyframe rule key text.
|
CSSMedia |
setMediaText(String styleSheetId,
SourceRange range,
String text)
Modifies the rule selector.
|
SelectorList |
setRuleSelector(String styleSheetId,
SourceRange range,
String selector)
Modifies the rule selector.
|
String |
setStyleSheetText(String styleSheetId,
String text)
Sets the new stylesheet text.
|
List<CSSStyle> |
setStyleTexts(List<StyleDeclarationEdit> edits)
Applies specified style edits one after another in the given order.
|
void |
startRuleUsageTracking()
Enables the selector recording.
|
List<RuleUsage> |
stopRuleUsageTracking()
Stop tracking rule usage and return the list of rules that were used since last call to
`takeCoverageDelta` (or since start of coverage instrumentation)
|
List<RuleUsage> |
takeCoverageDelta()
Obtain list of rules that became used since last call to this method (or since start of
coverage instrumentation)
|
CSSRule addRule(String styleSheetId, String ruleText, SourceRange location)
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.List<String> collectClassNames(String styleSheetId)
styleSheetId - String createStyleSheet(String frameId)
frameId - Identifier of the frame where "via-inspector" stylesheet should be created.void disable()
void enable()
void forcePseudoState(Integer nodeId, List<String> forcedPseudoClasses)
nodeId - The element id for which to force the pseudo state.forcedPseudoClasses - Element pseudo classes to force when computing the element's style.BackgroundColors getBackgroundColors(Integer nodeId)
nodeId - Id of the node to get background colors for.List<CSSComputedStyleProperty> getComputedStyleForNode(Integer nodeId)
nodeId - InlineStylesForNode getInlineStylesForNode(Integer nodeId)
nodeId - MatchedStylesForNode getMatchedStylesForNode(Integer nodeId)
nodeId - List<CSSMedia> getMediaQueries()
List<PlatformFontUsage> getPlatformFontsForNode(Integer nodeId)
nodeId - String getStyleSheetText(String styleSheetId)
styleSheetId - void setEffectivePropertyValueForNode(Integer nodeId, String propertyName, String value)
nodeId - The element id for which to set property.propertyName - value - Value setKeyframeKey(String styleSheetId, SourceRange range, String keyText)
styleSheetId - range - keyText - CSSMedia setMediaText(String styleSheetId, SourceRange range, String text)
styleSheetId - range - text - SelectorList setRuleSelector(String styleSheetId, SourceRange range, String selector)
styleSheetId - range - selector - String setStyleSheetText(String styleSheetId, String text)
styleSheetId - text - List<CSSStyle> setStyleTexts(List<StyleDeclarationEdit> edits)
edits - void startRuleUsageTracking()
List<RuleUsage> stopRuleUsageTracking()
List<RuleUsage> takeCoverageDelta()
EventListener onFontsUpdated(EventHandler<FontsUpdated> eventListener)
EventListener onMediaQueryResultChanged(EventHandler<MediaQueryResultChanged> eventListener)
EventListener onStyleSheetAdded(EventHandler<StyleSheetAdded> eventListener)
EventListener onStyleSheetChanged(EventHandler<StyleSheetChanged> eventListener)
EventListener onStyleSheetRemoved(EventHandler<StyleSheetRemoved> eventListener)
Copyright © 2020. All rights reserved.