Closed Bug 1547126 Opened 5 years ago Closed 5 years ago

Give IntrinsicSize a constructor that initializes both members as nscoord values

Categories

(Core :: Layout, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

It's reasonably common for us to have to construct or return a temporary IntrinsicSize object with nscoord-flavored values in each dimension.

Let's just create a convenience constructor for this purpose.

FWIW, unrelated, but IntrinsicSize should probably not use nsStyleCoord, and just use Maybe<nscoord>. But I'm happy to do that as a followup to this bug or what not.

This patch shouldn't affect behavior; it's just simplifying exisitng code with
a new convenience constructor.

Blocks: 1547138
No longer depends on: 1547138

(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)

FWIW, unrelated, but IntrinsicSize should probably not use nsStyleCoord, and just use Maybe<nscoord>. But I'm happy to do that as a followup to this bug or what not.

That sounds like a good idea - thanks for suggesting/filing that.

This bug here is just a convenience bug in response to a review comment on bug 1544121, to make its patch a bit more minimal, so I'm happy to keep it small in scope. :)

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1a704e5e6a3c
Give nsIFrame::IntrinsicSize a convenience constructor that takes nscoord-valued width and height. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: