Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio

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

Differential Revision: https://phabricator.services.mozilla.com/D25338
This commit is contained in:
Masayuki Nakano
2019-03-29 15:12:47 +00:00
parent bf9849f5f3
commit e56c690088
98 changed files with 658 additions and 588 deletions

View File

@@ -18,7 +18,6 @@
#include "nsFrameLoaderOwner.h"
#include "mozilla/dom/Document.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsViewManager.h"
#include "nsINode.h"
#include "nsPresContext.h"
@@ -36,6 +35,7 @@
#endif
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/DataTransferItemList.h"
#include "mozilla/dom/DataTransfer.h"
@@ -458,7 +458,7 @@ NS_IMETHODIMP
nsBaseDragService::FireDragEventAtSource(EventMessage aEventMessage,
uint32_t aKeyModifiers) {
if (mSourceNode && mSourceDocument && !mSuppressLevel) {
nsCOMPtr<nsIPresShell> presShell = mSourceDocument->GetShell();
RefPtr<PresShell> presShell = mSourceDocument->GetPresShell();
if (presShell) {
nsEventStatus status = nsEventStatus_eIgnore;
WidgetDragEvent event(true, aEventMessage, nullptr);
@@ -511,7 +511,7 @@ static nsIPresShell* GetPresShellForContent(nsINode* aDOMNode) {
RefPtr<Document> document = content->GetComposedDoc();
if (document) {
document->FlushPendingNotifications(FlushType::Display);
return document->GetShell();
return document->GetPresShell();
}
return nullptr;