Closed Bug 1973507 Opened 2 months ago Closed 18 days ago

Track Anchor Positioning anchor names and rects during abspos reflows

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: jwatt, Assigned: dshin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [anchorpositioning:m1])

Attachments

(3 files)

During reflow we want to keep track of the anchors that are used by an Anchor Positioned element, and the rects of those anchors relative to the anchor positioned frame. We'll need suitable invalidation for this cached information.

Whiteboard: [anchorpositioning:triage] → [anchorpositioning:m1]
Assignee: nobody → dshin
Status: NEW → ASSIGNED
Depends on: 1976571

Upcoming change adds a new frame property that will save this. Manipulating
the frame property requires non-const nsIFrame pointer, which is not ideal
given that that instantiation sites of resolution parameters often are const
qualified. Ideally, we avoid adding const casts, so we add a separate field
to act as a cache.

Abspos frames that may reference anchors have a clear, single reflow site
in nsAbsoluteContainingBlock, which keep things simple.

Non-abspos frames that reference anchors will always have their references
resolve to be invalid - If they switch to abspos, they need to be moved or
reconstructed anyway, so we don't have to worry about them.

Since we need to track and store anchor references anyway, this ends up being
a neat side effect. It is assumed that the cached storage is provided afresh
whenever a new reflow happens, so that we avoid using stale anchor references.

Depends on: 1977895
Attachment #9500991 - Attachment description: Bug 1973507: Add and use a frame property for anchor positiond frames to keep track of its anchors, and their offset & size. r=#anchor-positioning-reviewers,#layout → Bug 1973507: Add and use a frame property for anchor positioned frames to keep track of its anchors, and their offset & size. r=#anchor-positioning-reviewers,#layout
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/990f35f1acef https://hg.mozilla.org/integration/autoland/rev/0aa660fda704 Add cached storage for referenced anchors into reflow. r=layout-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/72d49fd509ae https://hg.mozilla.org/integration/autoland/rev/ff3ff4420c7a Use added the cached storage to skip anchor lookups whenever possible. r=layout-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/4e12ddde5cb3 https://hg.mozilla.org/integration/autoland/rev/cd58755162c4 Add and use a frame property for anchor positioned frames to keep track of its anchors, and their offset & size. r=layout-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/76763c471404 https://hg.mozilla.org/integration/autoland/rev/81140ebea290 apply code formatting via Lando
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: