Closed Bug 1624514 Opened 5 years ago Closed 5 years ago

Provide a convenient API to get a frame's logical content size

Categories

(Core :: Layout, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(2 files)

We have at least two use cases [1] [2] that use GetContentRectRelativeToSelf().Size() and then convert the physical size to logical size. We can provide an API for this.

[1] https://searchfox.org/mozilla-central/rev/202a285024f174c2d2bf2152d9cba90a03723eab/layout/base/RestyleManager.cpp#748
[2] https://searchfox.org/mozilla-central/rev/202a285024f174c2d2bf2152d9cba90a03723eab/layout/generic/nsFlexContainerFrame.cpp#4829-4830

Let's make these methods more coherent and discoverable by moving them
closer to GetRect().

To get the logical content size of a frame, some callers use
GetContentRectRelativeToSelf().Size() and then convert it to
LogicalRect. We really should generalize ContentBSize(), and provide
ContentSize() for such purpose.

Depends on D68064

These changes look sane to me (I gave them a quick skim and nothing jumped out at me).

Perhaps we could have AlaskanEmily pick these reviews up, though?

Flags: needinfo?(aethanyc)

Sure. I'll redirect the review to Emily.

Flags: needinfo?(aethanyc)
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/d4477b1bcc43 Part 1 - Move nsIFrame's methods that get various frame rects closer to GetRect(). r=AlaskanEmily https://hg.mozilla.org/integration/autoland/rev/d2cd2c812a95 Part 2 - Generalize nsIFrame::ContentBSize() to be ContentSize(). r=AlaskanEmily
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Regressions: 1628804
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: