Closed Bug 1168478 Opened 9 years ago Closed 4 years ago

Combine border & padding args in nsIFrame::ComputeSize API

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox41 --- wontfix
firefox82 --- fixed

People

(Reporter: dholbert, Assigned: TYLin)

References

Details

Attachments

(2 files)

Quoting bug 1166728 comment 14, on nsFrame::ComputeSize():

> [...] I think a lot of functions like this pass border &
> padding separately *so that we can support* box-sizing: padding-box vs.
> border-box.  Now that border/padding will always be added/subtracted as a
> package, we might want to consider combining these args into aBorderPadding
> in a lot of spots, so that we don't need to perform "aBorder + aPadding" all
> over the place.

nsIFrame::ComputeSize (and its various implementations in each frame class) is one place where this can probably happen.

nsLayoutUtils::ComputeSizeWithIntrinsicDimensions would then need to change as well (since it's used by various nsIFrame::ComputeSize implementations).

Also, revise the ComputeAutoSize()'s documentation.

This change shouldn't change behavior.

Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This methods is
used as a helper to implement ComputeSize() for replaced element. That is, its
callers are all within frame classes' ComputeSize()'s overridden methods, so I'm
not convert them in a separate patch.

This change shouldn't change behavior.

Depends on D90063

Attachment #9175463 - Attachment description: Bug 1168478 Part 1 - Combine the border and padding argument for ComputeAutoSize(). → Bug 1168478 Part 1 - Combine the border and padding argument for nsIFrame::ComputeAutoSize().
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/918080b4e7ae
Part 1 - Combine the border and padding argument for nsIFrame::ComputeAutoSize(). r=dholbert
https://hg.mozilla.org/integration/autoland/rev/977b599edf3f
Part 2 - Combine the border and padding arguments for nsIFrame::ComputeSize(). r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: