Closed Bug 1414666 Opened 7 years ago Closed 6 years ago

Add nsIFrame::PresShell() for convenient access to the shell

Categories

(Core :: Layout, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

Attachments

(4 files)

Frame-related code often needs the PresShell so we should
add a convenience method for it instead of writing
PresContext()->PresShell() everywhere.
This is an automated conversion of PresContext()->PresShell()
to PresShell(), so it doesn't need careful review.
It changes a bit too much and doesn't compile, but I'll
fix the errors manually in a later patch.

I'll fold the first three patches into one before landing
so the commit message here covers all three.
Attachment #8925374 - Flags: review?(emilio)
Attachment #8925375 - Flags: review?(emilio)
Comment on attachment 8925375 [details] [diff] [review]
part 2 - add the accessor itself

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

::: layout/generic/nsIFrame.h
@@ +638,5 @@
>    }
>  
>    nsPresContext* PresContext() const {
>      return StyleContext()->PresContext();
>    }

nit: Maybe leave a newline here?
Attachment #8925375 - Flags: review?(emilio) → review+
Attachment #8925374 - Flags: review?(emilio) → review+
Attachment #8925376 - Flags: review?(emilio) → review+
Comment on attachment 8925377 [details] [diff] [review]
A few formatting improvements after mass conversion of PresContext()->PresShell() to PresShell().

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

Neat, thanks for doing this Mats! :)

On an unrelated note, we should probably eventually fix bug 154199... I've wondered whether to take it a couple times, but I'll finish before the imagemap thingie I think...

I always have a hard time trying to figure out the reason why something hangs off the pres shell and not pres context or vice versa, and the reason for that is probably "there's no particular reason" :)
Attachment #8925377 - Flags: review?(emilio) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f91e74cdcf4c
part 1 - Add nsIFrame::PresShell() for convenient access to the shell.  r=emilio
https://hg.mozilla.org/integration/mozilla-inbound/rev/985e9aa1f587
part 2 - A few formatting improvements after mass conversion of PresContext()->PresShell() to PresShell().  r=emilio
You need to log in before you can comment on or make changes to this bug.