public interface CSS
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]()
methodsModifier and Type | Method | Description |
---|---|---|
CSSRule |
addRule(String styleSheetId,
String ruleText,
SourceRange location) |
Inserts a new rule with the given
ruleText in a stylesheet with givenstyleSheetId , 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.
|
GetBackgroundColorsResult |
getBackgroundColors(Integer nodeId) |
|
List<CSSComputedStyleProperty> |
getComputedStyleForNode(Integer nodeId) |
Returns the computed style for a DOM node identified by
nodeId . |
GetInlineStylesForNodeResult |
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 . |
GetMatchedStylesForNodeResult |
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.
|
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)
ruleText
in a stylesheet with givenstyleSheetId
, at the
position specified by 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)
String createStyleSheet(String frameId)
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.GetBackgroundColorsResult getBackgroundColors(Integer nodeId)
List<CSSComputedStyleProperty> getComputedStyleForNode(Integer nodeId)
nodeId
.GetInlineStylesForNodeResult getInlineStylesForNode(Integer nodeId)
nodeId
.GetMatchedStylesForNodeResult getMatchedStylesForNode(Integer nodeId)
nodeId
.List<CSSMedia> getMediaQueries()
List<PlatformFontUsage> getPlatformFontsForNode(Integer nodeId)
String getStyleSheetText(String styleSheetId)
void setEffectivePropertyValueForNode(Integer nodeId, String propertyName, String value)
nodeId
- The element id for which to set property.Value setKeyframeKey(String styleSheetId, SourceRange range, String keyText)
CSSMedia setMediaText(String styleSheetId, SourceRange range, String text)
SelectorList setRuleSelector(String styleSheetId, SourceRange range, String selector)
String setStyleSheetText(String styleSheetId, String text)
List<CSSStyle> setStyleTexts(List<StyleDeclarationEdit> edits)
void startRuleUsageTracking()
List<RuleUsage> stopRuleUsageTracking()
takeCoverageDelta
(or since start of coverage instrumentation)Copyright © 2017, 2018–2018 WebFolder OÜ. All rights reserved.