зеркало из https://github.com/mozilla/gecko-dev.git
Bug 253889 - part 4: Finally, get rid of nsIPresShell r=emilio
And also this cleans up some legacy comments of PresShell users. Differential Revision: https://phabricator.services.mozilla.com/D29313 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8a9d031686
Коммит
c842b7b133
|
@ -185,7 +185,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
|
|||
case eBasicEventClass:
|
||||
// For these following events only allow popups if they're
|
||||
// triggered while handling user input. See
|
||||
// nsPresShell::HandleEventInternal() for details.
|
||||
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
|
||||
if (EventStateManager::IsHandlingUserInput()) {
|
||||
abuse = PopupBlocker::openBlocked;
|
||||
switch (aEvent->mMessage) {
|
||||
|
@ -207,7 +207,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
|
|||
case eEditorInputEventClass:
|
||||
// For this following event only allow popups if it's triggered
|
||||
// while handling user input. See
|
||||
// nsPresShell::HandleEventInternal() for details.
|
||||
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
|
||||
if (EventStateManager::IsHandlingUserInput()) {
|
||||
abuse = PopupBlocker::openBlocked;
|
||||
switch (aEvent->mMessage) {
|
||||
|
@ -224,7 +224,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
|
|||
case eInputEventClass:
|
||||
// For this following event only allow popups if it's triggered
|
||||
// while handling user input. See
|
||||
// nsPresShell::HandleEventInternal() for details.
|
||||
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
|
||||
if (EventStateManager::IsHandlingUserInput()) {
|
||||
abuse = PopupBlocker::openBlocked;
|
||||
switch (aEvent->mMessage) {
|
||||
|
@ -370,7 +370,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
|
|||
case eFormEventClass:
|
||||
// For these following events only allow popups if they're
|
||||
// triggered while handling user input. See
|
||||
// nsPresShell::HandleEventInternal() for details.
|
||||
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
|
||||
if (EventStateManager::IsHandlingUserInput()) {
|
||||
abuse = PopupBlocker::openBlocked;
|
||||
switch (aEvent->mMessage) {
|
||||
|
|
|
@ -1140,7 +1140,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
|
|||
// All accesses to this field should be guarded by a check of mIsChrome.
|
||||
struct ChromeFields {
|
||||
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
|
||||
// A weak pointer to the nsPresShell that we are doing fullscreen for.
|
||||
// A weak pointer to the PresShell that we are doing fullscreen for.
|
||||
// The pointer being set indicates we've set the IsInFullscreenChange
|
||||
// flag on this pres shell.
|
||||
nsWeakPtr mFullscreenPresShell;
|
||||
|
|
|
@ -303,7 +303,7 @@ class EventChainPostVisitor : public mozilla::EventChainVisitor {
|
|||
* If an EventDispatchingCallback object is passed to Dispatch,
|
||||
* its HandleEvent method is called after handling the default event group,
|
||||
* before handling the system event group.
|
||||
* This is used in nsPresShell.
|
||||
* This is used in PresShell.
|
||||
*/
|
||||
class MOZ_STACK_CLASS EventDispatchingCallback {
|
||||
public:
|
||||
|
|
|
@ -430,13 +430,13 @@ struct nsCallbackEventRequest {
|
|||
# define ASSERT_REFLOW_SCHEDULED_STATE() \
|
||||
{ \
|
||||
if (ObservingLayoutFlushes()) { \
|
||||
MOZ_ASSERT(mDocument->GetBFCacheEntry() || \
|
||||
mPresContext->RefreshDriver()->IsLayoutFlushObserver( \
|
||||
static_cast<PresShell*>(this)), \
|
||||
MOZ_ASSERT( \
|
||||
mDocument->GetBFCacheEntry() || \
|
||||
mPresContext->RefreshDriver()->IsLayoutFlushObserver(this), \
|
||||
"Unexpected state"); \
|
||||
} else { \
|
||||
MOZ_ASSERT(!mPresContext->RefreshDriver()->IsLayoutFlushObserver( \
|
||||
static_cast<PresShell*>(this)), \
|
||||
MOZ_ASSERT( \
|
||||
!mPresContext->RefreshDriver()->IsLayoutFlushObserver(this), \
|
||||
"Unexpected state"); \
|
||||
} \
|
||||
}
|
||||
|
@ -858,7 +858,6 @@ NS_INTERFACE_TABLE_HEAD(PresShell)
|
|||
// QI for weak reference. Therefore, the case needed by do_QueryReferent()
|
||||
// should be tested first.
|
||||
NS_INTERFACE_TABLE_ENTRY(PresShell, PresShell)
|
||||
NS_INTERFACE_TABLE_ENTRY(PresShell, nsIPresShell)
|
||||
NS_INTERFACE_TABLE_ENTRY(PresShell, nsIDocumentObserver)
|
||||
NS_INTERFACE_TABLE_ENTRY(PresShell, nsISelectionController)
|
||||
NS_INTERFACE_TABLE_ENTRY(PresShell, nsISelectionDisplay)
|
||||
|
@ -1369,26 +1368,26 @@ void PresShell::Destroy() {
|
|||
void PresShell::StopObservingRefreshDriver() {
|
||||
nsRefreshDriver* rd = mPresContext->RefreshDriver();
|
||||
if (mResizeEventPending) {
|
||||
rd->RemoveResizeEventFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->RemoveResizeEventFlushObserver(this);
|
||||
}
|
||||
if (mObservingLayoutFlushes) {
|
||||
rd->RemoveLayoutFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->RemoveLayoutFlushObserver(this);
|
||||
}
|
||||
if (mObservingStyleFlushes) {
|
||||
rd->RemoveStyleFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->RemoveStyleFlushObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
void PresShell::StartObservingRefreshDriver() {
|
||||
nsRefreshDriver* rd = mPresContext->RefreshDriver();
|
||||
if (mResizeEventPending) {
|
||||
rd->AddResizeEventFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->AddResizeEventFlushObserver(this);
|
||||
}
|
||||
if (mObservingLayoutFlushes) {
|
||||
rd->AddLayoutFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->AddLayoutFlushObserver(this);
|
||||
}
|
||||
if (mObservingStyleFlushes) {
|
||||
rd->AddStyleFlushObserver(static_cast<PresShell*>(this));
|
||||
rd->AddStyleFlushObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2806,8 +2805,7 @@ void PresShell::CancelAllPendingReflows() {
|
|||
mDirtyRoots.Clear();
|
||||
|
||||
if (mObservingLayoutFlushes) {
|
||||
GetPresContext()->RefreshDriver()->RemoveLayoutFlushObserver(
|
||||
static_cast<PresShell*>(this));
|
||||
GetPresContext()->RefreshDriver()->RemoveLayoutFlushObserver(this);
|
||||
mObservingLayoutFlushes = false;
|
||||
}
|
||||
|
||||
|
@ -2955,7 +2953,7 @@ void PresShell::ClearFrameRefs(nsIFrame* aFrame) {
|
|||
AutoWeakFrame* prev = weakFrame->GetPreviousWeakFrame();
|
||||
if (weakFrame->GetFrame() == aFrame) {
|
||||
// This removes weakFrame from mAutoWeakFrames.
|
||||
weakFrame->Clear(static_cast<PresShell*>(this));
|
||||
weakFrame->Clear(this);
|
||||
}
|
||||
weakFrame = prev;
|
||||
}
|
||||
|
@ -2968,7 +2966,7 @@ void PresShell::ClearFrameRefs(nsIFrame* aFrame) {
|
|||
}
|
||||
}
|
||||
for (WeakFrame* weakFrame : toRemove) {
|
||||
weakFrame->Clear(static_cast<PresShell*>(this));
|
||||
weakFrame->Clear(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4378,7 +4376,7 @@ void PresShell::ContentRemoved(nsIContent* aChild,
|
|||
}
|
||||
|
||||
void PresShell::NotifyCounterStylesAreDirty() {
|
||||
nsAutoCauseReflowNotifier reflowNotifier(static_cast<PresShell*>(this));
|
||||
nsAutoCauseReflowNotifier reflowNotifier(this);
|
||||
mFrameConstructor->NotifyCounterStylesAreDirty();
|
||||
}
|
||||
|
||||
|
@ -9252,8 +9250,8 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible,
|
|||
if (tp) {
|
||||
if (tp->current.numChars > 100) {
|
||||
TimeDuration reflowTime = TimeStamp::Now() - timeStart;
|
||||
LogTextPerfStats(tp, static_cast<PresShell*>(this), tp->current,
|
||||
reflowTime.ToMilliseconds(), eLog_reflow, nullptr);
|
||||
LogTextPerfStats(tp, this, tp->current, reflowTime.ToMilliseconds(),
|
||||
eLog_reflow, nullptr);
|
||||
}
|
||||
tp->Accumulate();
|
||||
}
|
||||
|
@ -9483,8 +9481,7 @@ void PresShell::DoObserveStyleFlushes() {
|
|||
mObservingStyleFlushes = true;
|
||||
|
||||
if (MOZ_LIKELY(!mDocument->GetBFCacheEntry())) {
|
||||
mPresContext->RefreshDriver()->AddStyleFlushObserver(
|
||||
static_cast<PresShell*>(this));
|
||||
mPresContext->RefreshDriver()->AddStyleFlushObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9493,8 +9490,7 @@ void PresShell::DoObserveLayoutFlushes() {
|
|||
mObservingLayoutFlushes = true;
|
||||
|
||||
if (MOZ_LIKELY(!mDocument->GetBFCacheEntry())) {
|
||||
mPresContext->RefreshDriver()->AddLayoutFlushObserver(
|
||||
static_cast<PresShell*>(this));
|
||||
mPresContext->RefreshDriver()->AddLayoutFlushObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9814,7 +9810,7 @@ bool PresShell::VerifyIncrementalReflow() {
|
|||
// reflowing the test frame tree
|
||||
vm->SetPresShell(presShell);
|
||||
{
|
||||
nsAutoCauseReflowNotifier crNotifier(static_cast<PresShell*>(this));
|
||||
nsAutoCauseReflowNotifier crNotifier(this);
|
||||
presShell->Initialize();
|
||||
}
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
@ -10708,8 +10704,7 @@ bool PresShell::DetermineFontSizeInflationState() {
|
|||
|
||||
// Force-enabling font inflation always trumps the heuristics here.
|
||||
if (!FontSizeInflationForceEnabled()) {
|
||||
if (BrowserChild* tab =
|
||||
BrowserChild::GetFrom(static_cast<PresShell*>(this))) {
|
||||
if (BrowserChild* tab = BrowserChild::GetFrom(this)) {
|
||||
// We're in a child process. Cancel inflation if we're not
|
||||
// async-pan zoomed.
|
||||
if (!tab->AsyncPanZoomEnabled()) {
|
||||
|
|
|
@ -10,49 +10,134 @@
|
|||
#define mozilla_PresShell_h
|
||||
|
||||
#include "mozilla/PresShellForwards.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#include <stdio.h> // for FILE definition
|
||||
#include "FrameMetrics.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "TouchManager.h"
|
||||
#include "Units.h"
|
||||
#include "ZoomConstraintsClient.h"
|
||||
#include "gfxPoint.h"
|
||||
#include "mozilla/ArenaObjectID.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/dom/HTMLDocumentBinding.h"
|
||||
#include "mozilla/layers/FocusTarget.h"
|
||||
#include "mozilla/FlushType.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/ScrollTypes.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/ServoStyleConsts.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsContentUtils.h" // For AddScriptBlocker().
|
||||
#include "nsCRT.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "mozilla/dom/HTMLDocumentBinding.h"
|
||||
#include "mozilla/layers/FocusTarget.h"
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsFrameState.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsQueryFrame.h"
|
||||
#include "nsMargin.h"
|
||||
#include "nsPresArena.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
#include "nsRegionFwd.h"
|
||||
#include "nsStringFwd.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "TouchManager.h"
|
||||
#include "ZoomConstraintsClient.h"
|
||||
|
||||
class nsIDocShell;
|
||||
class nsRange;
|
||||
|
||||
struct RangePaintInfo;
|
||||
|
||||
class nsPresShellEventCB;
|
||||
class AutoPointerEventTargetUpdater;
|
||||
class AutoWeakFrame;
|
||||
class gfxContext;
|
||||
class MobileViewportManager;
|
||||
#ifdef ACCESSIBILITY
|
||||
class nsAccessibilityService;
|
||||
#endif
|
||||
class nsARefreshObserver;
|
||||
class nsAutoCauseReflowNotifier;
|
||||
class nsCanvasFrame;
|
||||
class nsCaret;
|
||||
class nsCSSFrameConstructor;
|
||||
class nsDisplayList;
|
||||
class nsDisplayListBuilder;
|
||||
class nsDocShell;
|
||||
class nsFrameSelection;
|
||||
class nsIDocShell;
|
||||
class nsIFrame;
|
||||
class nsILayoutHistoryState;
|
||||
class nsINode;
|
||||
class nsIPageSequenceFrame;
|
||||
class nsIReflowCallback;
|
||||
class nsIScrollableFrame;
|
||||
class nsITimer;
|
||||
class nsPIDOMWindowOuter;
|
||||
class nsAPostRefreshObserver;
|
||||
class nsPresShellEventCB;
|
||||
class nsRange;
|
||||
class nsRefreshDriver;
|
||||
class nsRegion;
|
||||
class nsView;
|
||||
class nsViewManager;
|
||||
class nsWindowSizes;
|
||||
struct RangePaintInfo;
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
class ReflowCountMgr;
|
||||
#endif
|
||||
class WeakFrame;
|
||||
|
||||
template <class E>
|
||||
class nsCOMArray;
|
||||
|
||||
struct nsCallbackEventRequest;
|
||||
struct nsPoint;
|
||||
struct nsRect;
|
||||
|
||||
namespace mozilla {
|
||||
class AccessibleCaretEventHub;
|
||||
class EventStates;
|
||||
class GeckoMVMContext;
|
||||
class OverflowChangedTracker;
|
||||
class StyleSheet;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
namespace a11y {
|
||||
class DocAccessible;
|
||||
} // namespace a11y
|
||||
#endif
|
||||
|
||||
namespace dom {
|
||||
class Document;
|
||||
class Element;
|
||||
class Event;
|
||||
class HTMLSlotElement;
|
||||
class Selection;
|
||||
} // namespace dom
|
||||
|
||||
class EventDispatchingCallback;
|
||||
class GeckoMVMContext;
|
||||
class OverflowChangedTracker;
|
||||
namespace gfx {
|
||||
class SourceSurface;
|
||||
} // namespace gfx
|
||||
|
||||
namespace layers {
|
||||
class LayerManager;
|
||||
} // namespace layers
|
||||
|
||||
namespace layout {
|
||||
class ScrollAnchorContainer;
|
||||
} // namespace layout
|
||||
|
||||
// 039d8ffc-fa55-42d7-a53a-388cb129b052
|
||||
#define NS_PRESSHELL_IID \
|
||||
|
@ -62,7 +147,19 @@ class OverflowChangedTracker;
|
|||
} \
|
||||
}
|
||||
|
||||
class PresShell final : public nsIPresShell,
|
||||
#undef NOISY_INTERRUPTIBLE_REFLOW
|
||||
|
||||
/**
|
||||
* Presentation shell. Presentation shells are the controlling point for
|
||||
* managing the presentation of a document. The presentation shell holds a
|
||||
* live reference to the document, the presentation context, the style
|
||||
* manager, the style set and the root frame.
|
||||
*
|
||||
* When this object is Release'd, it will release the document, the
|
||||
* presentation context, the style manager, the style set and the root frame.
|
||||
*/
|
||||
|
||||
class PresShell final : public nsStubDocumentObserver,
|
||||
public nsISelectionController,
|
||||
public nsIObserver,
|
||||
public nsSupportsWeakReference {
|
||||
|
@ -742,9 +839,10 @@ class PresShell final : public nsIPresShell,
|
|||
* edge of the presshell area. The aPoint, aScreenRect and aFlags arguments
|
||||
* function in a similar manner as RenderSelection.
|
||||
*/
|
||||
already_AddRefed<gfx::SourceSurface> RenderNode(
|
||||
nsINode* aNode, const Maybe<CSSIntRegion>& aRegion,
|
||||
const LayoutDeviceIntPoint aPoint, LayoutDeviceIntRect* aScreenRect,
|
||||
already_AddRefed<SourceSurface> RenderNode(nsINode* aNode,
|
||||
const Maybe<CSSIntRegion>& aRegion,
|
||||
const LayoutDeviceIntPoint aPoint,
|
||||
LayoutDeviceIntRect* aScreenRect,
|
||||
RenderImageFlags aFlags);
|
||||
|
||||
/**
|
||||
|
@ -763,7 +861,7 @@ class PresShell final : public nsIPresShell,
|
|||
* point isn't used because the position can be determined from the displayed
|
||||
* frames.
|
||||
*/
|
||||
already_AddRefed<gfx::SourceSurface> RenderSelection(
|
||||
already_AddRefed<SourceSurface> RenderSelection(
|
||||
dom::Selection* aSelection, const LayoutDeviceIntPoint aPoint,
|
||||
LayoutDeviceIntRect* aScreenRect, RenderImageFlags aFlags);
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include "mozilla/TypedEnumBits.h"
|
||||
|
||||
class nsIPresShell;
|
||||
|
||||
struct CapturingContentInfo;
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -52,7 +52,6 @@ EXPORTS += [
|
|||
'nsIFrameTraversal.h',
|
||||
'nsILayoutDebugger.h',
|
||||
'nsIPercentBSizeObserver.h',
|
||||
'nsIPresShell.h',
|
||||
'nsIReflowCallback.h',
|
||||
'nsLayoutUtils.h',
|
||||
'nsPresArena.h',
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
/* a presentation of a document, part 2 */
|
||||
|
||||
#ifndef nsIPresShell_h___
|
||||
#define nsIPresShell_h___
|
||||
|
||||
#include "mozilla/PresShellForwards.h"
|
||||
|
||||
#include "mozilla/ArenaObjectID.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/FlushType.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/ScrollTypes.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/ServoStyleConsts.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "FrameMetrics.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "gfxPoint.h"
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsQueryFrame.h"
|
||||
#include "nsStringFwd.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsRegionFwd.h"
|
||||
#include <stdio.h> // for FILE definition
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsPresArena.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
#include "nsMargin.h"
|
||||
#include "nsFrameState.h"
|
||||
#include "nsStubDocumentObserver.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "Units.h"
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
class ReflowCountMgr;
|
||||
#endif
|
||||
|
||||
class gfxContext;
|
||||
struct nsCallbackEventRequest;
|
||||
class nsDocShell;
|
||||
class nsIFrame;
|
||||
class nsPresContext;
|
||||
class nsWindowSizes;
|
||||
class nsViewManager;
|
||||
class nsView;
|
||||
class nsIPageSequenceFrame;
|
||||
class nsCanvasFrame;
|
||||
class nsCaret;
|
||||
namespace mozilla {
|
||||
class AccessibleCaretEventHub;
|
||||
class OverflowChangedTracker;
|
||||
class StyleSheet;
|
||||
} // namespace mozilla
|
||||
class nsFrameSelection;
|
||||
class nsFrameManager;
|
||||
class nsILayoutHistoryState;
|
||||
class nsIReflowCallback;
|
||||
class nsCSSFrameConstructor;
|
||||
template <class E>
|
||||
class nsCOMArray;
|
||||
class AutoWeakFrame;
|
||||
class MobileViewportManager;
|
||||
class WeakFrame;
|
||||
class nsIScrollableFrame;
|
||||
class nsDisplayList;
|
||||
class nsDisplayListBuilder;
|
||||
class nsPIDOMWindowOuter;
|
||||
struct nsPoint;
|
||||
class nsINode;
|
||||
struct nsRect;
|
||||
class nsRegion;
|
||||
class nsRefreshDriver;
|
||||
class nsAutoCauseReflowNotifier;
|
||||
class nsARefreshObserver;
|
||||
class nsAPostRefreshObserver;
|
||||
#ifdef ACCESSIBILITY
|
||||
class nsAccessibilityService;
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
class DocAccessible;
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
#endif
|
||||
class nsITimer;
|
||||
|
||||
namespace mozilla {
|
||||
class EventStates;
|
||||
|
||||
namespace dom {
|
||||
class Element;
|
||||
class Event;
|
||||
class Document;
|
||||
class HTMLSlotElement;
|
||||
class Touch;
|
||||
class Selection;
|
||||
class ShadowRoot;
|
||||
} // namespace dom
|
||||
|
||||
namespace layout {
|
||||
class ScrollAnchorContainer;
|
||||
} // namespace layout
|
||||
|
||||
namespace layers {
|
||||
class LayerManager;
|
||||
} // namespace layers
|
||||
|
||||
namespace gfx {
|
||||
class SourceSurface;
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
||||
// b7b89561-4f03-44b3-9afa-b47e7f313ffb
|
||||
#define NS_IPRESSHELL_IID \
|
||||
{ \
|
||||
0xb7b89561, 0x4f03, 0x44b3, { \
|
||||
0x9a, 0xfa, 0xb4, 0x7e, 0x7f, 0x31, 0x3f, 0xfb \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef NOISY_INTERRUPTIBLE_REFLOW
|
||||
|
||||
/**
|
||||
* Presentation shell interface. Presentation shells are the
|
||||
* controlling point for managing the presentation of a document. The
|
||||
* presentation shell holds a live reference to the document, the
|
||||
* presentation context, the style manager, the style set and the root
|
||||
* frame. <p>
|
||||
*
|
||||
* When this object is Release'd, it will release the document, the
|
||||
* presentation context, the style manager, the style set and the root
|
||||
* frame.
|
||||
*/
|
||||
|
||||
class nsIPresShell : public nsStubDocumentObserver {
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRESSHELL_IID)
|
||||
|
||||
nsIPresShell() = default;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPresShell, NS_IPRESSHELL_IID)
|
||||
|
||||
#endif /* nsIPresShell_h___ */
|
|
@ -2238,7 +2238,7 @@ nsPoint nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
|||
PresShell* presShell = aFrame->PresShell();
|
||||
|
||||
// XXX Bug 1224748 - Update nsLayoutUtils functions to correctly handle
|
||||
// nsPresShell resolution
|
||||
// PresShell resolution
|
||||
widgetToView =
|
||||
widgetToView.RemoveResolution(GetCurrentAPZResolutionScale(presShell));
|
||||
|
||||
|
|
|
@ -2545,8 +2545,8 @@ void nsRootPresContext::InitApplyPluginGeometryTimer() {
|
|||
}
|
||||
|
||||
// We'll apply the plugin geometry updates during the next compositing paint
|
||||
// in this presContext (either from nsPresShell::WillPaintWindow or from
|
||||
// nsPresShell::DidPaintWindow, depending on the platform). But paints might
|
||||
// in this presContext (either from PresShell::WillPaintWindow() or from
|
||||
// PresShell::DidPaintWindow(), depending on the platform). But paints might
|
||||
// get optimized away if the old plugin geometry covers the invalid region,
|
||||
// so set a backup timer to do this too. We want to make sure this
|
||||
// won't fire before our normal paint notifications, if those would
|
||||
|
|
|
@ -387,7 +387,7 @@ struct ReflowInput : public SizeComputationInput {
|
|||
// orthogonal limit; when it finds such a reflow input, it will use its
|
||||
// orthogonal-limit value to constrain inline-size.
|
||||
// This is initialized to NS_UNCONSTRAINEDSIZE (so it will be ignored),
|
||||
// but reset to a suitable value for the reflow root by nsPresShell.
|
||||
// but reset to a suitable value for the reflow root by PresShell.
|
||||
nscoord mOrthogonalLimit = NS_UNCONSTRAINEDSIZE;
|
||||
|
||||
// Accessors for the private fields below. Forcing all callers to use these
|
||||
|
|
|
@ -2761,8 +2761,8 @@ int16_t AutoCopyListener::sClipboardID = -1;
|
|||
* What we do now:
|
||||
* On every selection change, we copy to the clipboard anew, creating a
|
||||
* HTML buffer, a transferable, an nsISupportsString and
|
||||
* a huge mess every time. This is basically what nsPresShell::DoCopy does
|
||||
* to move the selection into the clipboard for Edit->Copy.
|
||||
* a huge mess every time. This is basically what nsCopySupport::HTMLCopy()
|
||||
* does to move the selection into the clipboard for Edit->Copy.
|
||||
*
|
||||
* What we should do, to make our end of the deal faster:
|
||||
* Create a singleton transferable with our own magic converter. When selection
|
||||
|
|
|
@ -2153,7 +2153,7 @@ class nsIFrame : public nsQueryFrame {
|
|||
/**
|
||||
* Mark any stored intrinsic width information as dirty (requiring
|
||||
* re-calculation). Note that this should generally not be called
|
||||
* directly; nsPresShell::FrameNeedsReflow will call it instead.
|
||||
* directly; PresShell::FrameNeedsReflow() will call it instead.
|
||||
*/
|
||||
virtual void MarkIntrinsicISizesDirty() = 0;
|
||||
|
||||
|
|
|
@ -2442,7 +2442,7 @@ ImgDrawResult nsCSSRendering::PaintStyleImageLayerWithSC(
|
|||
// a solid color item that gets added in nsLayoutUtils::PaintFrame,
|
||||
// or nsSubDocumentFrame::BuildDisplayList (bug 488242). (The solid
|
||||
// color may be moved into nsDisplayCanvasBackground by
|
||||
// nsPresShell::AddCanvasBackgroundColorItem, and painted by
|
||||
// PresShell::AddCanvasBackgroundColorItem(), and painted by
|
||||
// nsDisplayCanvasBackground directly.) Either way we don't need to
|
||||
// paint the background color here.
|
||||
bool isCanvasFrame = IsCanvasFrame(aParams.frame);
|
||||
|
|
|
@ -508,8 +508,7 @@ already_AddRefed<ComputedStyle> nsComputedDOMStyle::DoGetComputedStyleNoFlush(
|
|||
// set. Using the pres shell from the content also means that any
|
||||
// content that's actually *in* a document will get the style from the
|
||||
// correct document.
|
||||
PresShell* presShell =
|
||||
static_cast<PresShell*>(nsContentUtils::GetPresShellForContent(aElement));
|
||||
PresShell* presShell = nsContentUtils::GetPresShellForContent(aElement);
|
||||
bool inDocWithShell = true;
|
||||
if (!presShell) {
|
||||
inDocWithShell = false;
|
||||
|
|
|
@ -168,7 +168,7 @@ function run() {
|
|||
sheet.insertRule("@media (min-width: 150px) { div { display:flex } }", 0);
|
||||
flush_and_assert_change_counters("add non-matching media query",
|
||||
// FIXME: We restyle here because
|
||||
// nsIPresShell::RestyleForCSSRuleChanges posts a restyle, but it's
|
||||
// PresShell::NextRestyleIsForCSSRuleChanges() posts a restyle, but it's
|
||||
// probably avoidable if we wanted to avoid it.
|
||||
{ restyle: true, construct: false, reflow: false });
|
||||
|
||||
|
@ -199,7 +199,7 @@ function run() {
|
|||
sheet.deleteRule(0);
|
||||
flush_and_assert_change_counters("remove non-matching media query",
|
||||
// FIXME: We restyle here because
|
||||
// nsIPresShell::RestyleForCSSRuleChanges posts a restyle, but it's
|
||||
// PresShell::NextRestyleIsForCSSRuleChanges() posts a restyle, but it's
|
||||
// probably avoidable if we wanted to avoid it.
|
||||
{ restyle: true, construct: false, reflow: false });
|
||||
|
||||
|
|
|
@ -1800,8 +1800,7 @@ void nsBaseWidget::ZoomToRect(const uint32_t& aPresShellId,
|
|||
a11y::Accessible* nsBaseWidget::GetRootAccessible() {
|
||||
NS_ENSURE_TRUE(mWidgetListener, nullptr);
|
||||
|
||||
PresShell* presShell =
|
||||
static_cast<PresShell*>(mWidgetListener->GetPresShell());
|
||||
PresShell* presShell = mWidgetListener->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, nullptr);
|
||||
|
||||
// If container is null then the presshell is not active. This often happens
|
||||
|
|
Загрузка…
Ссылка в новой задаче