Closed Bug 1895176 Opened 1 year ago Closed 9 days ago

Display @position-try rules

Categories

(DevTools :: Inspector: Rules, task, P3)

task

Tracking

(firefox147 fixed, firefox148 fixed)

RESOLVED FIXED
148 Branch
Tracking Status
firefox147 --- fixed
firefox148 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 3 open bugs)

Details

Attachments

(2 files)

Blocks: 1895178

Note that:

The <dashed-ident> specified in the prelude is the rule’s name. If multiple @position-try rules are declared with the same name, the last one in document order "wins".

There's no indication about how this should behave if the rule is in a grouping rule like @media, @container, @layout, @starting-style, or even a regular CSSStyleRule.

Jonathan, am I missing something from the spec, or does it mean that the last @position-try rules in the document always win, no matter if it's nested in another rule?

Flags: needinfo?(jwatt)
Blocks: 1895179
Blocks: 1895207

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)

Jonathan, am I missing something from the spec, or does it mean that the last @position-try rules in the document always win, no matter if it's nested in another rule?

I don't think that would make sense. The spec text just needs to account for these scenarios. I've filed a spec bug at:

https://github.com/w3c/csswg-drafts/issues/11080

Flags: needinfo?(jwatt)
Priority: -- → P3

Adding dependency on Bug 2004036 for now, as adding/modifying declaration from the inspector won't have any effect on the element, which could be surprising for users.
Or we could display the @position-try rule as read-only first, so we do show them in 147 (when we add support for anchor positioning), and then we can have another bug to make those editable once Bug 2004036 is fixed

Depends on: 2004036
No longer depends on: css-anchor-position-1
Blocks: 2004046
No longer depends on: 2004036

In a similar fashion to what we do for @keyframes rules, we collect the different
@position-try rules from the stylesheets of the page, and only return them
when they're actually being used in a position-try-fallback declaration.

For now, we show them as read-only, as updating the declarations of CSSPositionTryRule
is still brittle (see Bug 2004046).

A test is added to cover this.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch

In a similar fashion to what we do for @keyframes rules, we collect the different
@position-try rules from the stylesheets of the page, and only return them
when they're actually being used in a position-try-fallback declaration.

For now, we show them as read-only, as updating the declarations of CSSPositionTryRule
is still brittle (see Bug 2004046).

A test is added to cover this.

Original Revision: https://phabricator.services.mozilla.com/D275075

Attachment #9532272 - Flags: approval-mozilla-beta?
Flags: in-testsuite+
Attachment #9532272 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: