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

RESOLVED FIXED in Firefox 68

Status

()

enhancement
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

(Blocks 1 bug)

Trunk
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(3 attachments)

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*.

Comment 4

3 months ago
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)

Comment 7

3 months ago
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

Comment 8

3 months ago
bugherder
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.