Closed Bug 774835 Opened 12 years ago Closed 12 years ago

Refactor ApplyMinMaxConstraints in nsBlockFrame

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jwir3, Assigned: fantasai.bugs)

References

Details

Attachments

(1 file, 1 obsolete file)

ApplyMinMaxConstraints in nsBlockFrame applies computed min/max height and width. We want to do these together in only one place. Instead, we should refactor this to be two functions: ApplyMinMaxHeight and ApplyMinMaxWidth.
Attached patch patch (obsolete) — Splinter Review
Attachment #643127 - Flags: review?(roc)
Comment on attachment 643127 [details] [diff] [review]
patch

Review of attachment 643127 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/nsHTMLReflowState.h
@@ +418,4 @@
>     */
> +  nscoord ApplyMinMaxWidth(nscoord aWidth) const {
> +    if (NS_UNCONSTRAINEDSIZE != mComputedMaxWidth)
> +        aWidth = NS_MIN(aWidth, mComputedMaxWidth);

{}

@@ +426,5 @@
> +   * size computed so far.
> +   */
> +  nscoord ApplyMinMaxHeight(nscoord aHeight) const {
> +    if (NS_UNCONSTRAINEDSIZE != mComputedMaxHeight)
> +        aHeight = NS_MIN(aHeight, mComputedMaxHeight);

{}
Attachment #643127 - Flags: review?(roc) → review+
I left out the extra braces to keep it extra compact since it's inlined in the header. Are you sure you want them in?
Yes. Keeping it compact doesn't matter.
Attachment #643127 - Attachment is obsolete: true
Keywords: checkin-needed
fantasai, if you add a commit message to your patch, I'll check it in for you.
Nevermind, I've added it and pushed to inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e038e82f416
Keywords: checkin-needed
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/1e038e82f416
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: