Closed Bug 2009643 Opened 9 months ago Closed 7 months ago

Refactor containing block size calculation in ReflowAbsoluteFrame()

Categories

(Core :: Layout: Positioned, task)

task

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 1994346 introduces a logic in AbsoluteContainingBlock::Reflow() to compute cbSize for checking whether a first-in-flow needs to be pushed to the next fragmentainer. It currently uses:

const LogicalSize cbSize(containerWM, aContainingBlock.Size());

However, in AbsoluteContainingBlock::ReflowAbsoluteFrame() [1], there's a lambda that computes the containing block rect with various adjustments for anchor-positioning, grid container, and viewport frame. We should refactor the lambda in ReflowAbsoluteFrame() into a helper method and call it from both places to ensure consistent containing block size calculations. Or we could compute the containing block size in Reflow() and pass it into ReflowAbsoluteFrame().

[1] https://searchfox.org/firefox-main/rev/874c5779b2429acf0844c956bb72c529a2047b01/layout/generic/AbsoluteContainingBlock.cpp#1325-1405

Blocks: 1994316

The lambda that was previously in ReflowAbsoluteFrame() was extracted into ComputeContainingBlock() [1] by Bug 1991489, and we now store the unfragmented containing block and use it when needed [2].

At this point, I'm inclined to remove the comment at [3]. We can always file a targeted bug later if necessary.

[1] https://searchfox.org/firefox-main/rev/2d123ef3d530f3ae52f03978fbb9fe51af44bb5e/layout/generic/AbsoluteContainingBlock.cpp#502
[2] https://searchfox.org/firefox-main/rev/2d123ef3d530f3ae52f03978fbb9fe51af44bb5e/layout/generic/AbsoluteContainingBlock.cpp#614-631
[3] https://searchfox.org/firefox-main/rev/2d123ef3d530f3ae52f03978fbb9fe51af44bb5e/layout/generic/AbsoluteContainingBlock.cpp#741-742

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com: https://github.com/mozilla-firefox/firefox/commit/8c43740b57f6 https://hg.mozilla.org/integration/autoland/rev/8ae5e9269bce Remove an obsolete comment in AbsoluteContainingBlock::Reflow(). r=layout-reviewers,dshin DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: