Lynx

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

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
NameTypeRequiredDescription
selectorarrayNoSelector strings to add to the current CSS rule usage set while CSS rule usage tracking is active.
selector[]stringYesSelector text. The native handler stores the string as-is and later searches for it in the generated stylesheet text.
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:

{
  "id": 1,
  "method": "CSS.updateRuleUsageTracking",
  "params": {
    "selector": ["#app", ".title"]
  }
}
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.