Closed Bug 1540015 Opened 6 years ago Closed 6 years ago

Make Document.h treat mozilla::PresShell directly rather than via nsIPresShell

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

No description provided.

If Document::GetShell() returns PresShell* rather than nsIPresShell, it's
a good step to deCOMTaminate PresShell.

This patch makes Document.h stop including nsIPresShell.h since
nsIPresShell.h includes Document.h indirectly and that causes bustage
when we make Document::GetShell() return PresShell*.

*Inlines.h shouldn't be included by another header file, but nsPresContext.h
does it. This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between PresShell.h vs.
nsIPresShell.h and nsPresContext.h ifDocument.hincludesPresShell.h. Therefore, this patch also solves this include hell with addingnsPresContextInlines.h`.

This makes Document::GetShell() return PresShell* instead of nsIPresShell.

Additonally, "shell" is unclear ("docshell" vs. "presshell"). Therefore, this
also renames Document::GetShell() to Document::GetPresShell().

Similarly, some other method names of Document are also renamed from
*Shell* to *PresShell*.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/9561d2c36fa5 part 1: Make Document.h stop including nsIPresShell.h r=smaug https://hg.mozilla.org/integration/autoland/rev/5723ddbc5c44 part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug https://hg.mozilla.org/integration/autoland/rev/7b71c9da0214 part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio

Oh, sorry for the bustage. I forgot changing macOS only part, but I didn't test it on tryserver (confirmed only with Linux64 on tryserver). After verifying to build with macOS, I'll reland them with one line fix.

Flags: needinfo?(masayuki)
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/65f80cb57b30 part 1: Make Document.h stop including nsIPresShell.h r=smaug https://hg.mozilla.org/integration/autoland/rev/f2267d0779f7 part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug https://hg.mozilla.org/integration/autoland/rev/f529b394cb11 part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
Status: ASSIGNED → RESOLVED
Closed: 6 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: