CSS
本页面介绍 Lynx DevTool 支持的 CSS CDP domain。
实验性参考
此生成的参考文档仍在完善中。
- CDP events 尚未包含。
- 部分 Lynx 扩展已列出,但尚未提供详细文档。
- 方法说明尚未根据实现自动校验,可能不完整或不准确。
在依赖本参考前,请根据实现及所链接的 upstream CDP reference 验证实际行为。
概览
- 作用域:
instance - CDP domain:CSS
标准方法
- 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 扩展
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
参数
返回字段
无返回字段。
备注
- 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.
示例
Mark selectors as used during tracking
Request: