CSS
This page documents the CSS CDP domain supported by Lynx DevTool.
Experimental reference
This generated reference is still being completed.
- CDP events are not included yet.
- Some Lynx extensions are listed but do not yet have detailed documentation.
- Method descriptions are not automatically verified against the implementation and may be incomplete or inaccurate.
Verify behavior against the implementation and the linked upstream CDP reference before relying on it.
Overview
- Scope:
instance - CDP domain: CSS
Standard Methods
- CSS.addRule
- CSS.createStyleSheet
- CSS.disable
- CSS.enable
- CSS.getBackgroundColors
- CSS.getComputedStyleForNode
- CSS.getInlineStylesForNode
- CSS.getMatchedStylesForNode
- CSS.getMediaQueries
- CSS.getStyleSheetText
- CSS.setMediaText
- CSS.setStyleSheetText
- CSS.setStyleTexts
- CSS.startRuleUsageTracking
- CSS.stopRuleUsageTracking
Lynx Extensions
CSS.updateRuleUsageTracking
Records selectors that should be marked as used by the Lynx CSS rule usage tracker.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_css_agent_ng.cc
Parameters
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
- This method is only effective after CSS.startRuleUsageTracking has enabled rule usage tracking.
- The handler inserts each params.selector item into an in-memory selector set and does not send a CDP response.
- CSS.stopRuleUsageTracking later emits the collected selectors as ruleUsage entries. Each entry contains styleSheetId, startOffset, endOffset, and used.
- When CSS.stopRuleUsageTracking runs with no selectors collected by this method, Lynx falls back to collecting id and class selector usage from the DOM tree.
Examples
Mark selectors as used during tracking
Request: