Closed Bug 1962598 Opened 8 months ago Closed 3 months ago

Implement custom `@position-try` fallback support for position-try-fallbacks

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Points:
3

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: jari, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete, Whiteboard: [anchorpositioning:m2], [wptsync upstream])

Attachments

(1 file)

Position-try fallbacks accept a dashed identifier referring to a position-try option containing position property alternatives. https://drafts.csswg.org/css-anchor-position-1/#position-try-fallbacks The feature is not exclusive to anchor positioned elements.

For a basic implementation, the supported position-try properties may include inset properties, margin properties, sizing properties and self-alignment properties, and not include position-anchor and position-area properties, which require anchor positioning.

Position-try order and try-tactics features are excluded from the scope of this bug. Invalidation (e.g. when fallbacks get scrolled out of view) is also out of scope.

After this bug is complete, the test position-try-fallbacks-limit.html
should pass.

No longer depends on: 1962480
Whiteboard: [anchorpositioning:triage] → [anchorpositioning:m2]
Blocks: 1987954
No longer blocks: 1909345
Summary: Implement basic dashed-ident support for position-try-fallbacks → Implement custom `@position-try` fallback support for position-try-fallbacks
Type: task → enhancement
Assignee: jjalkanen → nobody

Jari is going to be working on bug 1924210 / bug 1928128.

Whiteboard: [anchorpositioning:m2] → [anchorpositioning:triage]

Breakdown, drawing a parallel with @keyframe:

  • Save @position-try data in CacadeData: 1, 2
  • Implement lookup for @position-try declarations by name in Stylist: 1
  • Implement declaration -> computed value conversion 1
  • Expose to layout: 1
  • Trigger reflow using overridden values (Something smiliar to this)
  • Ensure that getComptuedStyle reflects the used value based on the selected fallback.
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Status: NEW → ASSIGNED
Points: --- → 5
Whiteboard: [anchorpositioning:triage] → [anchorpositioning:m2]
Depends on: 1989922
Blocks: 1987957
Depends on: 1987959
Depends on: 1991706
Depends on: 1991989
Points: 5 → 3
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9903a171b5ef https://hg.mozilla.org/integration/autoland/rev/dd81e48aa0f0 Implement full @position-try fallback for anchor positioning. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/13f52674383b https://hg.mozilla.org/integration/autoland/rev/a6531711d24c 1992124: apply code formatting via Lando
Flags: needinfo?(emilio)

Backed out for causing wpt failures.

Attachment #9517766 - Attachment description: Bug 1962598 - Implement full @position-try fallback for anchor positioning. r=#anchor-pos,#layout → Bug 1962598 - Implement full @position-try fallback for anchor positioning. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f9637192c040 https://hg.mozilla.org/integration/autoland/rev/f08b02209552 Implement full @position-try fallback for anchor positioning. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/f425f91079b9 https://hg.mozilla.org/integration/autoland/rev/9332758579d0 1992124: apply code formatting via Lando
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/55227 for changes under testing/web-platform/tests
Whiteboard: [anchorpositioning:m2] → [anchorpositioning:m2], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot
Blocks: 1992837
Keywords: dev-doc-needed
QA Whiteboard: [qa-triage-done-c146/b145]

Hi all. I'm currently documenting this on MDN. I'm testing it with the examples available at:

The fallbacks stuff seems really quite broken in Firefox (I'm using Nightly). Is there a pref I need to turn on for this?

They work better in Chrome, but the behavior is still a bit strange. I'm wondering if the behavior has changed since I first documented these? Maybe I need to rewrite the examples so that they work better in general.

Blocks: 2004339
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: