Closed Bug 1934558 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 49458 - Refactor AbsoluteAxisSolver

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 49458 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/49458
Details from upstream follow.

Oriol Brufau <obrufau@igalia.com> wrote:

Refactor AbsoluteAxisSolver

AbsoluteAxisSolver::solve() would compute, among other things, the position of the absolute positioned element if it had start alignment. Then, AbsoluteAxisSolver::origin_for_alignment_or_justification() could optionally opt into modifying that alignment if needed.

This was quite convoluted and not easy to follow. It's simpler to not compute the position in AbsoluteAxisSolver::solve(), and instead do it always in AbsoluteAxisSolver::origin_for_alignment_or_justification(), which I'm renaming to AbsoluteAxisSolver::origin_for_margin_box() because it aligns the margin box of the abspos within its alignment container.

Then the Anchor struct becomes useless and can be removed.

<!-- Please describe your changes on the following line: -->

Reviewed in servo/servo#34443

Component: web-platform-tests → Layout
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.