Closed Bug 1096260 Opened 5 years ago Closed 5 years ago

some callers of nsIFrame::ComputeSize still pass a bool for the last parameter instead of a flags word

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

This parameter was changed in bug 732610, but some callers were apparently missed (or have been added since?), and so they still pass a literal bool. This compiles without complaint, as the bool automatically gets promoted to uint32_t, but makes the code misleading and error-prone.

See callers in nsFrame::BoxReflow(), FloatMarginISize(), and ChildShrinkWrapWidth().

I suggest we change the flags parameter from plain uint32_t to a typed enum, which will force callers to explicitly pass the correct type.
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Comment on attachment 8519880 [details] [diff] [review]
Convert flags parameter of nsIFrame::ComputeSize from uint32_t to a typed enum, and update callers accordingly.

Thanks for catching this!
Attachment #8519880 - Flags: review?(dholbert) → review+
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/be1f8816683e
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.