Skip to content

feat: add CSS cascade layers support to Styles pane - #134

Draft
shangguan2024 wants to merge 1 commit into
lynx-family:mainfrom
shangguan2024:feat/css-cascade-layers
Draft

feat: add CSS cascade layers support to Styles pane#134
shangguan2024 wants to merge 1 commit into
lynx-family:mainfrom
shangguan2024:feat/css-cascade-layers

Conversation

@shangguan2024

@shangguan2024 shangguan2024 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add CSS protocol types and bindings for CSSRule.layers, CSSLayerData, and CSS.getLayersForNode
  • group matched rules by cascade layer in the Styles pane
  • add a CSS Layers tree with navigation from layer separators
  • support named, anonymous, nested, implicit outer, and user-agent layers
  • add build resources, localization, and e2e coverage

Backport notes

This is a manual backport adapted to the older APIs and existing Lynx customizations in this repository:

The backport retains the existing @supports extensions and Lynx-specific code. ToolbarToggle and TreeOutline calls are adapted to this fork's older APIs. Anonymous layer grouping uses stylesheet ranges or stable object IDs so distinct sibling anonymous layers are not merged.

Backend dependency

The inspected backend must populate CSSRule.layers and implement CSS.getLayersForNode. Without those protocol capabilities, the frontend cannot display the complete layer grouping and tree.

Verification

  • full Ninja build: passed
  • TypeScript and bundle generation: passed
  • GRD resource validation: passed
  • targeted JS/CSS lint and JSON validation: passed
  • e2e sources compile; runtime execution is blocked by the existing Styles test suite initialization timeout in the local Chromium/fork combination

Display matched CSS rules grouped by cascade layer and provide a CSS Layers tree view with navigation from layer separators.

Backport notes:

- Protocol definitions and generated bindings are based on ChromeDevTools/devtools-frontend@1ab363b4 (CSSLayer, CSSLayerData, CSSRule.layers and CSS.getLayersForNode).

- SDK, Styles pane grouping, LayersWidget, assets and e2e coverage are based on ChromeDevTools/devtools-frontend@52f5be82.

- Anonymous and implicit layer naming follows ChromeDevTools/devtools-frontend@e573a564.

- The feature is enabled by default, matching the launch change in ChromeDevTools/devtools-frontend@58e3685c.

This is a manual backport rather than a cherry-pick: adapt ToolbarToggle and TreeOutline calls to the older APIs in this fork, retain the existing @supports extensions and Lynx customizations, and update the checked-in protocol bindings without unrelated generator churn.
@shangguan2024

Copy link
Copy Markdown
Contributor Author

@Dango-2021 PTAL.

@shangguan2024
shangguan2024 marked this pull request as draft August 28, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant