Closed Bug 1731612 Opened 3 years ago Closed 2 years ago

Display layer name before rule location in the rule view

Categories

(DevTools :: Inspector: Rules, enhancement)

enhancement

Tracking

(firefox98+ fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 + fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

CSS Layers are being implemented (behind a pref at the moment), and it would be nice if we could show some information in the inspector for rules which are inside a @layer block

If you open the inspector on https://ffx-devtools-layers.glitch.me/ and inspect the h1 element, the rule view does show the applied rule (the one in the layer block) properly, but we don't surface that information.

We should probably append something before the location, like we do for rules in media query (so we would show @layer override style.css)

Blocks: 1731615
Component: Inspector → Inspector: Rules

In a similar fashion that what we have for media queries in devtools/server/actors/style-rule.js#327, we could get the CSSLayerBlockRule.name property (see https://www.w3.org/TR/css-cascade-5/#the-csslayerblockrule-interface)
Note that the name property can be an empty string if the layer is anonymous.

At the moment, the rule.type property for a layer rule is 0 (which I'm not sure is wanted?), and unlike for the other rule types, we don't have a constant on the CSSRule to expose it (see https://searchfox.org/mozilla-central/rev/7d17fd1fe9f0005a2fb19e5d53da4741b06a98ba/dom/webidl/CSSRule.webidl#18-23,27,36-37,42,47,53,58)
I'll open a dedicated bug for this.

type is deprecated (see Bug 1746876), we can use ChromeUtils.getClassName instead to identify @layer blocks

Depends on: 1746876
Depends on: 1747195
Depends on: 1751417
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8455cecbd0d9
[devtools] Display layer name in the rule view. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Regressions: 1752660
Depends on: 1788030
No longer depends on: 1788030
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: