pl.wendigo.chrome.domain.css / CSSDomain

CSSDomain

class CSSDomain (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 getStyleSheet[Text]() methods.

Functions

addRule

fun addRule(input: AddRuleRequest): Single<AddRuleResponse>

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

collectClassNames

fun collectClassNames(input: CollectClassNamesRequest): Single<CollectClassNamesResponse>

Returns all class names from specified stylesheet.

createStyleSheet

fun createStyleSheet(input: CreateStyleSheetRequest): Single<CreateStyleSheetResponse>

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

disable

fun disable(): Single<ResponseFrame>

Disables the CSS agent for the given page.

enable

fun enable(): Single<ResponseFrame>

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.

events

fun events(): Flowable<ProtocolEvent>

Returns flowable capturing all CSS domains events.

fontsUpdated

fun fontsUpdated(): Flowable<FontsUpdatedEvent>

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

fontsUpdatedTimed

fun fontsUpdatedTimed(): Flowable<Timed<FontsUpdatedEvent>>

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

forcePseudoState

fun forcePseudoState(input: ForcePseudoStateRequest): Single<ResponseFrame>

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

getBackgroundColors

fun getBackgroundColors(input: GetBackgroundColorsRequest): Single<GetBackgroundColorsResponse>

getComputedStyleForNode

fun getComputedStyleForNode(input: GetComputedStyleForNodeRequest): Single<GetComputedStyleForNodeResponse>

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

getInlineStylesForNode

fun getInlineStylesForNode(input: GetInlineStylesForNodeRequest): Single<GetInlineStylesForNodeResponse>

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

getMatchedStylesForNode

fun getMatchedStylesForNode(input: GetMatchedStylesForNodeRequest): Single<GetMatchedStylesForNodeResponse>

Returns requested styles for a DOM node identified by nodeId.

getMediaQueries

fun getMediaQueries(): Single<GetMediaQueriesResponse>

Returns all media queries parsed by the rendering engine.

getPlatformFontsForNode

fun getPlatformFontsForNode(input: GetPlatformFontsForNodeRequest): Single<GetPlatformFontsForNodeResponse>

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

getStyleSheetText

fun getStyleSheetText(input: GetStyleSheetTextRequest): Single<GetStyleSheetTextResponse>

Returns the current textual content for a stylesheet.

mediaQueryResultChanged

fun mediaQueryResultChanged(): Flowable<ProtocolEvent>

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

mediaQueryResultChangedTimed

fun mediaQueryResultChangedTimed(): Flowable<Timed<ProtocolEvent>>

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

setEffectivePropertyValueForNode

fun setEffectivePropertyValueForNode(input: SetEffectivePropertyValueForNodeRequest): Single<ResponseFrame>

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

setKeyframeKey

fun setKeyframeKey(input: SetKeyframeKeyRequest): Single<SetKeyframeKeyResponse>

Modifies the keyframe rule key text.

setMediaText

fun setMediaText(input: SetMediaTextRequest): Single<SetMediaTextResponse>

Modifies the rule selector.

setRuleSelector

fun setRuleSelector(input: SetRuleSelectorRequest): Single<SetRuleSelectorResponse>

Modifies the rule selector.

setStyleSheetText

fun setStyleSheetText(input: SetStyleSheetTextRequest): Single<SetStyleSheetTextResponse>

Sets the new stylesheet text.

setStyleTexts

fun setStyleTexts(input: SetStyleTextsRequest): Single<SetStyleTextsResponse>

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

startRuleUsageTracking

fun startRuleUsageTracking(): Single<ResponseFrame>

Enables the selector recording.

stopRuleUsageTracking

fun stopRuleUsageTracking(): Single<StopRuleUsageTrackingResponse>

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

styleSheetAdded

fun styleSheetAdded(): Flowable<StyleSheetAddedEvent>

Fired whenever an active document stylesheet is added.

styleSheetAddedTimed

fun styleSheetAddedTimed(): Flowable<Timed<StyleSheetAddedEvent>>

Fired whenever an active document stylesheet is added.

styleSheetChanged

fun styleSheetChanged(): Flowable<StyleSheetChangedEvent>

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

styleSheetChangedTimed

fun styleSheetChangedTimed(): Flowable<Timed<StyleSheetChangedEvent>>

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

styleSheetRemoved

fun styleSheetRemoved(): Flowable<StyleSheetRemovedEvent>

Fired whenever an active document stylesheet is removed.

styleSheetRemovedTimed

fun styleSheetRemovedTimed(): Flowable<Timed<StyleSheetRemovedEvent>>

Fired whenever an active document stylesheet is removed.

takeCoverageDelta

fun takeCoverageDelta(): Single<TakeCoverageDeltaResponse>

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