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:
@@ -12,6 +12,7 @@
|
||||
#include "mozilla/dom/ImageDocumentBinding.h"
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/MouseEvent.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
@@ -26,7 +27,6 @@
|
||||
#include "imgILoader.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgINotificationObserver.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
@@ -402,12 +402,12 @@ void ImageDocument::ScrollImageTo(int32_t aX, int32_t aY, bool restoreImage) {
|
||||
FlushPendingNotifications(FlushType::Layout);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = GetShell();
|
||||
if (!shell) {
|
||||
RefPtr<PresShell> presShell = GetPresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* sf = shell->GetRootScrollFrameAsScrollable();
|
||||
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
|
||||
if (!sf) {
|
||||
return;
|
||||
}
|
||||
@@ -835,9 +835,9 @@ float ImageDocument::GetZoomLevel() {
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
float ImageDocument::GetResolution() {
|
||||
float resolution = mOriginalResolution;
|
||||
nsCOMPtr<nsIPresShell> shell = GetShell();
|
||||
if (shell) {
|
||||
resolution = shell->GetResolution();
|
||||
RefPtr<PresShell> presShell = GetPresShell();
|
||||
if (presShell) {
|
||||
resolution = presShell->GetResolution();
|
||||
}
|
||||
return resolution;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user