mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio
`nsPresContext` should use `mozilla::PresShell` directly instead of `nsIPresShell`. This patch makes it. Unfortunately, `nsPresContext` and `nsIFrame` have `PresShell()`. Therefore, we cannot use `PresShell*` in its methods so that this patch uses `mozilla::` namespace prefix. It might be better to rename them as `PresShellPtr()` in another bug. Differential Revision: https://phabricator.services.mozilla.com/D25721 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
310add77cf
commit
9165a150a1
@ -44,7 +44,6 @@
|
||||
|
||||
#include "nsDeckFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFrame.h"
|
||||
@ -74,6 +73,7 @@
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/CanvasRenderingContext2D.h"
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEditor.h"
|
||||
#include "gfxSkipChars.h"
|
||||
#include <algorithm>
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "nsTreeBodyFrame.h"
|
||||
#include "nsTreeColumns.h"
|
||||
#include "nsTreeUtils.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/XULTreeElementBinding.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
@ -160,7 +161,7 @@ Accessible* XULTreeAccessible::ChildAtPoint(int32_t aX, int32_t aY,
|
||||
if (!frame) return nullptr;
|
||||
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(rootFrame, nullptr);
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "nsPersistentProperties.h"
|
||||
#include "nsITreeSelection.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/TreeColumnBinding.h"
|
||||
#include "mozilla/dom/XULTreeElementBinding.h"
|
||||
@ -257,7 +258,7 @@ Accessible* XULTreeGridRowAccessible::ChildAtPoint(
|
||||
if (!frame) return nullptr;
|
||||
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(rootFrame, nullptr);
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowRoot.h"
|
||||
@ -46,7 +45,6 @@
|
||||
#include "nsIWebBrowserChromeFocus.h"
|
||||
#include "nsIContent.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsView.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
@ -57,6 +55,7 @@
|
||||
#include "mozilla/dom/File.h" // for input type=file
|
||||
#include "mozilla/dom/FileList.h" // for input type=file
|
||||
#include "mozilla/dom/LoadURIOptionsBinding.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@ -394,7 +393,7 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX,
|
||||
RefPtr<nsPresContext> presContext = mWebBrowser->mDocShell->GetPresContext();
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
nsIPresShell* presShell = presContext->GetPresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_SUCCESS(
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "mozilla/ComputedStyleInlines.h"
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/LayerAnimationInfo.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
@ -31,7 +32,6 @@
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsDisplayItemTypes.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresShellInlines.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -2158,16 +2158,16 @@ nsresult Element::DispatchEvent(nsPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = aPresContext->GetPresShell();
|
||||
if (!shell) {
|
||||
RefPtr<PresShell> presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aFullDispatch) {
|
||||
return shell->HandleEventWithTarget(aEvent, nullptr, aTarget, aStatus);
|
||||
return presShell->HandleEventWithTarget(aEvent, nullptr, aTarget, aStatus);
|
||||
}
|
||||
|
||||
return shell->HandleDOMEventWithTarget(aTarget, aEvent, aStatus);
|
||||
return presShell->HandleDOMEventWithTarget(aTarget, aEvent, aStatus);
|
||||
}
|
||||
|
||||
/* static */
|
||||
@ -3120,8 +3120,8 @@ nsresult Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor) {
|
||||
}
|
||||
|
||||
// The default action is simply to dispatch DOMActivate
|
||||
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
|
||||
if (shell) {
|
||||
if (RefPtr<PresShell> presShell =
|
||||
aVisitor.mPresContext->GetPresShell()) {
|
||||
// single-click
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
// DOMActive event should be trusted since the activation is actually
|
||||
@ -3129,7 +3129,7 @@ nsresult Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor) {
|
||||
InternalUIEvent actEvent(true, eLegacyDOMActivate, mouseEvent);
|
||||
actEvent.mDetail = 1;
|
||||
|
||||
rv = shell->HandleDOMEventWithTarget(this, &actEvent, &status);
|
||||
rv = presShell->HandleDOMEventWithTarget(this, &actEvent, &status);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
@ -1864,8 +1864,7 @@ nsresult Selection::DoAutoScroll(nsIFrame* aFrame, nsPoint aPoint) {
|
||||
}
|
||||
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
RefPtr<PresShell> presShell =
|
||||
static_cast<PresShell*>(presContext->PresShell());
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
nsRootPresContext* rootPC = presContext->GetRootPresContext();
|
||||
if (!rootPC) return NS_OK;
|
||||
nsIFrame* rootmostFrame = rootPC->PresShell()->GetRootFrame();
|
||||
|
@ -78,6 +78,7 @@
|
||||
#include "mozilla/HTMLEditor.h"
|
||||
#include "mozilla/NullPrincipal.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/ChromeMessageSender.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
@ -964,8 +965,8 @@ void nsFrameLoader::ForceLayoutIfNecessary() {
|
||||
// Only force the layout flush if the frameloader hasn't ever been
|
||||
// run through layout.
|
||||
if (frame->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
|
||||
if (nsCOMPtr<nsIPresShell> shell = presContext->GetPresShell()) {
|
||||
shell->FlushPendingNotifications(FlushType::Layout);
|
||||
if (RefPtr<PresShell> presShell = presContext->GetPresShell()) {
|
||||
presShell->FlushPendingNotifications(FlushType::Layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,6 +98,7 @@
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ProcessHangMonitor.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/ThrottledEventQueue.h"
|
||||
@ -123,7 +124,6 @@
|
||||
#include "nsIEmbeddingSiteWindow.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsView.h"
|
||||
#include "nsViewManager.h"
|
||||
@ -6293,17 +6293,18 @@ void nsGlobalWindowOuter::EnterModalState() {
|
||||
EventStateManager* activeESM = static_cast<EventStateManager*>(
|
||||
EventStateManager::GetActiveEventStateManager());
|
||||
if (activeESM && activeESM->GetPresContext()) {
|
||||
nsIPresShell* activeShell = activeESM->GetPresContext()->GetPresShell();
|
||||
if (activeShell && (nsContentUtils::ContentIsCrossDocDescendantOf(
|
||||
activeShell->GetDocument(), mDoc) ||
|
||||
nsContentUtils::ContentIsCrossDocDescendantOf(
|
||||
mDoc, activeShell->GetDocument()))) {
|
||||
PresShell* activePresShell = activeESM->GetPresContext()->GetPresShell();
|
||||
if (activePresShell && (nsContentUtils::ContentIsCrossDocDescendantOf(
|
||||
activePresShell->GetDocument(), mDoc) ||
|
||||
nsContentUtils::ContentIsCrossDocDescendantOf(
|
||||
mDoc, activePresShell->GetDocument()))) {
|
||||
EventStateManager::ClearGlobalActiveContent(activeESM);
|
||||
|
||||
nsIPresShell::SetCapturingContent(nullptr, 0);
|
||||
|
||||
if (activeShell) {
|
||||
RefPtr<nsFrameSelection> frameSelection = activeShell->FrameSelection();
|
||||
if (activePresShell) {
|
||||
RefPtr<nsFrameSelection> frameSelection =
|
||||
activePresShell->FrameSelection();
|
||||
frameSelection->SetDragState(false);
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsSVGImageFrame.h"
|
||||
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIStreamListener.h"
|
||||
|
||||
@ -53,6 +51,7 @@
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/net/UrlClassifierFeatureFactory.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#ifdef LoadImage
|
||||
// Undefine LoadImage to prevent naming conflict with Windows.
|
||||
@ -318,7 +317,7 @@ void nsImageLoadingContent::OnUnlockedDraw() {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
@ -865,7 +864,7 @@ nsImageLoadingContent::FrameDestroyed(nsIFrame* aFrame) {
|
||||
UntrackImage(mCurrentRequest);
|
||||
UntrackImage(mPendingRequest);
|
||||
|
||||
nsIPresShell* presShell = presContext ? presContext->GetPresShell() : nullptr;
|
||||
PresShell* presShell = presContext ? presContext->GetPresShell() : nullptr;
|
||||
if (presShell) {
|
||||
presShell->RemoveFrameFromApproximatelyVisibleList(aFrame);
|
||||
}
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/HTMLCanvasElement.h"
|
||||
#include "SVGObserverUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresShellInlines.h"
|
||||
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
@ -4737,9 +4737,10 @@ void CanvasRenderingContext2D::DrawWindow(nsGlobalWindowInner& aWindow,
|
||||
thebes->SetMatrix(Matrix::Scaling(matrix._11, matrix._22));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
|
||||
Unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes);
|
||||
Unused << presShell->RenderDocument(r, renderDocFlags, backgroundColor,
|
||||
thebes);
|
||||
// If this canvas was contained in the drawn window, the pre-transaction
|
||||
// callback may have returned its DT. If so, we must reacquire it here.
|
||||
EnsureTarget(discardContent ? &drawRect : nullptr);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/TouchEvents.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
@ -31,7 +32,6 @@
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
@ -533,8 +533,9 @@ CSSIntPoint Event::GetScreenCoords(nsPresContext* aPresContext,
|
||||
aPoint,
|
||||
aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
|
||||
|
||||
if (nsIPresShell* ps = aPresContext->GetPresShell()) {
|
||||
pt = pt.RemoveResolution(nsLayoutUtils::GetCurrentAPZResolutionScale(ps));
|
||||
if (PresShell* presShell = aPresContext->GetPresShell()) {
|
||||
pt = pt.RemoveResolution(
|
||||
nsLayoutUtils::GetCurrentAPZResolutionScale(presShell));
|
||||
}
|
||||
|
||||
pt += LayoutDevicePixel::ToAppUnits(
|
||||
@ -554,8 +555,9 @@ CSSIntPoint Event::GetPageCoords(nsPresContext* aPresContext,
|
||||
|
||||
// If there is some scrolling, add scroll info to client point.
|
||||
if (aPresContext && aPresContext->GetPresShell()) {
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
|
||||
PresShell* presShell = aPresContext->PresShell();
|
||||
nsIScrollableFrame* scrollframe =
|
||||
presShell->GetRootScrollFrameAsScrollable();
|
||||
if (scrollframe) {
|
||||
pagePoint +=
|
||||
CSSIntPoint::FromAppUnitsRounded(scrollframe->GetScrollPosition());
|
||||
@ -612,16 +614,16 @@ CSSIntPoint Event::GetOffsetCoords(nsPresContext* aPresContext,
|
||||
if (!content || !aPresContext) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
nsCOMPtr<nsIPresShell> shell = aPresContext->GetPresShell();
|
||||
if (!shell) {
|
||||
RefPtr<PresShell> presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
shell->FlushPendingNotifications(FlushType::Layout);
|
||||
presShell->FlushPendingNotifications(FlushType::Layout);
|
||||
nsIFrame* frame = content->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
nsIFrame* rootFrame = shell->GetRootFrame();
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
if (!rootFrame) {
|
||||
return CSSIntPoint(0, 0);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ScrollTypes.h"
|
||||
#include "mozilla/TextComposition.h"
|
||||
#include "mozilla/TextEditor.h"
|
||||
@ -47,7 +48,6 @@
|
||||
#include "nsITextControlElement.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsComboboxControlFrame.h"
|
||||
@ -1654,10 +1654,11 @@ void EventStateManager::FillInEventFromGestureDown(WidgetMouseEvent* aEvent) {
|
||||
}
|
||||
|
||||
void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
|
||||
nsCOMPtr<nsIPresShell> shell = mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
|
||||
AutoWeakFrame targetFrame = mCurrentTarget;
|
||||
|
||||
if (!PointerEventHandler::IsPointerEventEnabled() || !shell || !targetFrame) {
|
||||
if (!PointerEventHandler::IsPointerEventEnabled() || !presShell ||
|
||||
!targetFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1675,7 +1676,7 @@ void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
|
||||
ePointerCancel);
|
||||
|
||||
event.convertToPointer = false;
|
||||
shell->HandleEventWithTarget(&event, targetFrame, content, &status);
|
||||
presShell->HandleEventWithTarget(&event, targetFrame, content, &status);
|
||||
} else if (WidgetTouchEvent* aTouchEvent = aEvent->AsTouchEvent()) {
|
||||
WidgetPointerEvent event(aTouchEvent->IsTrusted(), ePointerCancel,
|
||||
aTouchEvent->mWidget);
|
||||
@ -1684,7 +1685,7 @@ void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
|
||||
&event, aTouchEvent, aTouchEvent->mTouches[0], true);
|
||||
|
||||
event.convertToPointer = false;
|
||||
shell->HandleEventWithTarget(&event, targetFrame, content, &status);
|
||||
presShell->HandleEventWithTarget(&event, targetFrame, content, &status);
|
||||
} else {
|
||||
MOZ_ASSERT(false);
|
||||
}
|
||||
@ -3239,9 +3240,8 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||
esm->PostHandleMouseUp(mouseUpEvent, aStatus, aOverrideClickTarget);
|
||||
}
|
||||
|
||||
nsIPresShell* shell = presContext->GetPresShell();
|
||||
if (shell) {
|
||||
RefPtr<nsFrameSelection> frameSelection = shell->FrameSelection();
|
||||
if (PresShell* presShell = presContext->GetPresShell()) {
|
||||
RefPtr<nsFrameSelection> frameSelection = presShell->FrameSelection();
|
||||
frameSelection->SetDragState(false);
|
||||
}
|
||||
} break;
|
||||
@ -4901,7 +4901,7 @@ nsresult EventStateManager::PostHandleMouseUp(
|
||||
MOZ_ASSERT(EventCausesClickEvents(*aMouseUpEvent));
|
||||
MOZ_ASSERT(aStatus);
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -5115,9 +5115,9 @@ nsresult EventStateManager::HandleMiddleClickPaste(
|
||||
}
|
||||
|
||||
nsIFrame* EventStateManager::GetEventTarget() {
|
||||
nsIPresShell* shell;
|
||||
PresShell* presShell;
|
||||
if (mCurrentTarget || !mPresContext ||
|
||||
!(shell = mPresContext->GetPresShell())) {
|
||||
!(presShell = mPresContext->GetPresShell())) {
|
||||
return mCurrentTarget;
|
||||
}
|
||||
|
||||
@ -5128,7 +5128,7 @@ nsIFrame* EventStateManager::GetEventTarget() {
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* frame = shell->GetCurrentEventFrame();
|
||||
nsIFrame* frame = presShell->GetCurrentEventFrame();
|
||||
return (mCurrentTarget = frame);
|
||||
}
|
||||
|
||||
@ -5145,9 +5145,7 @@ already_AddRefed<nsIContent> EventStateManager::GetEventTargetContent(
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
|
||||
nsIPresShell* presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
if (PresShell* presShell = mPresContext->GetPresShell()) {
|
||||
content = presShell->GetEventTargetContent(aEvent);
|
||||
}
|
||||
|
||||
@ -5490,10 +5488,9 @@ void EventStateManager::EnsureDocument(nsPresContext* aPresContext) {
|
||||
}
|
||||
|
||||
void EventStateManager::FlushPendingEvents(nsPresContext* aPresContext) {
|
||||
MOZ_ASSERT(nullptr != aPresContext, "nullptr ptr");
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
if (shell) {
|
||||
shell->FlushPendingNotifications(FlushType::InterruptibleLayout);
|
||||
MOZ_ASSERT(aPresContext, "nullptr ptr");
|
||||
if (RefPtr<PresShell> presShell = aPresContext->GetPresShell()) {
|
||||
presShell->FlushPendingNotifications(FlushType::InterruptibleLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5649,8 +5646,8 @@ nsresult EventStateManager::DoContentCommandEvent(
|
||||
nsresult EventStateManager::DoContentCommandScrollEvent(
|
||||
WidgetContentCommandEvent* aEvent) {
|
||||
NS_ENSURE_TRUE(mPresContext, NS_ERROR_NOT_AVAILABLE);
|
||||
nsIPresShell* ps = mPresContext->GetPresShell();
|
||||
NS_ENSURE_TRUE(ps, NS_ERROR_NOT_AVAILABLE);
|
||||
PresShell* presShell = mPresContext->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_ENSURE_TRUE(aEvent->mScroll.mAmount != 0, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsIScrollableFrame::ScrollUnit scrollUnit;
|
||||
@ -5671,7 +5668,7 @@ nsresult EventStateManager::DoContentCommandScrollEvent(
|
||||
aEvent->mSucceeded = true;
|
||||
|
||||
nsIScrollableFrame* sf =
|
||||
ps->GetScrollableFrameToScroll(nsIPresShell::eEither);
|
||||
presShell->GetScrollableFrameToScroll(nsIPresShell::eEither);
|
||||
aEvent->mIsEnabled =
|
||||
sf ? (aEvent->mScroll.mIsHorizontal ? WheelHandlingUtils::CanScrollOn(
|
||||
sf, aEvent->mScroll.mAmount, 0)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/IMEStateManager.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextComposition.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
@ -305,7 +305,7 @@ bool IMEContentObserver::InitWithEditor(nsPresContext* aPresContext,
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
PresShell* presShell = aPresContext->GetPresShell();
|
||||
|
||||
// get selection and root content
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
@ -318,7 +318,7 @@ bool IMEContentObserver::InitWithEditor(nsPresContext* aPresContext,
|
||||
frame->GetSelectionController(aPresContext, getter_AddRefs(selCon));
|
||||
} else {
|
||||
// mEditableNode is a document
|
||||
selCon = do_QueryInterface(presShell);
|
||||
selCon = presShell;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!selCon)) {
|
||||
@ -1460,7 +1460,7 @@ bool IMEContentObserver::IsReflowLocked() const {
|
||||
if (NS_WARN_IF(!presContext)) {
|
||||
return false;
|
||||
}
|
||||
nsIPresShell* presShell = presContext->GetPresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
if (NS_WARN_IF(!presShell)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "IMEStateManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/EditorBase.h"
|
||||
@ -17,6 +16,7 @@
|
||||
#include "mozilla/IMEStateManager.h"
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/TextComposition.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
@ -90,7 +90,7 @@ void TextComposition::Destroy() {
|
||||
bool TextComposition::IsValidStateForComposition(nsIWidget* aWidget) const {
|
||||
return !Destroyed() && aWidget && !aWidget->Destroyed() &&
|
||||
mPresContext->GetPresShell() &&
|
||||
!mPresContext->GetPresShell()->IsDestroying();
|
||||
!mPresContext->PresShell()->IsDestroying();
|
||||
}
|
||||
|
||||
bool TextComposition::MaybeDispatchCompositionUpdate(
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/ContentEvents.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -165,7 +166,7 @@ already_AddRefed<nsINode> UIEvent::GetRangeParent() {
|
||||
if (NS_WARN_IF(!mPresContext)) {
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
|
||||
if (NS_WARN_IF(!presShell)) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -179,7 +180,7 @@ int32_t UIEvent::RangeOffset() const {
|
||||
if (NS_WARN_IF(!mPresContext)) {
|
||||
return 0;
|
||||
}
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
|
||||
if (NS_WARN_IF(!presShell)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "mozilla/dom/HTMLFormSubmission.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFormControl.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
@ -204,11 +204,10 @@ nsresult HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
InternalUIEvent actEvent(true, eLegacyDOMActivate, mouseEvent);
|
||||
actEvent.mDetail = 1;
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
|
||||
if (shell) {
|
||||
if (RefPtr<PresShell> presShell = aVisitor.mPresContext->GetPresShell()) {
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
mInInternalActivate = true;
|
||||
shell->HandleDOMEventWithTarget(this, &actEvent, &status);
|
||||
presShell->HandleDOMEventWithTarget(this, &actEvent, &status);
|
||||
mInInternalActivate = false;
|
||||
|
||||
// If activate is cancelled, we must do the same as when click is
|
||||
@ -258,8 +257,7 @@ nsresult HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
event.mOriginator = this;
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell =
|
||||
aVisitor.mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = aVisitor.mPresContext->GetPresShell();
|
||||
// If |nsIPresShell::Destroy| has been called due to
|
||||
// handling the event, the pres context will return
|
||||
// a null pres shell. See bug 125624.
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "mozilla/dom/FileSystemUtils.h"
|
||||
#include "mozilla/dom/GetFilesHelper.h"
|
||||
#include "mozilla/dom/WheelEventBinding.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsCRTGlue.h"
|
||||
@ -43,7 +44,6 @@
|
||||
#include "nsMappedAttributes.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
@ -101,7 +102,6 @@
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
@ -5918,7 +5918,7 @@ void HTMLMediaElement::Invalidate(bool aImageSizeChanged,
|
||||
UpdateMediaSize(aNewIntrinsicSize.value());
|
||||
if (frame) {
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
presShell->FrameNeedsReflow(frame, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/dom/XULFrameElement.h"
|
||||
#include "mozilla/dom/WindowProxyHolder.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScrollable.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
@ -296,13 +296,13 @@ nsresult nsGenericHTMLFrameElement::AfterSetAttr(
|
||||
scrollable->SetDefaultScrollbarPreferences(
|
||||
nsIScrollable::ScrollOrientation_Y, val);
|
||||
RefPtr<nsPresContext> presContext = docshell->GetPresContext();
|
||||
nsIPresShell* shell =
|
||||
PresShell* presShell =
|
||||
presContext ? presContext->GetPresShell() : nullptr;
|
||||
nsIFrame* rootScroll =
|
||||
shell ? shell->GetRootScrollFrame() : nullptr;
|
||||
presShell ? presShell->GetRootScrollFrame() : nullptr;
|
||||
if (rootScroll) {
|
||||
shell->FrameNeedsReflow(rootScroll, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
presShell->FrameNeedsReflow(
|
||||
rootScroll, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1178,8 +1178,7 @@ nsresult nsTextEditorState::BindToFrame(nsTextControlFrame* aFrame) {
|
||||
Element* rootNode = aFrame->GetRootNode();
|
||||
MOZ_ASSERT(rootNode);
|
||||
|
||||
PresShell* presShell =
|
||||
static_cast<PresShell*>(aFrame->PresContext()->GetPresShell());
|
||||
PresShell* presShell = aFrame->PresContext()->GetPresShell();
|
||||
MOZ_ASSERT(presShell);
|
||||
|
||||
// Create selection
|
||||
@ -1269,7 +1268,7 @@ nsresult nsTextEditorState::PrepareEditor(const nsAString* aValue) {
|
||||
// the required machinery to it.
|
||||
|
||||
nsPresContext* presContext = mBoundFrame->PresContext();
|
||||
nsIPresShell* shell = presContext->GetPresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
|
||||
// Setup the editor flags
|
||||
uint32_t editorFlags = nsIPlaintextEditor::eEditorPlaintextMask;
|
||||
@ -1332,7 +1331,7 @@ nsresult nsTextEditorState::PrepareEditor(const nsAString* aValue) {
|
||||
// editor's Init() call.
|
||||
|
||||
// Get the DOM document
|
||||
nsCOMPtr<Document> doc = shell->GetDocument();
|
||||
nsCOMPtr<Document> doc = presShell->GetDocument();
|
||||
if (NS_WARN_IF(!doc)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ using mozilla::DefaultXDisplay;
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/NullPrincipal.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/DragEvent.h"
|
||||
|
@ -98,8 +98,8 @@ PaintFragment PaintFragment::Record(nsIDocShell* aDocShell,
|
||||
|
||||
RefPtr<gfxContext> thebes = gfxContext::CreateOrNull(dt);
|
||||
thebes->SetMatrix(Matrix::Scaling(aScale, aScale));
|
||||
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
|
||||
Unused << shell->RenderDocument(r, 0, aBackgroundColor, thebes);
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
Unused << presShell->RenderDocument(r, 0, aBackgroundColor, thebes);
|
||||
}
|
||||
|
||||
ByteBuf recording = ByteBuf((uint8_t*)recorder->mOutputStream.mData,
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/MouseEventBinding.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -258,7 +259,7 @@ static nsIContent* GetClickableAncestor(
|
||||
|
||||
static nscoord AppUnitsFromMM(nsIFrame* aFrame, uint32_t aMM) {
|
||||
nsPresContext* pc = aFrame->PresContext();
|
||||
nsIPresShell* presShell = pc->PresShell();
|
||||
PresShell* presShell = pc->PresShell();
|
||||
float result = float(aMM) * (pc->DeviceContext()->AppUnitsPerPhysicalInch() /
|
||||
MM_PER_INCH_FLOAT);
|
||||
result = result / presShell->GetResolution();
|
||||
@ -356,7 +357,7 @@ static bool IsLargeElement(nsIFrame* aFrame, const EventRadiusPrefs* aPrefs) {
|
||||
uint32_t keepLimitSizeForCluster = aPrefs->mKeepLimitSizeForCluster;
|
||||
nsSize frameSize = aFrame->GetSize();
|
||||
nsPresContext* pc = aFrame->PresContext();
|
||||
nsIPresShell* presShell = pc->PresShell();
|
||||
PresShell* presShell = pc->PresShell();
|
||||
float cumulativeResolution = presShell->GetCumulativeResolution();
|
||||
if ((pc->AppUnitsToGfxUnits(frameSize.height) * cumulativeResolution) >
|
||||
keepLimitSizeForCluster &&
|
||||
@ -487,7 +488,7 @@ static bool IsElementClickableAndReadable(nsIFrame* aFrame,
|
||||
uint32_t limitReadableSize = aPrefs->mLimitReadableSize;
|
||||
nsSize frameSize = aFrame->GetSize();
|
||||
nsPresContext* pc = aFrame->PresContext();
|
||||
nsIPresShell* presShell = pc->PresShell();
|
||||
PresShell* presShell = pc->PresShell();
|
||||
float cumulativeResolution = presShell->GetCumulativeResolution();
|
||||
if ((pc->AppUnitsToGfxUnits(frameSize.height) * cumulativeResolution) <
|
||||
limitReadableSize ||
|
||||
|
@ -940,7 +940,7 @@ void PresShell::Init(Document* aDocument, nsPresContext* aPresContext,
|
||||
|
||||
// Bind the context to the presentation shell.
|
||||
mPresContext = aPresContext;
|
||||
mPresContext->AttachShell(this);
|
||||
mPresContext->AttachPresShell(this);
|
||||
|
||||
mPresContext->DeviceContext()->InitFontCache();
|
||||
|
||||
@ -1352,7 +1352,7 @@ void PresShell::Destroy() {
|
||||
// We hold a reference to the pres context, and it holds a weak link back
|
||||
// to us. To avoid the pres context having a dangling reference, set its
|
||||
// pres shell to nullptr
|
||||
mPresContext->DetachShell();
|
||||
mPresContext->DetachPresShell();
|
||||
|
||||
// Clear the link handler (weak reference) as well
|
||||
mPresContext->SetLinkHandler(nullptr);
|
||||
@ -5065,7 +5065,7 @@ static bool IsTransparentContainerElement(nsPresContext* aPresContext) {
|
||||
if (tab) {
|
||||
// Check if presShell is the top PresShell. Only the top can
|
||||
// influence the canvas background color.
|
||||
nsCOMPtr<nsIPresShell> presShell = aPresContext->GetPresShell();
|
||||
PresShell* presShell = aPresContext->GetPresShell();
|
||||
nsCOMPtr<nsIPresShell> topPresShell = tab->GetPresShell();
|
||||
if (presShell != topPresShell) {
|
||||
tab = nullptr;
|
||||
@ -5207,17 +5207,17 @@ float PresShell::GetCumulativeResolution() {
|
||||
|
||||
float PresShell::GetCumulativeNonRootScaleResolution() {
|
||||
float resolution = 1.0;
|
||||
nsIPresShell* currentShell = this;
|
||||
while (currentShell) {
|
||||
nsPresContext* currentCtx = currentShell->GetPresContext();
|
||||
PresShell* currentPresShell = this;
|
||||
while (currentPresShell) {
|
||||
nsPresContext* currentCtx = currentPresShell->GetPresContext();
|
||||
if (currentCtx != currentCtx->GetRootPresContext()) {
|
||||
resolution *= currentShell->GetResolution();
|
||||
resolution *= currentPresShell->GetResolution();
|
||||
}
|
||||
nsPresContext* parentCtx = currentCtx->GetParentPresContext();
|
||||
if (parentCtx) {
|
||||
currentShell = parentCtx->PresShell();
|
||||
currentPresShell = parentCtx->PresShell();
|
||||
} else {
|
||||
currentShell = nullptr;
|
||||
currentPresShell = nullptr;
|
||||
}
|
||||
}
|
||||
return resolution;
|
||||
@ -6400,7 +6400,6 @@ PresShell* PresShell::GetShellForEventTarget(nsIFrame* aFrame,
|
||||
|
||||
/* static */
|
||||
PresShell* PresShell::GetShellForTouchEvent(WidgetGUIEvent* aEvent) {
|
||||
PresShell* shell = nullptr;
|
||||
switch (aEvent->mMessage) {
|
||||
case eTouchMove:
|
||||
case eTouchCancel:
|
||||
@ -6409,37 +6408,35 @@ PresShell* PresShell::GetShellForTouchEvent(WidgetGUIEvent* aEvent) {
|
||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||
for (dom::Touch* touch : touchEvent->mTouches) {
|
||||
if (!touch) {
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<dom::Touch> oldTouch =
|
||||
TouchManager::GetCapturedTouch(touch->Identifier());
|
||||
if (!oldTouch) {
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(oldTouch->GetTarget());
|
||||
if (!content) {
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIFrame* contentFrame = content->GetPrimaryFrame();
|
||||
if (!contentFrame) {
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
shell =
|
||||
static_cast<PresShell*>(contentFrame->PresContext()->PresShell());
|
||||
if (shell) {
|
||||
break;
|
||||
PresShell* presShell = contentFrame->PresContext()->GetPresShell();
|
||||
if (presShell) {
|
||||
return presShell;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
return nullptr;
|
||||
}
|
||||
return shell;
|
||||
}
|
||||
|
||||
nsresult PresShell::HandleEvent(nsIFrame* aFrameForPresShell,
|
||||
@ -7138,8 +7135,8 @@ bool PresShell::EventHandler::MaybeHandleEventWithAnotherPresShell(
|
||||
}
|
||||
|
||||
// We need to handle aGUIEvent with another PresShell.
|
||||
nsCOMPtr<nsIPresShell> shell = frame->PresContext()->GetPresShell();
|
||||
*aRv = shell->HandleEvent(frame, aGUIEvent, true, aEventStatus);
|
||||
RefPtr<PresShell> presShell = frame->PresContext()->PresShell();
|
||||
*aRv = presShell->HandleEvent(frame, aGUIEvent, true, aEventStatus);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -10556,7 +10553,7 @@ PresShell* PresShell::GetRootPresShell() {
|
||||
if (mPresContext) {
|
||||
nsPresContext* rootPresContext = mPresContext->GetRootPresContext();
|
||||
if (rootPresContext) {
|
||||
return static_cast<PresShell*>(rootPresContext->PresShell());
|
||||
return rootPresContext->PresShell();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
@ -10967,7 +10964,7 @@ bool PresShell::EventHandler::EventTargetData::MaybeRetargetToActiveDocument(
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIPresShell* activePresShell = activePresContext->GetPresShell();
|
||||
PresShell* activePresShell = activePresContext->GetPresShell();
|
||||
if (!activePresShell) {
|
||||
return false;
|
||||
}
|
||||
@ -10979,8 +10976,7 @@ bool PresShell::EventHandler::EventTargetData::MaybeRetargetToActiveDocument(
|
||||
return false;
|
||||
}
|
||||
|
||||
SetPresShellAndFrame(static_cast<PresShell*>(activePresShell),
|
||||
activePresShell->GetRootFrame());
|
||||
SetPresShellAndFrame(activePresShell, activePresShell->GetRootFrame());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,8 @@ class PresShell final : public nsIPresShell,
|
||||
mPresContext->UIResolutionChangedSync();
|
||||
}
|
||||
|
||||
void SynthesizeMouseMove(bool aFromScroll) override;
|
||||
|
||||
// nsIViewObserver interface
|
||||
|
||||
void Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
|
||||
@ -214,6 +216,8 @@ class PresShell final : public nsIPresShell,
|
||||
NS_IMETHOD SetSelectionFlags(int16_t aInEnable) override;
|
||||
NS_IMETHOD GetSelectionFlags(int16_t* aOutEnable) override;
|
||||
|
||||
using nsIPresShell::GetSelectionFlags;
|
||||
|
||||
// nsISelectionController
|
||||
|
||||
NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount,
|
||||
@ -274,11 +278,10 @@ class PresShell final : public nsIPresShell,
|
||||
|
||||
void UpdateCanvasBackground() override;
|
||||
|
||||
void AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
|
||||
nsDisplayList& aList, nsIFrame* aFrame,
|
||||
const nsRect& aBounds,
|
||||
nscolor aBackstopColor,
|
||||
uint32_t aFlags) override;
|
||||
void AddCanvasBackgroundColorItem(
|
||||
nsDisplayListBuilder& aBuilder, nsDisplayList& aList, nsIFrame* aFrame,
|
||||
const nsRect& aBounds, nscolor aBackstopColor = NS_RGBA(0, 0, 0, 0),
|
||||
uint32_t aFlags = 0) override;
|
||||
|
||||
void AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
|
||||
nsDisplayList& aList, nsIFrame* aFrame,
|
||||
@ -1283,8 +1286,6 @@ class PresShell final : public nsIPresShell,
|
||||
static StaticRefPtr<dom::Element> sLastKeyDownEventTargetElement;
|
||||
};
|
||||
|
||||
void SynthesizeMouseMove(bool aFromScroll) override;
|
||||
|
||||
PresShell* GetRootPresShell();
|
||||
|
||||
nscolor GetDefaultBackgroundColorToDraw();
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "mozilla/LayerAnimationInfo.h"
|
||||
#include "mozilla/layers/AnimationInfo.h"
|
||||
#include "mozilla/layout/ScrollAnchorContainer.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ServoBindings.h"
|
||||
#include "mozilla/ServoStyleSetInlines.h"
|
||||
#include "mozilla/Unused.h"
|
||||
@ -2665,7 +2666,7 @@ static ServoPostTraversalFlags SendA11yNotifications(
|
||||
}
|
||||
|
||||
if (needsNotify) {
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
PresShell* presShell = aPresContext->PresShell();
|
||||
if (isVisible) {
|
||||
accService->ContentRangeInserted(presShell, aElement,
|
||||
aElement->GetNextSibling());
|
||||
@ -3019,7 +3020,7 @@ ServoElementSnapshot& RestyleManager::SnapshotFor(Element& aElement) {
|
||||
|
||||
void RestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags) {
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell* shell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
MOZ_ASSERT(presContext->Document(), "No document? Pshaw!");
|
||||
// FIXME(emilio): In the "flush animations" case, ideally, we should only
|
||||
@ -3033,7 +3034,7 @@ void RestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags) {
|
||||
MOZ_ASSERT(!nsContentUtils::IsSafeToRunScript(), "Missing a script blocker!");
|
||||
MOZ_RELEASE_ASSERT(!mInStyleRefresh, "Reentrant call?");
|
||||
|
||||
if (MOZ_UNLIKELY(!shell->DidInitialize())) {
|
||||
if (MOZ_UNLIKELY(!presShell->DidInitialize())) {
|
||||
// PresShell::FlushPendingNotifications doesn't early-return in the case
|
||||
// where the PresShell hasn't yet been initialized (and therefore we haven't
|
||||
// yet done the initial style traversal of the DOM tree). We should arguably
|
||||
@ -3043,7 +3044,7 @@ void RestyleManager::DoProcessPendingRestyles(ServoTraversalFlags aFlags) {
|
||||
}
|
||||
|
||||
// It'd be bad!
|
||||
nsIPresShell::AutoAssertNoFlush noReentrantFlush(*shell);
|
||||
nsIPresShell::AutoAssertNoFlush noReentrantFlush(*presShell);
|
||||
|
||||
// Create a AnimationsWithDestroyedFrame during restyling process to
|
||||
// stop animations and transitions on elements that have no frame at the end
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "nsBidiPresUtils.h"
|
||||
|
||||
#include "mozilla/IntegerRange.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
|
||||
#include "gfxContext.h"
|
||||
@ -489,7 +490,7 @@ static bool IsBidiLeaf(nsIFrame* aFrame) {
|
||||
static nsresult SplitInlineAncestors(nsContainerFrame* aParent,
|
||||
nsIFrame* aFrame) {
|
||||
nsPresContext* presContext = aParent->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
nsIFrame* frame = aFrame;
|
||||
nsContainerFrame* parent = aParent;
|
||||
nsContainerFrame* newParent;
|
||||
@ -579,7 +580,7 @@ static nsresult CreateContinuation(nsIFrame* aFrame, nsIFrame** aNewFrame,
|
||||
*aNewFrame = nullptr;
|
||||
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
NS_ASSERTION(presShell,
|
||||
"PresShell must be set on PresContext before calling "
|
||||
"nsBidiPresUtils::CreateContinuation");
|
||||
|
@ -2749,8 +2749,8 @@ nsDocumentViewer::SetFullZoom(float aFullZoom) {
|
||||
if (GetIsPrintPreview()) {
|
||||
nsPresContext* pc = GetPresContext();
|
||||
NS_ENSURE_TRUE(pc, NS_OK);
|
||||
nsCOMPtr<nsIPresShell> shell = pc->GetPresShell();
|
||||
NS_ENSURE_TRUE(shell, NS_OK);
|
||||
PresShell* presShell = pc->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_OK);
|
||||
|
||||
if (!mPrintPreviewZoomed) {
|
||||
mOriginalPrintPreviewScale = pc->GetPrintPreviewScale();
|
||||
@ -2759,13 +2759,13 @@ nsDocumentViewer::SetFullZoom(float aFullZoom) {
|
||||
|
||||
mPrintPreviewZoom = aFullZoom;
|
||||
pc->SetPrintPreviewScale(aFullZoom * mOriginalPrintPreviewScale);
|
||||
nsIPageSequenceFrame* pf = shell->GetPageSequenceFrame();
|
||||
nsIPageSequenceFrame* pf = presShell->GetPageSequenceFrame();
|
||||
if (pf) {
|
||||
nsIFrame* f = do_QueryFrame(pf);
|
||||
shell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
presShell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
||||
nsIFrame* rootFrame = shell->GetRootFrame();
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
if (rootFrame) {
|
||||
rootFrame->InvalidateFrame();
|
||||
}
|
||||
|
@ -824,7 +824,7 @@ static nsRect GetDisplayPortFromMarginsData(
|
||||
// the choosing of the resolution to display-list building time.
|
||||
ScreenSize alignment;
|
||||
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
MOZ_ASSERT(presShell);
|
||||
|
||||
if (presShell->IsDisplayportSuppressed()) {
|
||||
@ -1047,7 +1047,7 @@ static bool GetDisplayPortImpl(
|
||||
if (frame) {
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
MOZ_ASSERT(presContext);
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
MOZ_ASSERT(presShell);
|
||||
isDisplayportSuppressed = presShell->IsDisplayportSuppressed();
|
||||
}
|
||||
@ -3138,7 +3138,7 @@ FrameMetrics nsLayoutUtils::CalculateBasicFrameMetrics(
|
||||
// we may want to refactor this at some point.
|
||||
FrameMetrics metrics;
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
CSSToLayoutDeviceScale deviceScale = presContext->CSSToDevPixelScale();
|
||||
float resolution = 1.0f;
|
||||
if (frame == presShell->GetRootScrollFrame()) {
|
||||
@ -3206,7 +3206,7 @@ bool nsLayoutUtils::CalculateAndSetDisplayPortMargins(
|
||||
FrameMetrics metrics = CalculateBasicFrameMetrics(aScrollFrame);
|
||||
ScreenMargin displayportMargins =
|
||||
apz::CalculatePendingDisplayPort(metrics, ParentLayerPoint(0.0f, 0.0f));
|
||||
nsIPresShell* presShell = frame->PresContext()->GetPresShell();
|
||||
PresShell* presShell = frame->PresContext()->GetPresShell();
|
||||
return nsLayoutUtils::SetDisplayPortMargins(
|
||||
content, presShell, displayportMargins, 0, aRepaintMode);
|
||||
}
|
||||
@ -3363,7 +3363,7 @@ void nsLayoutUtils::AddExtraBackgroundItems(nsDisplayListBuilder& aBuilder,
|
||||
nscolor aBackstop) {
|
||||
LayoutFrameType frameType = aFrame->Type();
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
// For the viewport frame in print preview/page layout we want to paint
|
||||
// the grey background behind the page, not the canvas color.
|
||||
@ -3497,7 +3497,7 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
|
||||
}
|
||||
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
nsRootPresContext* rootPresContext = presContext->GetRootPresContext();
|
||||
if (!rootPresContext) {
|
||||
return NS_OK;
|
||||
@ -8020,7 +8020,7 @@ nsUnsetAttrRunnable::Run() {
|
||||
static nscoord MinimumFontSizeFor(nsPresContext* aPresContext,
|
||||
WritingMode aWritingMode,
|
||||
nscoord aContainerISize) {
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
PresShell* presShell = aPresContext->PresShell();
|
||||
|
||||
uint32_t emPerLine = presShell->FontSizeInflationEmPerLine();
|
||||
uint32_t minTwips = presShell->FontSizeInflationMinTwips();
|
||||
@ -8207,12 +8207,10 @@ float nsLayoutUtils::FontSizeInflationFor(const nsIFrame* aFrame) {
|
||||
|
||||
/* static */
|
||||
bool nsLayoutUtils::FontSizeInflationEnabled(nsPresContext* aPresContext) {
|
||||
nsIPresShell* presShell = aPresContext->GetPresShell();
|
||||
|
||||
PresShell* presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return presShell->FontSizeInflationEnabled();
|
||||
}
|
||||
|
||||
@ -8328,7 +8326,7 @@ nsMargin nsLayoutUtils::ScrollbarAreaToExcludeFromCompositionBoundsFor(
|
||||
return nsMargin();
|
||||
}
|
||||
nsPresContext* presContext = aScrollFrame->PresContext();
|
||||
nsIPresShell* presShell = presContext->GetPresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return nsMargin();
|
||||
}
|
||||
@ -8360,7 +8358,7 @@ nsSize nsLayoutUtils::CalculateCompositionSizeForFrame(
|
||||
nsSize size = rect.Size();
|
||||
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
bool isRootContentDocRootScrollFrame =
|
||||
presContext->IsRootContentDocument() &&
|
||||
@ -8400,7 +8398,7 @@ CSSSize nsLayoutUtils::CalculateRootCompositionSize(
|
||||
if (!rootPresContext) {
|
||||
rootPresContext = presContext->GetRootPresContext();
|
||||
}
|
||||
nsIPresShell* rootPresShell = nullptr;
|
||||
PresShell* rootPresShell = nullptr;
|
||||
if (rootPresContext) {
|
||||
rootPresShell = rootPresContext->PresShell();
|
||||
if (nsIFrame* rootFrame = rootPresShell->GetRootFrame()) {
|
||||
@ -8704,7 +8702,7 @@ bool nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(
|
||||
static void MaybeReflowForInflationScreenSizeChange(
|
||||
nsPresContext* aPresContext) {
|
||||
if (aPresContext) {
|
||||
nsIPresShell* presShell = aPresContext->GetPresShell();
|
||||
PresShell* presShell = aPresContext->GetPresShell();
|
||||
const bool fontInflationWasEnabled = presShell->FontSizeInflationEnabled();
|
||||
presShell->RecomputeFontSizeInflationEnabled();
|
||||
bool changed = false;
|
||||
@ -8774,7 +8772,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
|
||||
nsPresContext* presContext = aForFrame->PresContext();
|
||||
int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
|
||||
nsIPresShell* presShell = presContext->GetPresShell();
|
||||
PresShell* presShell = presContext->GetPresShell();
|
||||
ScrollMetadata metadata;
|
||||
FrameMetrics& metrics = metadata.GetMetrics();
|
||||
metrics.SetLayoutViewport(CSSRect::FromAppUnits(aViewport));
|
||||
@ -9113,7 +9111,7 @@ Maybe<ScrollMetadata> nsLayoutUtils::GetRootMetadata(
|
||||
const std::function<bool(ViewID& aScrollId)>& aCallback) {
|
||||
nsIFrame* frame = aBuilder->RootReferenceFrame();
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
Document* document = presShell->GetDocument();
|
||||
|
||||
// If we're using containerless scrolling, there is still one case where we
|
||||
|
@ -141,7 +141,7 @@ static bool IsVisualCharset(NotNull<const Encoding*> aCharset) {
|
||||
|
||||
nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType)
|
||||
: mType(aType),
|
||||
mShell(nullptr),
|
||||
mPresShell(nullptr),
|
||||
mDocument(aDocument),
|
||||
mMedium(aType == eContext_Galley ? nsGkAtoms::screen : nsGkAtoms::print),
|
||||
mMediaEmulated(mMedium),
|
||||
@ -270,8 +270,8 @@ void nsPresContext::Destroy() {
|
||||
}
|
||||
|
||||
nsPresContext::~nsPresContext() {
|
||||
MOZ_ASSERT(!mShell, "Presshell forgot to clear our mShell pointer");
|
||||
DetachShell();
|
||||
MOZ_ASSERT(!mPresShell, "Presshell forgot to clear our mPresShell pointer");
|
||||
DetachPresShell();
|
||||
|
||||
Destroy();
|
||||
}
|
||||
@ -400,8 +400,10 @@ void nsPresContext::GetUserPreferences() {
|
||||
}
|
||||
|
||||
void nsPresContext::InvalidatePaintedLayers() {
|
||||
if (!mShell) return;
|
||||
if (nsIFrame* rootFrame = mShell->GetRootFrame()) {
|
||||
if (!mPresShell) {
|
||||
return;
|
||||
}
|
||||
if (nsIFrame* rootFrame = mPresShell->GetRootFrame()) {
|
||||
// FrameLayerBuilder caches invalidation-related values that depend on the
|
||||
// appunits-per-dev-pixel ratio, so ensure that all PaintedLayer drawing
|
||||
// is completely flushed.
|
||||
@ -428,8 +430,8 @@ void nsPresContext::AppUnitsPerDevPixelChanged() {
|
||||
// child document to determine if it needs to build a nsDisplayZoom item. So
|
||||
// if we that changes then we need to invalidate the subdoc frame so that
|
||||
// item gets created/removed.
|
||||
if (mShell) {
|
||||
if (nsIFrame* frame = mShell->GetRootFrame()) {
|
||||
if (mPresShell) {
|
||||
if (nsIFrame* frame = mPresShell->GetRootFrame()) {
|
||||
frame = nsLayoutUtils::GetCrossDocParentFrame(frame);
|
||||
if (frame) {
|
||||
int32_t parentAPD = frame->PresContext()->AppUnitsPerDevPixel();
|
||||
@ -451,12 +453,12 @@ void nsPresContext::PreferenceChanged(const char* aPrefName) {
|
||||
if (prefName.EqualsLiteral("layout.css.dpi") ||
|
||||
prefName.EqualsLiteral("layout.css.devPixelsPerPx")) {
|
||||
int32_t oldAppUnitsPerDevPixel = mDeviceContext->AppUnitsPerDevPixel();
|
||||
if (mDeviceContext->CheckDPIChange() && mShell) {
|
||||
nsCOMPtr<nsIPresShell> shell = mShell;
|
||||
if (mDeviceContext->CheckDPIChange() && mPresShell) {
|
||||
OwningNonNull<mozilla::PresShell> presShell(*mPresShell);
|
||||
// Re-fetch the view manager's window dimensions in case there's a
|
||||
// deferred resize which hasn't affected our mVisibleArea yet
|
||||
nscoord oldWidthAppUnits, oldHeightAppUnits;
|
||||
RefPtr<nsViewManager> vm = shell->GetViewManager();
|
||||
RefPtr<nsViewManager> vm = presShell->GetViewManager();
|
||||
if (!vm) {
|
||||
return;
|
||||
}
|
||||
@ -544,7 +546,7 @@ void nsPresContext::DispatchPrefChangedRunnableIfNeeded() {
|
||||
|
||||
void nsPresContext::UpdateAfterPreferencesChanged() {
|
||||
mPostedPrefChangedRunnable = false;
|
||||
if (!mShell) {
|
||||
if (!mPresShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -560,7 +562,7 @@ void nsPresContext::UpdateAfterPreferencesChanged() {
|
||||
GetUserPreferences();
|
||||
|
||||
// update the presShell: tell it to set the preference style rules up
|
||||
mShell->UpdatePreferenceStyles();
|
||||
mPresShell->UpdatePreferenceStyles();
|
||||
|
||||
InvalidatePaintedLayers();
|
||||
mDeviceContext->FlushFontCache();
|
||||
@ -667,9 +669,9 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {
|
||||
|
||||
// Note: We don't hold a reference on the shell; it has a reference to
|
||||
// us
|
||||
void nsPresContext::AttachShell(nsIPresShell* aShell) {
|
||||
MOZ_ASSERT(!mShell);
|
||||
mShell = aShell;
|
||||
void nsPresContext::AttachPresShell(mozilla::PresShell* aPresShell) {
|
||||
MOZ_ASSERT(!mPresShell);
|
||||
mPresShell = aPresShell;
|
||||
|
||||
mRestyleManager = MakeUnique<mozilla::RestyleManager>(this);
|
||||
|
||||
@ -678,7 +680,7 @@ void nsPresContext::AttachShell(nsIPresShell* aShell) {
|
||||
// namespace here.
|
||||
mCounterStyleManager = new mozilla::CounterStyleManager(this);
|
||||
|
||||
dom::Document* doc = mShell->GetDocument();
|
||||
dom::Document* doc = mPresShell->GetDocument();
|
||||
MOZ_ASSERT(doc);
|
||||
// Have to update PresContext's mDocument before calling any other methods.
|
||||
mDocument = doc;
|
||||
@ -703,19 +705,19 @@ void nsPresContext::AttachShell(nsIPresShell* aShell) {
|
||||
UpdateCharSet(doc->GetDocumentCharacterSet());
|
||||
}
|
||||
|
||||
void nsPresContext::DetachShell() {
|
||||
void nsPresContext::DetachPresShell() {
|
||||
// The counter style manager's destructor needs to deallocate with the
|
||||
// presshell arena. Disconnect it before nulling out the shell.
|
||||
//
|
||||
// XXXbholley: Given recent refactorings, it probably makes more sense to
|
||||
// just null our mShell at the bottom of this function. I'm leaving it
|
||||
// just null our mPresShell at the bottom of this function. I'm leaving it
|
||||
// this way to preserve the old ordering, but I doubt anything would break.
|
||||
if (mCounterStyleManager) {
|
||||
mCounterStyleManager->Disconnect();
|
||||
mCounterStyleManager = nullptr;
|
||||
}
|
||||
|
||||
mShell = nullptr;
|
||||
mPresShell = nullptr;
|
||||
|
||||
if (mAnimationEventDispatcher) {
|
||||
mAnimationEventDispatcher->Disconnect();
|
||||
@ -785,9 +787,9 @@ void nsPresContext::DispatchCharSetChange(NotNull<const Encoding*> aEncoding) {
|
||||
}
|
||||
|
||||
nsPresContext* nsPresContext::GetParentPresContext() {
|
||||
nsIPresShell* shell = GetPresShell();
|
||||
if (shell) {
|
||||
nsViewManager* viewManager = shell->GetViewManager();
|
||||
mozilla::PresShell* presShell = GetPresShell();
|
||||
if (presShell) {
|
||||
nsViewManager* viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
nsView* view = viewManager->GetRootView();
|
||||
if (view) {
|
||||
@ -818,15 +820,15 @@ nsPresContext* nsPresContext::GetToplevelContentDocumentPresContext() {
|
||||
}
|
||||
|
||||
nsIWidget* nsPresContext::GetNearestWidget(nsPoint* aOffset) {
|
||||
NS_ENSURE_TRUE(mShell, nullptr);
|
||||
nsIFrame* frame = mShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(mPresShell, nullptr);
|
||||
nsIFrame* frame = mPresShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(frame, nullptr);
|
||||
return frame->GetView()->GetNearestWidget(aOffset);
|
||||
}
|
||||
|
||||
nsIWidget* nsPresContext::GetRootWidget() {
|
||||
NS_ENSURE_TRUE(mShell, nullptr);
|
||||
nsViewManager* vm = mShell->GetViewManager();
|
||||
NS_ENSURE_TRUE(mPresShell, nullptr);
|
||||
nsViewManager* vm = mPresShell->GetViewManager();
|
||||
if (!vm) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -908,8 +910,8 @@ void nsPresContext::SetImageAnimationMode(uint16_t aMode) {
|
||||
|
||||
// Now walk the content tree and set the animation mode
|
||||
// on all the images.
|
||||
if (mShell != nullptr) {
|
||||
dom::Document* doc = mShell->GetDocument();
|
||||
if (mPresShell) {
|
||||
dom::Document* doc = mPresShell->GetDocument();
|
||||
if (doc) {
|
||||
doc->StyleImageLoader()->SetAnimationMode(aMode);
|
||||
|
||||
@ -949,15 +951,15 @@ float nsPresContext::GetDeviceFullZoom() {
|
||||
}
|
||||
|
||||
void nsPresContext::SetFullZoom(float aZoom) {
|
||||
if (!mShell || mFullZoom == aZoom) {
|
||||
if (!mPresShell || mFullZoom == aZoom) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Re-fetch the view manager's window dimensions in case there's a deferred
|
||||
// resize which hasn't affected our mVisibleArea yet
|
||||
nscoord oldWidthAppUnits, oldHeightAppUnits;
|
||||
mShell->GetViewManager()->GetWindowDimensions(&oldWidthAppUnits,
|
||||
&oldHeightAppUnits);
|
||||
mPresShell->GetViewManager()->GetWindowDimensions(&oldWidthAppUnits,
|
||||
&oldHeightAppUnits);
|
||||
float oldWidthDevPixels = oldWidthAppUnits / float(mCurAppUnitsPerDevPixel);
|
||||
float oldHeightDevPixels = oldHeightAppUnits / float(mCurAppUnitsPerDevPixel);
|
||||
mDeviceContext->SetFullZoom(aZoom);
|
||||
@ -970,7 +972,7 @@ void nsPresContext::SetFullZoom(float aZoom) {
|
||||
|
||||
AppUnitsPerDevPixelChanged();
|
||||
|
||||
mShell->GetViewManager()->SetWindowDimensions(
|
||||
mPresShell->GetViewManager()->SetWindowDimensions(
|
||||
NSToCoordRound(oldWidthDevPixels * AppUnitsPerDevPixel()),
|
||||
NSToCoordRound(oldHeightDevPixels * AppUnitsPerDevPixel()));
|
||||
|
||||
@ -1432,7 +1434,7 @@ void nsPresContext::EmulateMedium(const nsAString& aMediaType) {
|
||||
nsContentUtils::ASCIIToLower(aMediaType, mediaType);
|
||||
|
||||
mMediaEmulated = NS_Atomize(mediaType);
|
||||
if (mMediaEmulated != previousMedium && mShell) {
|
||||
if (mMediaEmulated != previousMedium && mPresShell) {
|
||||
MediaFeatureValuesChanged({MediaFeatureChangeReason::MediumChange});
|
||||
}
|
||||
}
|
||||
@ -1452,8 +1454,8 @@ void nsPresContext::ContentLanguageChanged() {
|
||||
|
||||
void nsPresContext::MediaFeatureValuesChanged(
|
||||
const MediaFeatureChange& aChange) {
|
||||
if (mShell) {
|
||||
mShell->EnsureStyleFlush();
|
||||
if (mPresShell) {
|
||||
mPresShell->EnsureStyleFlush();
|
||||
}
|
||||
|
||||
if (!mPendingMediaFeatureValuesChange) {
|
||||
@ -1466,7 +1468,7 @@ void nsPresContext::MediaFeatureValuesChanged(
|
||||
|
||||
void nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint,
|
||||
RestyleHint aRestyleHint) {
|
||||
if (!mShell) {
|
||||
if (!mPresShell) {
|
||||
// We must have been torn down. Nothing to do here.
|
||||
return;
|
||||
}
|
||||
@ -1491,7 +1493,7 @@ void nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint,
|
||||
|
||||
void nsPresContext::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
|
||||
RestyleHint aRestyleHint) {
|
||||
if (!mShell) {
|
||||
if (!mPresShell) {
|
||||
// We must have been torn down. Nothing to do here.
|
||||
return;
|
||||
}
|
||||
@ -1524,16 +1526,16 @@ void nsPresContext::FlushPendingMediaFeatureValuesChanged() {
|
||||
mPendingMediaFeatureValuesChange.reset();
|
||||
|
||||
// MediumFeaturesChanged updates the applied rules, so it always gets called.
|
||||
if (mShell) {
|
||||
if (mPresShell) {
|
||||
change.mRestyleHint |=
|
||||
mShell->StyleSet()->MediumFeaturesChanged(change.mReason);
|
||||
mPresShell->StyleSet()->MediumFeaturesChanged(change.mReason);
|
||||
}
|
||||
|
||||
if (change.mRestyleHint || change.mChangeHint) {
|
||||
RebuildAllStyleData(change.mChangeHint, change.mRestyleHint);
|
||||
}
|
||||
|
||||
if (!mShell || !mShell->DidInitialize()) {
|
||||
if (!mPresShell || !mPresShell->DidInitialize()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1621,8 +1623,8 @@ bool nsPresContext::EnsureVisible() {
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
void nsPresContext::CountReflows(const char* aName, nsIFrame* aFrame) {
|
||||
if (mShell) {
|
||||
mShell->CountReflows(aName, aFrame);
|
||||
if (mPresShell) {
|
||||
mPresShell->CountReflows(aName, aFrame);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1658,7 +1660,9 @@ gfxUserFontSet* nsPresContext::GetUserFontSet() {
|
||||
}
|
||||
|
||||
void nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont) {
|
||||
if (!mShell) return;
|
||||
if (!mPresShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: this method is called without a font when rules in the userfont set
|
||||
// are updated.
|
||||
@ -1682,7 +1686,7 @@ void nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont) {
|
||||
// it contains that specific font (i.e. the one chosen within the family
|
||||
// given the weight, width, and slant from the nsStyleFont). If it does,
|
||||
// mark that frame dirty and skip inspecting its descendants.
|
||||
if (nsIFrame* root = mShell->GetRootFrame()) {
|
||||
if (nsIFrame* root = mPresShell->GetRootFrame()) {
|
||||
nsFontFaceUtils::MarkDirtyForFontChange(root, aUpdatedFont);
|
||||
}
|
||||
}
|
||||
@ -1707,7 +1711,7 @@ class CounterStyleCleaner final : public nsAPostRefreshObserver {
|
||||
};
|
||||
|
||||
void nsPresContext::FlushCounterStyles() {
|
||||
if (!mShell) {
|
||||
if (!mPresShell) {
|
||||
return; // we've been torn down
|
||||
}
|
||||
if (mCounterStyleManager->IsInitial()) {
|
||||
@ -1743,7 +1747,7 @@ void nsPresContext::NotifyMissingFonts() {
|
||||
}
|
||||
|
||||
void nsPresContext::EnsureSafeToHandOutCSSRules() {
|
||||
if (!mShell->StyleSet()->EnsureUniqueInnerOnCSSSheets()) {
|
||||
if (!mPresShell->StyleSet()->EnsureUniqueInnerOnCSSSheets()) {
|
||||
// Nothing to do.
|
||||
return;
|
||||
}
|
||||
@ -2225,8 +2229,8 @@ bool nsPresContext::HavePendingInputEvent() {
|
||||
}
|
||||
|
||||
bool nsPresContext::HasPendingRestyleOrReflow() {
|
||||
nsIPresShell* shell = PresShell();
|
||||
return shell->NeedStyleFlush() || shell->HasPendingReflow();
|
||||
mozilla::PresShell* presShell = PresShell();
|
||||
return presShell->NeedStyleFlush() || presShell->HasPendingReflow();
|
||||
}
|
||||
|
||||
void nsPresContext::ReflowStarted(bool aInterruptible) {
|
||||
@ -2257,7 +2261,7 @@ void nsPresContext::ReflowStarted(bool aInterruptible) {
|
||||
|
||||
bool nsPresContext::CheckForInterrupt(nsIFrame* aFrame) {
|
||||
if (mHasPendingInterrupt) {
|
||||
mShell->FrameNeedsToContinueReflow(aFrame);
|
||||
mPresShell->FrameNeedsToContinueReflow(aFrame);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2291,7 +2295,7 @@ bool nsPresContext::CheckForInterrupt(nsIFrame* aFrame) {
|
||||
#ifdef NOISY_INTERRUPTIBLE_REFLOW
|
||||
printf("*** DETECTED pending interrupt (time=%lld)\n", PR_Now());
|
||||
#endif /* NOISY_INTERRUPTIBLE_REFLOW */
|
||||
mShell->FrameNeedsToContinueReflow(aFrame);
|
||||
mPresShell->FrameNeedsToContinueReflow(aFrame);
|
||||
}
|
||||
return mHasPendingInterrupt;
|
||||
}
|
||||
@ -2363,7 +2367,7 @@ void nsPresContext::NotifyContentfulPaint() {
|
||||
}
|
||||
|
||||
void nsPresContext::NotifyDOMContentFlushed() {
|
||||
NS_ENSURE_TRUE_VOID(mShell);
|
||||
NS_ENSURE_TRUE_VOID(mPresShell);
|
||||
if (IsRootContentDocument()) {
|
||||
RefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
|
||||
if (timing) {
|
||||
@ -2427,12 +2431,12 @@ nsBidi& nsPresContext::GetBidiEngine() {
|
||||
}
|
||||
|
||||
void nsPresContext::FlushFontFeatureValues() {
|
||||
if (!mShell) {
|
||||
if (!mPresShell) {
|
||||
return; // we've been torn down
|
||||
}
|
||||
|
||||
if (mFontFeatureValuesDirty) {
|
||||
ServoStyleSet* styleSet = mShell->StyleSet();
|
||||
ServoStyleSet* styleSet = mPresShell->StyleSet();
|
||||
mFontFeatureValuesLookup = styleSet->BuildFontFeatureValueSet();
|
||||
mFontFeatureValuesDirty = false;
|
||||
}
|
||||
@ -2441,9 +2445,9 @@ void nsPresContext::FlushFontFeatureValues() {
|
||||
#ifdef DEBUG
|
||||
|
||||
void nsPresContext::ValidatePresShellAndDocumentReleation() const {
|
||||
NS_ASSERTION(
|
||||
!mShell || !mShell->GetDocument() || mShell->GetDocument() == mDocument,
|
||||
"nsPresContext doesn't have the same document as nsPresShell!");
|
||||
NS_ASSERTION(!mPresShell || !mPresShell->GetDocument() ||
|
||||
mPresShell->GetDocument() == mDocument,
|
||||
"nsPresContext doesn't have the same document as nsPresShell!");
|
||||
}
|
||||
|
||||
#endif // #ifdef DEBUG
|
||||
@ -2498,7 +2502,7 @@ void nsRootPresContext::ComputePluginGeometryUpdates(
|
||||
|
||||
if (aBuilder) {
|
||||
MOZ_ASSERT(aList);
|
||||
nsIFrame* rootFrame = mShell->GetRootFrame();
|
||||
nsIFrame* rootFrame = mPresShell->GetRootFrame();
|
||||
|
||||
if (rootFrame && aBuilder->ContainsPluginItem()) {
|
||||
aBuilder->SetForPluginGeometry(true);
|
||||
|
@ -48,7 +48,6 @@ class nsBidi;
|
||||
class nsIPrintSettings;
|
||||
class nsDocShell;
|
||||
class nsIDocShell;
|
||||
class nsIPresShell;
|
||||
class nsITheme;
|
||||
class nsIContent;
|
||||
class nsIFrame;
|
||||
@ -78,6 +77,7 @@ class EffectCompositor;
|
||||
class Encoding;
|
||||
class EventStateManager;
|
||||
class CounterStyleManager;
|
||||
class PresShell;
|
||||
class RestyleManager;
|
||||
namespace layers {
|
||||
class ContainerLayer;
|
||||
@ -158,20 +158,20 @@ class nsPresContext : public nsISupports,
|
||||
* Set and detach presentation shell that this context is bound to.
|
||||
* A presentation context may only be bound to a single shell.
|
||||
*/
|
||||
void AttachShell(nsIPresShell* aShell);
|
||||
void DetachShell();
|
||||
void AttachPresShell(mozilla::PresShell* aPresShell);
|
||||
void DetachPresShell();
|
||||
|
||||
nsPresContextType Type() const { return mType; }
|
||||
|
||||
/**
|
||||
* Get the PresentationShell that this context is bound to.
|
||||
*/
|
||||
nsIPresShell* PresShell() const {
|
||||
NS_ASSERTION(mShell, "Null pres shell");
|
||||
return mShell;
|
||||
mozilla::PresShell* PresShell() const {
|
||||
NS_ASSERTION(mPresShell, "Null pres shell");
|
||||
return mPresShell;
|
||||
}
|
||||
|
||||
nsIPresShell* GetPresShell() const { return mShell; }
|
||||
mozilla::PresShell* GetPresShell() const { return mPresShell; }
|
||||
|
||||
void DispatchCharSetChange(NotNull<const Encoding*> aCharSet);
|
||||
|
||||
@ -1095,9 +1095,9 @@ class nsPresContext : public nsISupports,
|
||||
// please make the ownership explicit (pinkerton, scc).
|
||||
|
||||
nsPresContextType mType;
|
||||
// the nsPresShell owns a strong reference to the nsPresContext, and is
|
||||
// the PresShell owns a strong reference to the nsPresContext, and is
|
||||
// responsible for nulling this pointer before it is destroyed
|
||||
nsIPresShell* MOZ_NON_OWNING_REF mShell; // [WEAK]
|
||||
mozilla::PresShell* MOZ_NON_OWNING_REF mPresShell; // [WEAK]
|
||||
RefPtr<mozilla::dom::Document> mDocument;
|
||||
RefPtr<nsDeviceContext> mDeviceContext; // [STRONG] could be weak, but
|
||||
// better safe than sorry.
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/IntegerRange.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/FontTableURIProtocolHandler.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
@ -1775,7 +1776,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
|
||||
mSkippedPaints = false;
|
||||
mWarningThreshold = 1;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
|
||||
if (!presShell ||
|
||||
(!HasObservers() && !HasImageRequests() &&
|
||||
mVisualViewportResizeEvents.IsEmpty() && mScrollEvents.IsEmpty() &&
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsListControlFrame.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "mozilla/PresState.h"
|
||||
#include "nsView.h"
|
||||
#include "nsViewManager.h"
|
||||
@ -46,6 +45,7 @@
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "gfx2DGlue.h"
|
||||
#include "mozilla/widget/nsAutoRollup.h"
|
||||
@ -307,14 +307,14 @@ void nsComboboxControlFrame::ShowPopup(bool aShowPopup) {
|
||||
}
|
||||
|
||||
// fire a popup dom event if it is safe to do so
|
||||
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
|
||||
if (shell && nsContentUtils::IsSafeToRunScript()) {
|
||||
RefPtr<mozilla::PresShell> presShell = PresContext()->GetPresShell();
|
||||
if (presShell && nsContentUtils::IsSafeToRunScript()) {
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
WidgetMouseEvent event(true,
|
||||
aShowPopup ? eXULPopupShowing : eXULPopupHiding,
|
||||
nullptr, WidgetMouseEvent::eReal);
|
||||
|
||||
shell->HandleDOMEventWithTarget(mContent, &event, &status);
|
||||
presShell->HandleDOMEventWithTarget(mContent, &event, &status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "nsPresContext.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "nsRange.h" //for selection setting helper func
|
||||
@ -33,6 +32,7 @@
|
||||
#include "nsILayoutHistoryState.h"
|
||||
|
||||
#include "nsFocusManager.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/PresState.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
@ -709,7 +709,7 @@ void nsTextControlFrame::SetFocus(bool aOn, bool aRepaint) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = PresContext()->GetPresShell();
|
||||
mozilla::PresShell* presShell = PresContext()->GetPresShell();
|
||||
RefPtr<nsCaret> caret = presShell->GetCaret();
|
||||
if (!caret) {
|
||||
return;
|
||||
@ -745,9 +745,8 @@ void nsTextControlFrame::SetFocus(bool aOn, bool aRepaint) {
|
||||
// document or by the text input/area. Clear any selection in the
|
||||
// document since the focus is now on our independent selection.
|
||||
|
||||
nsCOMPtr<nsISelectionController> selcon = do_QueryInterface(presShell);
|
||||
RefPtr<Selection> docSel =
|
||||
selcon->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
presShell->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
if (!docSel) {
|
||||
return;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsPresContextInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
@ -54,6 +53,7 @@
|
||||
#include "mozilla/dom/HTMLDetailsElement.h"
|
||||
#include "mozilla/dom/HTMLSummaryElement.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
@ -323,12 +323,12 @@ void nsBlockFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
||||
DestroyAbsoluteFrames(aDestructRoot, aPostDestroyData);
|
||||
mFloats.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell* shell = presContext->PresShell();
|
||||
mozilla::PresShell* presShell = presContext->PresShell();
|
||||
nsLineBox::DeleteLineList(presContext, mLines, aDestructRoot, &mFrames,
|
||||
aPostDestroyData);
|
||||
|
||||
if (HasPushedFloats()) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
PushedFloatProperty());
|
||||
RemoveStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
|
||||
}
|
||||
@ -342,13 +342,13 @@ void nsBlockFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
||||
}
|
||||
|
||||
if (GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
OverflowOutOfFlowsProperty());
|
||||
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
||||
}
|
||||
|
||||
if (HasOutsideMarker()) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
OutsideMarkerProperty());
|
||||
RemoveStateBits(NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "mozilla/layers/WebRenderMessages.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsFontMetrics.h"
|
||||
@ -27,7 +28,6 @@
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsCounterManager.h"
|
||||
@ -1155,10 +1155,10 @@ nsresult nsBulletFrame::OnSizeAvailable(imgIRequest* aRequest,
|
||||
|
||||
// Now that the size is available (or an error occurred), trigger
|
||||
// a reflow of the bullet frame.
|
||||
nsIPresShell* shell = presContext->GetPresShell();
|
||||
if (shell) {
|
||||
shell->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
mozilla::PresShell* presShell = presContext->GetPresShell();
|
||||
if (presShell) {
|
||||
presShell->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1178,11 +1178,12 @@ void nsBulletFrame::GetLoadGroup(nsPresContext* aPresContext,
|
||||
|
||||
MOZ_ASSERT(nullptr != aLoadGroup, "null OUT parameter pointer");
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!shell) return;
|
||||
|
||||
Document* doc = shell->GetDocument();
|
||||
Document* doc = presShell->GetDocument();
|
||||
if (!doc) return;
|
||||
|
||||
*aLoadGroup = doc->GetDocumentLoadGroup().take();
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsPopupSetFrame.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsFrameManager.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsContainerFrame.h"
|
||||
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/HTMLSummaryElement.h"
|
||||
#include "nsAbsoluteContainingBlock.h"
|
||||
#include "nsAttrValue.h"
|
||||
@ -20,7 +21,6 @@
|
||||
#include "nsPoint.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsView.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsViewManager.h"
|
||||
@ -257,9 +257,9 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
||||
|
||||
// Destroy frames on the auxiliary frame lists and delete the lists.
|
||||
nsPresContext* pc = PresContext();
|
||||
nsIPresShell* shell = pc->PresShell();
|
||||
mozilla::PresShell* presShell = pc->PresShell();
|
||||
if (hasO) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
OverflowProperty());
|
||||
}
|
||||
|
||||
@ -267,11 +267,11 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
||||
IsFrameOfType(eCanContainOverflowContainers) || !(hasOC || hasEOC),
|
||||
"this type of frame shouldn't have overflow containers");
|
||||
if (hasOC) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
OverflowContainersProperty());
|
||||
}
|
||||
if (hasEOC) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
ExcessOverflowContainersProperty());
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
||||
StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_NONE,
|
||||
"only top layer frame may have backdrop");
|
||||
if (hasBackdrop) {
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, shell,
|
||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
||||
BackdropProperty());
|
||||
}
|
||||
}
|
||||
|
@ -10,12 +10,13 @@
|
||||
#include "nsPresContext.h"
|
||||
#include "nsPresContextInlines.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
|
||||
@ -289,7 +290,7 @@ nsresult nsFirstLetterFrame::CreateContinuationForFloatingParent(
|
||||
|
||||
*aContinuation = nullptr;
|
||||
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->PresShell();
|
||||
nsPlaceholderFrame* placeholderFrame = GetPlaceholderFrame();
|
||||
nsContainerFrame* parent = placeholderFrame->GetParent();
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "gfxContext.h"
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "WritingModes.h"
|
||||
|
||||
@ -4420,11 +4421,12 @@ nsFlexContainerFrame* nsFlexContainerFrame::GetFlexFrameWithComputedInfo(
|
||||
// Hold onto aFrame while we do this, in case reflow destroys it.
|
||||
AutoWeakFrame weakFrameRef(aFrame);
|
||||
|
||||
nsIPresShell* shell = flexFrame->PresContext()->PresShell();
|
||||
RefPtr<mozilla::PresShell> presShell =
|
||||
static_cast<mozilla::PresShell*>(flexFrame->PresShell());
|
||||
flexFrame->AddStateBits(NS_STATE_FLEX_GENERATE_COMPUTED_VALUES);
|
||||
shell->FrameNeedsReflow(flexFrame, nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
shell->FlushPendingNotifications(FlushType::Layout);
|
||||
presShell->FrameNeedsReflow(flexFrame, nsIPresShell::eResize,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
presShell->FlushPendingNotifications(FlushType::Layout);
|
||||
|
||||
// Since the reflow may have side effects, get the flex frame
|
||||
// again. But if the weakFrameRef is no longer valid, then we
|
||||
|
@ -444,10 +444,10 @@ void AutoWeakFrame::Init(nsIFrame* aFrame) {
|
||||
Clear(mFrame ? mFrame->PresContext()->GetPresShell() : nullptr);
|
||||
mFrame = aFrame;
|
||||
if (mFrame) {
|
||||
nsIPresShell* shell = mFrame->PresContext()->GetPresShell();
|
||||
NS_WARNING_ASSERTION(shell, "Null PresShell in AutoWeakFrame!");
|
||||
if (shell) {
|
||||
shell->AddAutoWeakFrame(this);
|
||||
mozilla::PresShell* presShell = mFrame->PresContext()->GetPresShell();
|
||||
NS_WARNING_ASSERTION(presShell, "Null PresShell in AutoWeakFrame!");
|
||||
if (presShell) {
|
||||
presShell->AddAutoWeakFrame(this);
|
||||
} else {
|
||||
mFrame = nullptr;
|
||||
}
|
||||
@ -458,10 +458,10 @@ void WeakFrame::Init(nsIFrame* aFrame) {
|
||||
Clear(mFrame ? mFrame->PresContext()->GetPresShell() : nullptr);
|
||||
mFrame = aFrame;
|
||||
if (mFrame) {
|
||||
nsIPresShell* shell = mFrame->PresContext()->GetPresShell();
|
||||
MOZ_ASSERT(shell, "Null PresShell in WeakFrame!");
|
||||
if (shell) {
|
||||
shell->AddWeakFrame(this);
|
||||
mozilla::PresShell* presShell = mFrame->PresContext()->GetPresShell();
|
||||
MOZ_ASSERT(presShell, "Null PresShell in WeakFrame!");
|
||||
if (presShell) {
|
||||
presShell->AddWeakFrame(this);
|
||||
} else {
|
||||
mFrame = nullptr;
|
||||
}
|
||||
@ -4207,13 +4207,15 @@ nsFrame::HandlePress(nsPresContext* aPresContext, WidgetGUIEvent* aEvent,
|
||||
// Check with the ESM to see if we should process this one
|
||||
if (!aPresContext->EventStateManager()->EventStatusOK(aEvent)) return NS_OK;
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
if (!shell) return NS_ERROR_FAILURE;
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// if we are in Navigator and the click is in a draggable node, we don't want
|
||||
// to start selection because we don't want to interfere with a potential
|
||||
// drag of said node and steal all its glory.
|
||||
int16_t isEditor = shell->GetSelectionFlags();
|
||||
int16_t isEditor = presShell->GetSelectionFlags();
|
||||
// weaaak. only the editor can display frame selection not just text and
|
||||
// images
|
||||
isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL;
|
||||
@ -4267,7 +4269,7 @@ nsFrame::HandlePress(nsPresContext* aPresContext, WidgetGUIEvent* aEvent,
|
||||
if (useFrameSelection)
|
||||
frameselection = GetConstFrameSelection();
|
||||
else
|
||||
frameselection = shell->ConstFrameSelection();
|
||||
frameselection = presShell->ConstFrameSelection();
|
||||
|
||||
if (!frameselection || frameselection->GetDisplaySelection() ==
|
||||
nsISelectionController::SELECTION_OFF)
|
||||
@ -4300,7 +4302,7 @@ nsFrame::HandlePress(nsPresContext* aPresContext, WidgetGUIEvent* aEvent,
|
||||
int32_t contentOffset;
|
||||
TableSelection target;
|
||||
nsresult rv;
|
||||
rv = GetDataForTableSelection(frameselection, shell, mouseEvent,
|
||||
rv = GetDataForTableSelection(frameselection, presShell, mouseEvent,
|
||||
getter_AddRefs(parentContent), &contentOffset,
|
||||
&target);
|
||||
if (NS_SUCCEEDED(rv) && parentContent) {
|
||||
@ -4551,7 +4553,7 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext,
|
||||
int32_t contentOffset;
|
||||
TableSelection target;
|
||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||
nsCOMPtr<nsIPresShell> presShell = aPresContext->PresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->PresShell();
|
||||
nsresult result;
|
||||
result = GetDataForTableSelection(frameselection, presShell, mouseEvent,
|
||||
getter_AddRefs(parentContent),
|
||||
@ -4709,8 +4711,7 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
|
||||
if (doc) {
|
||||
mozilla::PresShell* capturingPresShell = doc->GetPresShell();
|
||||
if (capturingPresShell &&
|
||||
capturingPresShell !=
|
||||
static_cast<mozilla::PresShell*>(PresContext()->GetPresShell())) {
|
||||
capturingPresShell != PresContext()->GetPresShell()) {
|
||||
frameSelection = capturingPresShell->FrameSelection();
|
||||
}
|
||||
}
|
||||
@ -7638,9 +7639,8 @@ void nsIFrame::RootFrameList(nsPresContext* aPresContext, FILE* out,
|
||||
const char* aPrefix) {
|
||||
if (!aPresContext || !out) return;
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
if (shell) {
|
||||
nsIFrame* frame = shell->GetRootFrame();
|
||||
if (mozilla::PresShell* presShell = aPresContext->GetPresShell()) {
|
||||
nsIFrame* frame = presShell->GetRootFrame();
|
||||
if (frame) {
|
||||
frame->List(out, aPrefix);
|
||||
}
|
||||
@ -7679,7 +7679,8 @@ nsresult nsFrame::GetSelectionController(nsPresContext* aPresContext,
|
||||
frame = frame->GetParent();
|
||||
}
|
||||
|
||||
return CallQueryInterface(aPresContext->GetPresShell(), aSelCon);
|
||||
*aSelCon = do_AddRef(aPresContext->PresShell()).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsFrameSelection> nsIFrame::GetFrameSelection() {
|
||||
@ -7912,9 +7913,11 @@ nsresult nsFrame::GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
|
||||
// special check. if we allow non-text selection then we can allow a hit
|
||||
// location to fall before a table. otherwise there is no way to get and
|
||||
// click signal to fall before a table (it being a line iterator itself)
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
if (!shell) return NS_ERROR_FAILURE;
|
||||
int16_t isEditor = shell->GetSelectionFlags();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
int16_t isEditor = presShell->GetSelectionFlags();
|
||||
isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL;
|
||||
if (isEditor) {
|
||||
if (resultFrame->IsTableWrapperFrame()) {
|
||||
|
@ -7,11 +7,11 @@
|
||||
#include "nsFrameList.h"
|
||||
|
||||
#include "mozilla/ArenaObjectID.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsBidiPresUtils.h"
|
||||
#include "nsContainerFrame.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsILineIterator.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/Helpers.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
@ -23,7 +24,6 @@
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsHTMLParts.h"
|
||||
@ -203,7 +203,7 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
}
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell* shell = presContext->PresShell();
|
||||
mozilla::PresShell* presShell = presContext->PresShell();
|
||||
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
int32_t borderWidth = GetBorderWidth(presContext, false);
|
||||
@ -281,12 +281,12 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
continue;
|
||||
}
|
||||
|
||||
RefPtr<ComputedStyle> kidSC = shell->StyleSet()->ResolveStyleFor(
|
||||
RefPtr<ComputedStyle> kidSC = presShell->StyleSet()->ResolveStyleFor(
|
||||
child->AsElement(), LazyComputeBehavior::Allow);
|
||||
|
||||
nsIFrame* frame;
|
||||
if (child->IsHTMLElement(nsGkAtoms::frameset)) {
|
||||
frame = NS_NewHTMLFramesetFrame(shell, kidSC);
|
||||
frame = NS_NewHTMLFramesetFrame(presShell, kidSC);
|
||||
|
||||
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
|
||||
childFrame->SetParentFrameborder(frameborder);
|
||||
@ -296,7 +296,7 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
|
||||
mChildBorderColors[mChildCount].Set(childFrame->GetBorderColor());
|
||||
} else { // frame
|
||||
frame = NS_NewSubDocumentFrame(shell, kidSC);
|
||||
frame = NS_NewSubDocumentFrame(presShell, kidSC);
|
||||
|
||||
frame->Init(child, this, nullptr);
|
||||
|
||||
@ -315,12 +315,12 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
for (int blankX = mChildCount; blankX < numCells; blankX++) {
|
||||
RefPtr<ComputedStyle> pseudoComputedStyle;
|
||||
pseudoComputedStyle =
|
||||
shell->StyleSet()->ResolveNonInheritingAnonymousBoxStyle(
|
||||
presShell->StyleSet()->ResolveNonInheritingAnonymousBoxStyle(
|
||||
PseudoStyleType::framesetBlank);
|
||||
|
||||
// XXX the blank frame is using the content of its parent - at some point it
|
||||
// should just have null content, if we support that
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new (shell)
|
||||
nsHTMLFramesetBlankFrame* blankFrame = new (presShell)
|
||||
nsHTMLFramesetBlankFrame(pseudoComputedStyle, PresContext());
|
||||
|
||||
blankFrame->Init(mContent, this, nullptr);
|
||||
@ -762,8 +762,8 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
|
||||
|
||||
nsIPresShell* shell = aPresContext->PresShell();
|
||||
ServoStyleSet* styleSet = shell->StyleSet();
|
||||
mozilla::PresShell* presShell = aPresContext->PresShell();
|
||||
ServoStyleSet* styleSet = presShell->StyleSet();
|
||||
|
||||
GetParent()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||
|
||||
@ -872,7 +872,7 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
||||
pseudoComputedStyle = styleSet->ResolveNonInheritingAnonymousBoxStyle(
|
||||
PseudoStyleType::horizontalFramesetBorder);
|
||||
|
||||
borderFrame = new (shell) nsHTMLFramesetBorderFrame(
|
||||
borderFrame = new (presShell) nsHTMLFramesetBorderFrame(
|
||||
pseudoComputedStyle, PresContext(), borderWidth, false, false);
|
||||
borderFrame->Init(mContent, this, nullptr);
|
||||
mChildCount++;
|
||||
@ -901,7 +901,7 @@ void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
||||
styleSet->ResolveNonInheritingAnonymousBoxStyle(
|
||||
PseudoStyleType::verticalFramesetBorder);
|
||||
|
||||
borderFrame = new (shell) nsHTMLFramesetBorderFrame(
|
||||
borderFrame = new (presShell) nsHTMLFramesetBorderFrame(
|
||||
pseudoComputedStyle, PresContext(), borderWidth, true, false);
|
||||
borderFrame->Init(mContent, this, nullptr);
|
||||
mChildCount++;
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "mozilla/ContentEvents.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
@ -3792,7 +3793,7 @@ bool ScrollFrameHelper::DecideScrollableLayer(
|
||||
rootPresContext = pc->GetRootPresContext();
|
||||
}
|
||||
if (rootPresContext) {
|
||||
const nsIPresShell* const rootPresShell =
|
||||
const mozilla::PresShell* const rootPresShell =
|
||||
rootPresContext->PresShell();
|
||||
nsIFrame* rootFrame = rootPresShell->GetRootScrollFrame();
|
||||
if (!rootFrame) {
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/PodOperations.h" // for PodZero
|
||||
#include "mozilla/Poison.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsAbsoluteContainingBlock.h"
|
||||
#include "nsAlgorithm.h" // for clamped()
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
|
@ -97,7 +97,6 @@
|
||||
|
||||
class nsAtom;
|
||||
class nsPresContext;
|
||||
class nsIPresShell;
|
||||
class nsView;
|
||||
class nsIWidget;
|
||||
class nsISelectionController;
|
||||
@ -130,6 +129,7 @@ namespace mozilla {
|
||||
|
||||
enum class PseudoStyleType : uint8_t;
|
||||
class EventStates;
|
||||
class PresShell;
|
||||
struct ReflowInput;
|
||||
class ReflowOutput;
|
||||
class ServoRestyleState;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "mozilla/layers/RenderRootStateManager.h"
|
||||
#include "mozilla/layers/WebRenderLayerManager.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
@ -34,7 +35,6 @@
|
||||
#include "nsString.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -827,7 +827,7 @@ void nsImageFrame::MaybeDecodeForPredictedSize() {
|
||||
}
|
||||
|
||||
// OK, we're ready to decode. Compute the scale to the screen...
|
||||
nsIPresShell* presShell = PresContext()->GetPresShell();
|
||||
mozilla::PresShell* presShell = PresContext()->PresShell();
|
||||
LayoutDeviceToScreenScale2D resolutionToScreen(
|
||||
presShell->GetCumulativeResolution() *
|
||||
nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(this));
|
||||
@ -2454,12 +2454,15 @@ void nsImageFrame::GetLoadGroup(nsPresContext* aPresContext,
|
||||
|
||||
MOZ_ASSERT(nullptr != aLoadGroup, "null OUT parameter pointer");
|
||||
|
||||
nsIPresShell* shell = aPresContext->GetPresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!shell) return;
|
||||
|
||||
Document* doc = shell->GetDocument();
|
||||
if (!doc) return;
|
||||
Document* doc = presShell->GetDocument();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
*aLoadGroup = doc->GetDocumentLoadGroup().take();
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/ArenaObjectID.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/WritingModes.h"
|
||||
#include "nsBidiPresUtils.h"
|
||||
@ -352,7 +353,7 @@ bool nsLineBox::CachedIsEmpty() {
|
||||
void nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
||||
nsIFrame* aDestructRoot, nsFrameList* aFrames,
|
||||
PostDestroyData& aPostDestroyData) {
|
||||
nsIPresShell* shell = aPresContext->PresShell();
|
||||
PresShell* presShell = aPresContext->PresShell();
|
||||
|
||||
// Keep our line list and frame list up to date as we
|
||||
// remove frames, in case something wants to traverse the
|
||||
@ -373,7 +374,7 @@ void nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
||||
MOZ_DIAGNOSTIC_ASSERT(line == aLines.front(),
|
||||
"destroying child frames messed up our lines!");
|
||||
aLines.pop_front();
|
||||
line->Destroy(shell);
|
||||
line->Destroy(presShell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,10 +4,12 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "nsPageContentFrame.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsSimplePageSequenceFrame.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "nsPageFrame.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "gfxContext.h"
|
||||
#include "nsDeviceContext.h"
|
||||
@ -13,7 +14,6 @@
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPageContentFrame.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsSimplePageSequenceFrame.h" // for nsSharedPageData
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#ifdef XP_WIN
|
||||
// This is needed for DoublePassRenderingEvent.
|
||||
# include "mozilla/plugins/PluginMessageUtils.h"
|
||||
@ -22,7 +23,6 @@
|
||||
#include "nscore.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsView.h"
|
||||
#include "nsViewManager.h"
|
||||
|
@ -6,13 +6,15 @@
|
||||
|
||||
#include "nsSimplePageSequenceFrame.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/HTMLCanvasElement.h"
|
||||
|
||||
#include "DateTimeFormat.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "gfxContext.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPrintSettings.h"
|
||||
#include "nsPageFrame.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
@ -21,7 +23,6 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsHTMLCanvasFrame.h"
|
||||
#include "mozilla/dom/HTMLCanvasElement.h"
|
||||
#include "nsICanvasRenderingContextInternal.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include <algorithm>
|
||||
|
@ -1025,7 +1025,7 @@ static void DestroyDisplayItemDataForFrames(nsIFrame* aFrame) {
|
||||
static bool BeginSwapDocShellsForDocument(Document* aDocument, void*) {
|
||||
MOZ_ASSERT(aDocument, "null document");
|
||||
|
||||
PresShell* presShell = aDocument->GetPresShell();
|
||||
mozilla::PresShell* presShell = aDocument->GetPresShell();
|
||||
if (presShell) {
|
||||
// Disable painting while the views are detached, see bug 946929.
|
||||
presShell->SetNeverPainting(true);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/BinarySearch.h"
|
||||
@ -39,7 +40,6 @@
|
||||
#include "SVGTextFrame.h"
|
||||
#include "nsCoord.h"
|
||||
#include "gfxContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
@ -4773,7 +4773,7 @@ nsresult nsTextFrame::CharacterDataChanged(
|
||||
// dirty bit without bothering to call FrameNeedsReflow again.)
|
||||
nsIFrame* lastDirtiedFrameParent = nullptr;
|
||||
|
||||
nsIPresShell* shell = PresContext()->GetPresShell();
|
||||
mozilla::PresShell* presShell = PresContext()->GetPresShell();
|
||||
do {
|
||||
// textFrame contained deleted text (or the insertion point,
|
||||
// if this was a pure insertion).
|
||||
@ -4801,8 +4801,8 @@ nsresult nsTextFrame::CharacterDataChanged(
|
||||
textFrame->mReflowRequestedForCharDataChange = true;
|
||||
if (!areAncestorsAwareOfReflowRequest) {
|
||||
// Ask the parent frame to reflow me.
|
||||
shell->FrameNeedsReflow(textFrame, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
presShell->FrameNeedsReflow(textFrame, nsIPresShell::eStyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
} else {
|
||||
// We already called FrameNeedsReflow on behalf of an earlier sibling,
|
||||
// so we can just mark this frame as dirty and don't need to bother
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "nsTableFrame.h"
|
||||
#include "celldata.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "gfxContext.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
#include "ActiveLayerTracker.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/gfx/PathHelpers.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#include "BorderConsts.h"
|
||||
#include "nsStyleConsts.h"
|
||||
@ -26,7 +27,6 @@
|
||||
#include "nsIFrameInlines.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
|
@ -2587,7 +2587,7 @@ FrameLayerBuilder* nsDisplayList::BuildLayers(nsDisplayListBuilder* aBuilder,
|
||||
bool aIsWidgetTransaction) {
|
||||
nsIFrame* frame = aBuilder->RootReferenceFrame();
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
|
||||
FrameLayerBuilder* layerBuilder = new FrameLayerBuilder();
|
||||
layerBuilder->Init(aBuilder, aLayerManager);
|
||||
@ -2715,7 +2715,7 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(
|
||||
|
||||
nsIFrame* frame = aBuilder->RootReferenceFrame();
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
Document* document = presShell->GetDocument();
|
||||
|
||||
if (layerManager->GetBackendType() == layers::LayersBackend::LAYERS_WR) {
|
||||
@ -6740,7 +6740,7 @@ UniquePtr<ScrollMetadata> nsDisplaySubDocument::ComputeScrollMetadata(
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
bool isRootContentDocument = presContext->IsRootContentDocument();
|
||||
nsIPresShell* presShell = presContext->PresShell();
|
||||
PresShell* presShell = presContext->PresShell();
|
||||
ContainerLayerParameters params(
|
||||
aContainerParameters.mXScale * presShell->GetResolution(),
|
||||
aContainerParameters.mYScale * presShell->GetResolution(), nsIntPoint(),
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Types.h"
|
||||
#include "mozilla/WritingModes.h"
|
||||
#include "nsPresContext.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "nsFontFaceUtils.h"
|
||||
|
||||
#include "gfxUserFontSet.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "nsIFrame.h"
|
||||
@ -129,7 +130,7 @@ void nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot,
|
||||
subtrees.AppendElement(aSubtreeRoot);
|
||||
|
||||
nsPresContext* pc = aSubtreeRoot->PresContext();
|
||||
nsIPresShell* ps = pc->PresShell();
|
||||
PresShell* presShell = pc->PresShell();
|
||||
|
||||
// check descendants, iterating over subtrees that may include
|
||||
// additional subtrees associated with placeholders
|
||||
@ -150,7 +151,7 @@ void nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot,
|
||||
FontUsageKind kind = FrameFontUsage(f, pc, aFont);
|
||||
if (kind != FontUsageKind::None) {
|
||||
if (alreadyScheduled == ReflowAlreadyScheduled::No) {
|
||||
ScheduleReflow(ps, f);
|
||||
ScheduleReflow(presShell, f);
|
||||
alreadyScheduled = ReflowAlreadyScheduled::Yes;
|
||||
}
|
||||
if (kind == FontUsageKind::FrameAndFontMetrics) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/PatternHelpers.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsBidiPresUtils.h"
|
||||
#include "nsBlockFrame.h"
|
||||
|
@ -10,6 +10,9 @@
|
||||
// Keep others in (case-insensitive) order:
|
||||
#include "ImgDrawResult.h"
|
||||
#include "gfxContext.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/SVGForeignObjectElement.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
@ -17,11 +20,9 @@
|
||||
#include "nsRegion.h"
|
||||
#include "nsSVGContainerFrame.h"
|
||||
#include "SVGObserverUtils.h"
|
||||
#include "mozilla/dom/SVGForeignObjectElement.h"
|
||||
#include "nsSVGIntegrationUtils.h"
|
||||
#include "nsSVGOuterSVGFrame.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
@ -3,8 +3,11 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "nsCellMap.h"
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
#include "nsTableRowFrame.h"
|
||||
|
@ -7,13 +7,14 @@
|
||||
|
||||
#include "gfxContext.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/Helpers.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsTableColFrame.h"
|
||||
#include "nsTableRowFrame.h"
|
||||
#include "nsTableRowGroupFrame.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsCSSRendering.h"
|
||||
@ -22,7 +23,6 @@
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/IntegerRange.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/WritingModes.h"
|
||||
|
||||
#include "gfxContext.h"
|
||||
@ -35,7 +36,6 @@
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsError.h"
|
||||
@ -644,14 +644,14 @@ nsTableCellMap* nsTableFrame::GetCellMap() const {
|
||||
nsTableColGroupFrame* nsTableFrame::CreateSyntheticColGroupFrame() {
|
||||
nsIContent* colGroupContent = GetContent();
|
||||
nsPresContext* presContext = PresContext();
|
||||
nsIPresShell* shell = presContext->PresShell();
|
||||
mozilla::PresShell* presShell = presContext->PresShell();
|
||||
|
||||
RefPtr<ComputedStyle> colGroupStyle;
|
||||
colGroupStyle = shell->StyleSet()->ResolveNonInheritingAnonymousBoxStyle(
|
||||
colGroupStyle = presShell->StyleSet()->ResolveNonInheritingAnonymousBoxStyle(
|
||||
PseudoStyleType::tableColGroup);
|
||||
// Create a col group frame
|
||||
nsTableColGroupFrame* newFrame =
|
||||
NS_NewTableColGroupFrame(shell, colGroupStyle);
|
||||
NS_NewTableColGroupFrame(presShell, colGroupStyle);
|
||||
newFrame->SetIsSynthetic();
|
||||
newFrame->Init(colGroupContent, this, nullptr);
|
||||
return newFrame;
|
||||
|
@ -2,17 +2,19 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTableRowGroupFrame.h"
|
||||
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTableRowFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
|
@ -14,9 +14,9 @@
|
||||
#ifndef nsBoxLayoutState_h___
|
||||
#define nsBoxLayoutState_h___
|
||||
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
class gfxContext;
|
||||
namespace mozilla {
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@ -194,15 +194,18 @@ void nsButtonBoxFrame::MouseClicked(WidgetGUIEvent* aEvent) {
|
||||
|
||||
// Have the content handle the event, propagating it according to normal DOM
|
||||
// rules.
|
||||
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
|
||||
if (!shell) return;
|
||||
RefPtr<mozilla::PresShell> presShell = PresContext()->GetPresShell();
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute the oncommand event handler.
|
||||
WidgetInputEvent* inputEvent = aEvent->AsInputEvent();
|
||||
WidgetMouseEventBase* mouseEvent = aEvent->AsMouseEventBase();
|
||||
nsContentUtils::DispatchXULCommand(
|
||||
mContent, aEvent->IsTrusted(), nullptr, shell, inputEvent->IsControl(),
|
||||
inputEvent->IsAlt(), inputEvent->IsShift(), inputEvent->IsMeta(),
|
||||
mContent, aEvent->IsTrusted(), nullptr, presShell,
|
||||
inputEvent->IsControl(), inputEvent->IsAlt(), inputEvent->IsShift(),
|
||||
inputEvent->IsMeta(),
|
||||
mouseEvent ? mouseEvent->inputSource
|
||||
: MouseEvent_Binding::MOZ_SOURCE_UNKNOWN);
|
||||
}
|
||||
|
@ -13,13 +13,13 @@
|
||||
|
||||
#include "nsDeckFrame.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsBoxLayoutState.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsMenuBarFrame.h"
|
||||
#include "nsPopupSetFrame.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsRect.h"
|
||||
@ -51,6 +50,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/KeyboardEvent.h"
|
||||
@ -1620,7 +1620,7 @@ void nsMenuPopupFrame::GenerateFrames() {
|
||||
mGeneratedChildren = true;
|
||||
if (generateFrames) {
|
||||
MOZ_ASSERT(PrincipalChildList().IsEmpty());
|
||||
nsCOMPtr<nsIPresShell> presShell = PresContext()->PresShell();
|
||||
RefPtr<mozilla::PresShell> presShell = PresContext()->PresShell();
|
||||
presShell->FrameConstructor()->GenerateChildFrames(this);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsBoxLayoutState.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIPopupContainer.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsResizerFrame.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
@ -65,7 +66,7 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
(aEvent->mClass == eMouseEventClass &&
|
||||
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
|
||||
nsCOMPtr<nsIBaseWindow> window;
|
||||
nsIPresShell* presShell = aPresContext->GetPresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
nsIContent* contentToResize =
|
||||
GetContentToResize(presShell, getter_AddRefs(window));
|
||||
if (contentToResize) {
|
||||
@ -134,7 +135,7 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
case eMouseMove: {
|
||||
if (mTrackingMouseMove) {
|
||||
nsCOMPtr<nsIBaseWindow> window;
|
||||
nsIPresShell* presShell = aPresContext->GetPresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
nsCOMPtr<nsIContent> contentToResize =
|
||||
GetContentToResize(presShell, getter_AddRefs(window));
|
||||
|
||||
@ -292,7 +293,7 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
case eMouseDoubleClick:
|
||||
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
|
||||
nsCOMPtr<nsIBaseWindow> window;
|
||||
nsIPresShell* presShell = aPresContext->GetPresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->GetPresShell();
|
||||
nsIContent* contentToResize =
|
||||
GetContentToResize(presShell, getter_AddRefs(window));
|
||||
if (contentToResize) {
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsScrollbarButtonFrame.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsFrameList.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
@ -35,6 +34,7 @@
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/MouseEvent.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsBindingManager.h"
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/MouseEventBinding.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@ -122,7 +123,7 @@ nsresult nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
aPresContext->CSSToDevPixelScale();
|
||||
menuPopupFrame->MoveTo(RoundedToInt(cssPos), false);
|
||||
} else {
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
mozilla::PresShell* presShell = aPresContext->PresShell();
|
||||
nsPIDOMWindowOuter* window = presShell->GetDocument()->GetWindow();
|
||||
if (window) {
|
||||
window->MoveBy(nsMoveBy.x, nsMoveBy.y);
|
||||
|
@ -1293,7 +1293,7 @@ void nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup,
|
||||
if (!popupFrame) return;
|
||||
|
||||
nsPresContext* presContext = popupFrame->PresContext();
|
||||
nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
presShell->FrameNeedsReflow(popupFrame, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
|
||||
@ -1393,7 +1393,7 @@ void nsXULPopupManager::FirePopupHidingEvent(
|
||||
nsIContent* aPopup, nsIContent* aNextPopup, nsIContent* aLastPopup,
|
||||
nsPresContext* aPresContext, nsPopupType aPopupType, bool aDeselectMenu,
|
||||
bool aIsCancel) {
|
||||
nsCOMPtr<nsIPresShell> presShell = aPresContext->PresShell();
|
||||
RefPtr<PresShell> presShell = aPresContext->PresShell();
|
||||
mozilla::Unused << presShell; // This presShell may be keeping things alive
|
||||
// on non GTK platforms
|
||||
|
||||
@ -2662,17 +2662,17 @@ nsXULMenuCommandEvent::Run() {
|
||||
}
|
||||
|
||||
nsPresContext* presContext = menuFrame->PresContext();
|
||||
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
|
||||
RefPtr<nsViewManager> kungFuDeathGrip = shell->GetViewManager();
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
RefPtr<nsViewManager> kungFuDeathGrip = presShell->GetViewManager();
|
||||
mozilla::Unused
|
||||
<< kungFuDeathGrip; // Not referred to directly within this function
|
||||
|
||||
// Deselect ourselves.
|
||||
if (mCloseMenuMode != CloseMenuMode_None) menuFrame->SelectMenu(false);
|
||||
|
||||
AutoHandlingUserInputStatePusher userInpStatePusher(mUserInput, nullptr,
|
||||
shell->GetDocument());
|
||||
nsContentUtils::DispatchXULCommand(mMenu, mIsTrusted, nullptr, shell,
|
||||
AutoHandlingUserInputStatePusher userInpStatePusher(
|
||||
mUserInput, nullptr, presShell->GetDocument());
|
||||
nsContentUtils::DispatchXULCommand(mMenu, mIsTrusted, nullptr, presShell,
|
||||
mControl, mAlt, mShift, mMeta);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/TextEditRules.h"
|
||||
|
||||
@ -723,7 +724,7 @@ void nsTreeBodyFrame::CheckOverflow(const ScrollParts& aParts) {
|
||||
AutoWeakFrame weakFrame(this);
|
||||
|
||||
RefPtr<nsPresContext> presContext = PresContext();
|
||||
nsCOMPtr<nsIPresShell> presShell = presContext->GetPresShell();
|
||||
RefPtr<mozilla::PresShell> presShell = presContext->GetPresShell();
|
||||
nsCOMPtr<nsIContent> content = mContent;
|
||||
|
||||
if (verticalOverflowChanged) {
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "js/JSON.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
|
@ -18,12 +18,12 @@
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -147,7 +147,7 @@ class ThumbnailHelper final
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
|
||||
RefPtr<PresShell> presShell = presContext->PresShell();
|
||||
RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt);
|
||||
MOZ_ASSERT(context); // checked the draw target above
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsNumberControlFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsString.h"
|
||||
@ -28,6 +27,7 @@
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/HTMLProgressElement.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include <algorithm>
|
||||
|
Loading…
Reference in New Issue
Block a user