Closed Bug 1925802 Opened 1 year ago Closed 3 months ago

Support resolution of `anchor()` and `anchor-size()` in getComputedStyle

Categories

(Core :: Layout: Positioned, enhancement, P3)

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jwatt, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This won't magically just work. We'll need to pass a bunch of information to resolve the functions against, possibly caching that information so that it's available.

Whiteboard: [anchorpositioning:triage] → [anchorpositioning:reserve]
Assignee: nobody → dshin

This is fun for e.g. max-size: calc(1% + anchor-size(width, 1px)) - we need to resolve the anchor-size portion without resolving the percentage, because its computed value stays in the percentage form. i.e. The example should serialize to max-size: calc(1% + 1px)

A good next step here would be to go through the tests to determine how thorough Chrome's support is:

https://searchfox.org/mozilla-central/search?q=getComputedStyle&path=testing%2Fweb-platform%2F**%2Fcss%2Fcss-anchor-position%2F

For example, currently there are no tests involving calc() or percentage values. What does Chrome do for such values? How complete do we need to be for a first release?

True - Testcase attached. Chrome outputs the same computed value calc(1% + 1px) for these.

Whiteboard: [anchorpositioning:reserve] → [anchorpositioning:pickup]
Whiteboard: [anchorpositioning:pickup] → [anchorpositioning:m1][anchorpositioning:pickup]
Whiteboard: [anchorpositioning:m1][anchorpositioning:pickup] → [anchorpositioning:reserve][anchorpositioning:pickup]
Assignee: dshin → nobody
Whiteboard: [anchorpositioning:reserve][anchorpositioning:pickup] → [anchorpositioning:m2][anchorpositioning:pickup]

FWIW, this seems to work now with pref on, and since Bug 1973507 we don't do another anchor lookup.
I still don't think there are WPT tests covering the attached test case, though.

Given the attached test case now works, and they do an identical resolution to actual anchor positioning, I feel it's safe to close this out as already done.

Agreed.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → WORKSFORME
Whiteboard: [anchorpositioning:m2][anchorpositioning:pickup]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: