Closed Bug 1352056 Opened 9 years ago Closed 9 years ago

call nsIFrame::StyleDisplay less from nsFrame::FinishAndStoreOverflow

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: dbaron, Assigned: dbaron)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

We call nsIFrame::StyleDisplay an awful lot from nsFrame::FinishAndStoreOverflow, and we could avoid calling it multiple times, given that it shows up in profiles.
MozReview-Commit-ID: DFGBeKtg7hI
Attachment #8852932 - Flags: review?(dholbert)
Comment on attachment 8852932 [details] [diff] [review] Add nsIFrame::Style*WithOptionalParam helpers Review of attachment 8852932 [details] [diff] [review]: ----------------------------------------------------------------- r=me with one nit: ::: layout/generic/nsIFrame.h @@ +766,5 @@ > * Callers outside of libxul should use nsIDOMWindow::GetComputedStyle() > * instead of these accessors. > + * > + * Callers can use Style*WithOptionalParam if they're in a function that > + * has an optional parameter to pass the style struct. Nit: the last line is a bit ambiguous here. The phrase "to pass the style struct" kind of sounds like the style struct is the *recipient* of something that's being passed. (That's the way I read this initially, and it didn't make sense to me.) Maybe reword to avoid that ambiguity? e.g. maybe something like: Callers can use the Style*WithOptionalParam convenience wrapper if they're in a function that accepts an optional pointer to this style struct.
Attachment #8852932 - Flags: review?(dholbert) → review+
Comment on attachment 8852933 [details] [diff] [review] Call nsIFrame::StyleDisplay less from nsFrame::FinishAndStoreOverflow Review of attachment 8852933 [details] [diff] [review]: ----------------------------------------------------------------- r=me. One suggestion: ::: layout/generic/nsFrame.cpp @@ +8913,4 @@ > nsRect bounds(nsPoint(0, 0), aNewSize); > // Store the passed in overflow area if we are a preserve-3d frame or we have > // a transform, and it's not just the frame bounds. > + if (Combines3DTransformWithAncestors(disp) || hasTransform) { Nit: As long as you're making us precompute the "hasTransform" condition here, we probably should swap the order of the conditions -- i.e. this should perhaps be: if (hasTransform || Combines3DTransformWithAncestors(disp)) { That way, we can skip the Combines3DTransformWithAncestors(disp) call, if we already know hasTransform is true.
Attachment #8852933 - Flags: review?(dholbert) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Blocks: 1351830
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: