Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy to call without a previous context. This is a prerequisite to pass aDestroyContext to various things that right now just mint one, which can cause badness, see bug 1851787 and related bugs. It's also a bit nicer to add things there if we need to in the future. Differential Revision: https://phabricator.services.mozilla.com/D187578
This commit is contained in:
@@ -50,7 +50,8 @@ void nsFrameManager::Destroy() {
|
|||||||
mPresShell->SetIgnoreFrameDestruction(true);
|
mPresShell->SetIgnoreFrameDestruction(true);
|
||||||
|
|
||||||
if (mRootFrame) {
|
if (mRootFrame) {
|
||||||
mRootFrame->Destroy();
|
FrameDestroyContext context(mRootFrame);
|
||||||
|
mRootFrame->Destroy(context);
|
||||||
mRootFrame = nullptr;
|
mRootFrame = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,9 @@ NS_QUERYFRAME_HEAD(nsColorControlFrame)
|
|||||||
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
||||||
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLButtonControlFrame)
|
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLButtonControlFrame)
|
||||||
|
|
||||||
void nsColorControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsColorControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mColorContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mColorContent.forget());
|
nsHTMLButtonControlFrame::Destroy(aContext);
|
||||||
nsHTMLButtonControlFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ class nsColorControlFrame final : public nsHTMLButtonControlFrame,
|
|||||||
friend nsIFrame* NS_NewColorControlFrame(mozilla::PresShell* aPresShell,
|
friend nsIFrame* NS_NewColorControlFrame(mozilla::PresShell* aPresShell,
|
||||||
ComputedStyle* aStyle);
|
ComputedStyle* aStyle);
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS(nsColorControlFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsColorControlFrame)
|
||||||
|
|||||||
@@ -845,17 +845,16 @@ nsIFrame* nsComboboxControlFrame::CreateFrameForDisplayNode() {
|
|||||||
return mDisplayFrame;
|
return mDisplayFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsComboboxControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsComboboxControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// Revoke any pending RedisplayTextEvent
|
// Revoke any pending RedisplayTextEvent
|
||||||
mRedisplayTextEvent.Revoke();
|
mRedisplayTextEvent.Revoke();
|
||||||
|
|
||||||
mEventListener->Detach();
|
mEventListener->Detach();
|
||||||
|
|
||||||
// Cleanup frames in popup child list
|
// Cleanup frames in popup child list
|
||||||
aPostDestroyData.AddAnonymousContent(mDisplayContent.forget());
|
aContext.AddAnonymousContent(mDisplayContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mButtonContent.forget());
|
aContext.AddAnonymousContent(mButtonContent.forget());
|
||||||
nsBlockFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsBlockFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsFrameList& nsComboboxControlFrame::GetChildList(
|
const nsFrameList& nsComboboxControlFrame::GetChildList(
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ class nsComboboxControlFrame final : public nsBlockFrame,
|
|||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const final;
|
nsresult GetFrameName(nsAString& aResult) const final;
|
||||||
#endif
|
#endif
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) final;
|
||||||
PostDestroyData& aPostDestroyData) final;
|
|
||||||
void SetInitialChildList(ChildListID aListID, nsFrameList&& aChildList) final;
|
void SetInitialChildList(ChildListID aListID, nsFrameList&& aChildList) final;
|
||||||
const nsFrameList& GetChildList(ChildListID aListID) const final;
|
const nsFrameList& GetChildList(ChildListID aListID) const final;
|
||||||
void GetChildLists(nsTArray<ChildList>* aLists) const final;
|
void GetChildLists(nsTArray<ChildList>* aLists) const final;
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ void nsFileControlFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
mMouseListener = new DnDListener(this);
|
mMouseListener = new DnDListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsFileControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsFileControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
NS_ENSURE_TRUE_VOID(mContent);
|
NS_ENSURE_TRUE_VOID(mContent);
|
||||||
|
|
||||||
// Remove the events.
|
// Remove the events.
|
||||||
@@ -69,11 +68,11 @@ void nsFileControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
mContent->RemoveSystemEventListener(u"dragover"_ns, mMouseListener, false);
|
mContent->RemoveSystemEventListener(u"dragover"_ns, mMouseListener, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
aPostDestroyData.AddAnonymousContent(mTextContent.forget());
|
aContext.AddAnonymousContent(mTextContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mBrowseFilesOrDirs.forget());
|
aContext.AddAnonymousContent(mBrowseFilesOrDirs.forget());
|
||||||
|
|
||||||
mMouseListener->ForgetFrame();
|
mMouseListener->ForgetFrame();
|
||||||
nsBlockFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsBlockFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static already_AddRefed<Element> MakeAnonButton(
|
static already_AddRefed<Element> MakeAnonButton(
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ class nsFileControlFrame final : public nsBlockFrame,
|
|||||||
nsresult SetFormProperty(nsAtom* aName, const nsAString& aValue) override;
|
nsresult SetFormProperty(nsAtom* aName, const nsAString& aValue) override;
|
||||||
void SetFocus(bool aOn, bool aRepaint) override;
|
void SetFocus(bool aOn, bool aRepaint) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override;
|
nsresult GetFrameName(nsAString& aResult) const override;
|
||||||
|
|||||||
@@ -26,10 +26,9 @@ nsContainerFrame* NS_NewGfxButtonControlFrame(PresShell* aPresShell,
|
|||||||
|
|
||||||
NS_IMPL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(nsGfxButtonControlFrame)
|
||||||
|
|
||||||
void nsGfxButtonControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsGfxButtonControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mTextContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mTextContent.forget());
|
nsHTMLButtonControlFrame::Destroy(aContext);
|
||||||
nsHTMLButtonControlFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ class nsGfxButtonControlFrame final : public nsHTMLButtonControlFrame,
|
|||||||
explicit nsGfxButtonControlFrame(ComputedStyle* aStyle,
|
explicit nsGfxButtonControlFrame(ComputedStyle* aStyle,
|
||||||
nsPresContext* aPresContext);
|
nsPresContext* aPresContext);
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
||||||
mozilla::WidgetGUIEvent* aEvent,
|
mozilla::WidgetGUIEvent* aEvent,
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ Maybe<nscoord> nsListControlFrame::GetNaturalBaselineBOffset(
|
|||||||
return Nothing{};
|
return Nothing{};
|
||||||
}
|
}
|
||||||
// for Bug 47302 (remove this comment later)
|
// for Bug 47302 (remove this comment later)
|
||||||
void nsListControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsListControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// get the receiver interface from the browser button's content node
|
// get the receiver interface from the browser button's content node
|
||||||
NS_ENSURE_TRUE_VOID(mContent);
|
NS_ENSURE_TRUE_VOID(mContent);
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ void nsListControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
// event listener can outlive the frame.
|
// event listener can outlive the frame.
|
||||||
|
|
||||||
mEventListener->Detach();
|
mEventListener->Detach();
|
||||||
nsHTMLScrollFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsHTMLScrollFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ class nsListControlFrame final : public nsHTMLScrollFrame,
|
|||||||
|
|
||||||
void DidReflow(nsPresContext* aPresContext,
|
void DidReflow(nsPresContext* aPresContext,
|
||||||
const ReflowInput* aReflowInput) final;
|
const ReflowInput* aReflowInput) final;
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) final;
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) final;
|
const nsDisplayListSet& aLists) final;
|
||||||
|
|||||||
@@ -38,13 +38,12 @@ nsMeterFrame::nsMeterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
|
|||||||
|
|
||||||
nsMeterFrame::~nsMeterFrame() = default;
|
nsMeterFrame::~nsMeterFrame() = default;
|
||||||
|
|
||||||
void nsMeterFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsMeterFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
NS_ASSERTION(!GetPrevContinuation(),
|
NS_ASSERTION(!GetPrevContinuation(),
|
||||||
"nsMeterFrame should not have continuations; if it does we "
|
"nsMeterFrame should not have continuations; if it does we "
|
||||||
"need to call RegUnregAccessKey only for the first.");
|
"need to call RegUnregAccessKey only for the first.");
|
||||||
aPostDestroyData.AddAnonymousContent(mBarDiv.forget());
|
aContext.AddAnonymousContent(mBarDiv.forget());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsMeterFrame::CreateAnonymousContent(
|
nsresult nsMeterFrame::CreateAnonymousContent(
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ class nsMeterFrame final : public nsContainerFrame,
|
|||||||
explicit nsMeterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
explicit nsMeterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
||||||
virtual ~nsMeterFrame();
|
virtual ~nsMeterFrame();
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
virtual void Reflow(nsPresContext* aCX, ReflowOutput& aDesiredSize,
|
virtual void Reflow(nsPresContext* aCX, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
|
|||||||
@@ -41,10 +41,9 @@ nsNumberControlFrame::nsNumberControlFrame(ComputedStyle* aStyle,
|
|||||||
nsPresContext* aPresContext)
|
nsPresContext* aPresContext)
|
||||||
: nsTextControlFrame(aStyle, aPresContext, kClassID) {}
|
: nsTextControlFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
|
||||||
void nsNumberControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsNumberControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mSpinBox.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mSpinBox.forget());
|
nsTextControlFrame::Destroy(aContext);
|
||||||
nsTextControlFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsNumberControlFrame::CreateAnonymousContent(
|
nsresult nsNumberControlFrame::CreateAnonymousContent(
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class nsNumberControlFrame final : public nsTextControlFrame {
|
|||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS(nsNumberControlFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsNumberControlFrame)
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData&) override;
|
void Destroy(DestroyContext&) override;
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
mozilla::a11y::AccType AccessibleType() override;
|
mozilla::a11y::AccType AccessibleType() override;
|
||||||
|
|||||||
@@ -37,13 +37,12 @@ nsProgressFrame::nsProgressFrame(ComputedStyle* aStyle,
|
|||||||
|
|
||||||
nsProgressFrame::~nsProgressFrame() = default;
|
nsProgressFrame::~nsProgressFrame() = default;
|
||||||
|
|
||||||
void nsProgressFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsProgressFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
NS_ASSERTION(!GetPrevContinuation(),
|
NS_ASSERTION(!GetPrevContinuation(),
|
||||||
"nsProgressFrame should not have continuations; if it does we "
|
"nsProgressFrame should not have continuations; if it does we "
|
||||||
"need to call RegUnregAccessKey only for the first.");
|
"need to call RegUnregAccessKey only for the first.");
|
||||||
aPostDestroyData.AddAnonymousContent(mBarDiv.forget());
|
aContext.AddAnonymousContent(mBarDiv.forget());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsProgressFrame::CreateAnonymousContent(
|
nsresult nsProgressFrame::CreateAnonymousContent(
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ class nsProgressFrame final : public nsContainerFrame,
|
|||||||
explicit nsProgressFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
explicit nsProgressFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
||||||
virtual ~nsProgressFrame();
|
virtual ~nsProgressFrame();
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|||||||
@@ -69,8 +69,7 @@ NS_QUERYFRAME_HEAD(nsRangeFrame)
|
|||||||
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
|
||||||
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
||||||
|
|
||||||
void nsRangeFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsRangeFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
|
NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
|
||||||
"nsRangeFrame should not have continuations; if it does we "
|
"nsRangeFrame should not have continuations; if it does we "
|
||||||
"need to call RegUnregAccessKey only for the first.");
|
"need to call RegUnregAccessKey only for the first.");
|
||||||
@@ -78,10 +77,10 @@ void nsRangeFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
if (mListMutationObserver) {
|
if (mListMutationObserver) {
|
||||||
mListMutationObserver->Detach();
|
mListMutationObserver->Detach();
|
||||||
}
|
}
|
||||||
aPostDestroyData.AddAnonymousContent(mTrackDiv.forget());
|
aContext.AddAnonymousContent(mTrackDiv.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mProgressDiv.forget());
|
aContext.AddAnonymousContent(mProgressDiv.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mThumbDiv.forget());
|
aContext.AddAnonymousContent(mThumbDiv.forget());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsRangeFrame::MakeAnonymousDiv(Element** aResult,
|
nsresult nsRangeFrame::MakeAnonymousDiv(Element** aResult,
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ class nsRangeFrame final : public nsContainerFrame,
|
|||||||
NS_DECL_FRAMEARENA_HELPERS(nsRangeFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsRangeFrame)
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|||||||
@@ -39,10 +39,9 @@ nsSearchControlFrame::nsSearchControlFrame(ComputedStyle* aStyle,
|
|||||||
nsPresContext* aPresContext)
|
nsPresContext* aPresContext)
|
||||||
: nsTextControlFrame(aStyle, aPresContext, kClassID) {}
|
: nsTextControlFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
|
||||||
void nsSearchControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsSearchControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mClearButton.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mClearButton.forget());
|
nsTextControlFrame::Destroy(aContext);
|
||||||
nsTextControlFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsSearchControlFrame::CreateAnonymousContent(
|
nsresult nsSearchControlFrame::CreateAnonymousContent(
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ class nsSearchControlFrame final : public nsTextControlFrame {
|
|||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS(nsSearchControlFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsSearchControlFrame)
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
// nsIAnonymousContentCreator
|
// nsIAnonymousContentCreator
|
||||||
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
||||||
|
|||||||
@@ -126,8 +126,7 @@ nsIScrollableFrame* nsTextControlFrame::GetScrollTargetFrame() const {
|
|||||||
return do_QueryFrame(mRootNode->GetPrimaryFrame());
|
return do_QueryFrame(mRootNode->GetPrimaryFrame());
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTextControlFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
RemoveProperty(TextControlInitializer());
|
RemoveProperty(TextControlInitializer());
|
||||||
|
|
||||||
// Unbind the text editor state object from the frame. The editor will live
|
// Unbind the text editor state object from the frame. The editor will live
|
||||||
@@ -166,12 +165,12 @@ void nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
|
|
||||||
// If we're a subclass like nsNumberControlFrame, then it owns the root of the
|
// If we're a subclass like nsNumberControlFrame, then it owns the root of the
|
||||||
// anonymous subtree where mRootNode is.
|
// anonymous subtree where mRootNode is.
|
||||||
aPostDestroyData.AddAnonymousContent(mRootNode.forget());
|
aContext.AddAnonymousContent(mRootNode.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mPlaceholderDiv.forget());
|
aContext.AddAnonymousContent(mPlaceholderDiv.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mPreviewDiv.forget());
|
aContext.AddAnonymousContent(mPreviewDiv.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mRevealButton.forget());
|
aContext.AddAnonymousContent(mRevealButton.forget());
|
||||||
|
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSize nsTextControlFrame::CalcIntrinsicSize(
|
LogicalSize nsTextControlFrame::CalcIntrinsicSize(
|
||||||
|
|||||||
@@ -49,16 +49,14 @@ class nsTextControlFrame : public nsContainerFrame,
|
|||||||
virtual ~nsTextControlFrame();
|
virtual ~nsTextControlFrame();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DestroyFrom() causes preparing to destroy editor and that may cause
|
* Destroy() causes preparing to destroy editor and that may cause running
|
||||||
* running selection listeners of specllchecker selection and document
|
* selection listeners of spellchecker selection and document state listeners.
|
||||||
* state listeners. Not sure whether the former does something or not,
|
* Not sure whether the former does something or not, but nobody should run
|
||||||
* but nobody should run content script. The latter is currently only
|
* content script. The latter is currently only FinderHighlighter to clean up
|
||||||
* FinderHighlighter to clean up its fields at destruction. Thus, the
|
* its fields at destruction. Thus, the latter won't run content script too.
|
||||||
* latter won't run content script too. Therefore, this won't run
|
* Therefore, this won't run unsafe script.
|
||||||
* unsafe script.
|
|
||||||
*/
|
*/
|
||||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void DestroyFrom(nsIFrame* aDestructRoot,
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData&) override;
|
|
||||||
|
|
||||||
nsIScrollableFrame* GetScrollTargetFrame() const override;
|
nsIScrollableFrame* GetScrollTargetFrame() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -210,10 +210,9 @@ void MiddleCroppingBlockFrame::AppendAnonymousContentTo(
|
|||||||
aContent.AppendElement(mTextNode);
|
aContent.AppendElement(mTextNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MiddleCroppingBlockFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void MiddleCroppingBlockFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mTextNode.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mTextNode.forget());
|
nsBlockFrame::Destroy(aContext);
|
||||||
nsBlockFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ class MiddleCroppingBlockFrame : public nsBlockFrame,
|
|||||||
*/
|
*/
|
||||||
void UpdateDisplayedValue(const nsAString& aValue, bool aIsCropped,
|
void UpdateDisplayedValue(const nsAString& aValue, bool aIsCropped,
|
||||||
bool aNotify);
|
bool aNotify);
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
RefPtr<dom::Text> mTextNode;
|
RefPtr<dom::Text> mTextNode;
|
||||||
bool mCropped = false;
|
bool mCropped = false;
|
||||||
|
|||||||
@@ -396,10 +396,8 @@ bool nsAbsoluteContainingBlock::FrameDependsOnContainer(nsIFrame* f,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsAbsoluteContainingBlock::DestroyFrames(
|
void nsAbsoluteContainingBlock::DestroyFrames(DestroyContext& aContext) {
|
||||||
nsIFrame* aDelegatingFrame, nsIFrame* aDestructRoot,
|
mAbsoluteFrames.DestroyFrames(aContext);
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
mAbsoluteFrames.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty() {
|
void nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty() {
|
||||||
|
|||||||
@@ -95,9 +95,8 @@ class nsAbsoluteContainingBlock {
|
|||||||
const nsRect& aContainingBlock, AbsPosReflowFlags aFlags,
|
const nsRect& aContainingBlock, AbsPosReflowFlags aFlags,
|
||||||
mozilla::OverflowAreas* aOverflowAreas);
|
mozilla::OverflowAreas* aOverflowAreas);
|
||||||
|
|
||||||
using PostDestroyData = nsIFrame::PostDestroyData;
|
using DestroyContext = nsIFrame::DestroyContext;
|
||||||
void DestroyFrames(nsIFrame* aDelegatingFrame, nsIFrame* aDestructRoot,
|
void DestroyFrames(DestroyContext&);
|
||||||
PostDestroyData& aPostDestroyData);
|
|
||||||
|
|
||||||
bool HasAbsoluteFrames() const { return mAbsoluteFrames.NotEmpty(); }
|
bool HasAbsoluteFrames() const { return mAbsoluteFrames.NotEmpty(); }
|
||||||
|
|
||||||
|
|||||||
@@ -472,43 +472,39 @@ void nsBlockFrame::AddSizeOfExcludingThisForTree(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsBlockFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsBlockFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
ClearLineCursors();
|
ClearLineCursors();
|
||||||
DestroyAbsoluteFrames(aDestructRoot, aPostDestroyData);
|
DestroyAbsoluteFrames(aContext);
|
||||||
mFloats.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
mFloats.DestroyFrames(aContext);
|
||||||
nsPresContext* presContext = PresContext();
|
nsPresContext* presContext = PresContext();
|
||||||
mozilla::PresShell* presShell = presContext->PresShell();
|
mozilla::PresShell* presShell = presContext->PresShell();
|
||||||
nsLineBox::DeleteLineList(presContext, mLines, aDestructRoot, &mFrames,
|
nsLineBox::DeleteLineList(presContext, mLines, &mFrames, aContext);
|
||||||
aPostDestroyData);
|
|
||||||
|
|
||||||
if (HasPushedFloats()) {
|
if (HasPushedFloats()) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell, PushedFloatProperty());
|
||||||
PushedFloatProperty());
|
|
||||||
RemoveStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
|
RemoveStateBits(NS_BLOCK_HAS_PUSHED_FLOATS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// destroy overflow lines now
|
// destroy overflow lines now
|
||||||
FrameLines* overflowLines = RemoveOverflowLines();
|
FrameLines* overflowLines = RemoveOverflowLines();
|
||||||
if (overflowLines) {
|
if (overflowLines) {
|
||||||
nsLineBox::DeleteLineList(presContext, overflowLines->mLines, aDestructRoot,
|
nsLineBox::DeleteLineList(presContext, overflowLines->mLines,
|
||||||
&overflowLines->mFrames, aPostDestroyData);
|
&overflowLines->mFrames, aContext);
|
||||||
delete overflowLines;
|
delete overflowLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasAnyStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)) {
|
if (HasAnyStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell,
|
||||||
OverflowOutOfFlowsProperty());
|
OverflowOutOfFlowsProperty());
|
||||||
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasOutsideMarker()) {
|
if (HasOutsideMarker()) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell, OutsideMarkerProperty());
|
||||||
OutsideMarkerProperty());
|
|
||||||
RemoveStateBits(NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER);
|
RemoveStateBits(NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
@@ -5856,9 +5852,10 @@ void nsBlockFrame::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DestroyContext context(aOldFrame);
|
||||||
if (aListID == FrameChildListID::Principal) {
|
if (aListID == FrameChildListID::Principal) {
|
||||||
bool hasFloats = BlockHasAnyFloats(aOldFrame);
|
bool hasFloats = BlockHasAnyFloats(aOldFrame);
|
||||||
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
|
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS, context);
|
||||||
if (hasFloats) {
|
if (hasFloats) {
|
||||||
MarkSameFloatManagerLinesDirty(this);
|
MarkSameFloatManagerLinesDirty(this);
|
||||||
}
|
}
|
||||||
@@ -5874,10 +5871,10 @@ void nsBlockFrame::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
|
|||||||
MarkSameFloatManagerLinesDirty(
|
MarkSameFloatManagerLinesDirty(
|
||||||
static_cast<nsBlockFrame*>(f->GetParent()));
|
static_cast<nsBlockFrame*>(f->GetParent()));
|
||||||
}
|
}
|
||||||
DoRemoveOutOfFlowFrame(aOldFrame);
|
DoRemoveOutOfFlowFrame(aOldFrame, context);
|
||||||
} else if (FrameChildListID::NoReflowPrincipal == aListID) {
|
} else if (FrameChildListID::NoReflowPrincipal == aListID) {
|
||||||
// Skip the call to |FrameNeedsReflow| below by returning now.
|
// Skip the call to |FrameNeedsReflow| below by returning now.
|
||||||
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS);
|
DoRemoveFrame(aOldFrame, REMOVE_FIXED_CONTINUATIONS, context);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
MOZ_CRASH("unexpected child list");
|
MOZ_CRASH("unexpected child list");
|
||||||
@@ -6131,7 +6128,8 @@ void nsBlockFrame::RemoveFloat(nsIFrame* aFloat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame) {
|
void nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame,
|
||||||
|
DestroyContext& aContext) {
|
||||||
// The containing block is always the parent of aFrame.
|
// The containing block is always the parent of aFrame.
|
||||||
nsBlockFrame* block = (nsBlockFrame*)aFrame->GetParent();
|
nsBlockFrame* block = (nsBlockFrame*)aFrame->GetParent();
|
||||||
|
|
||||||
@@ -6149,7 +6147,7 @@ void nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame) {
|
|||||||
// Now remove aFrame from its child list and Destroy it.
|
// Now remove aFrame from its child list and Destroy it.
|
||||||
block->RemoveFloatFromFloatCache(aFrame);
|
block->RemoveFloatFromFloatCache(aFrame);
|
||||||
block->RemoveFloat(aFrame);
|
block->RemoveFloat(aFrame);
|
||||||
aFrame->Destroy();
|
aFrame->Destroy(aContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6431,9 +6429,8 @@ bool nsBlockInFlowLineIterator::FindValidLine() {
|
|||||||
// aDeletedFrame and remove aDeletedFrame from that line. But here we
|
// aDeletedFrame and remove aDeletedFrame from that line. But here we
|
||||||
// start by locating aDeletedFrame and then scanning from that point
|
// start by locating aDeletedFrame and then scanning from that point
|
||||||
// on looking for continuations.
|
// on looking for continuations.
|
||||||
void nsBlockFrame::DoRemoveFrameInternal(nsIFrame* aDeletedFrame,
|
void nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags,
|
||||||
uint32_t aFlags,
|
DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// Clear our line cursor, since our lines may change.
|
// Clear our line cursor, since our lines may change.
|
||||||
ClearLineCursors();
|
ClearLineCursors();
|
||||||
|
|
||||||
@@ -6442,8 +6439,9 @@ void nsBlockFrame::DoRemoveFrameInternal(nsIFrame* aDeletedFrame,
|
|||||||
if (!aDeletedFrame->GetPrevInFlow()) {
|
if (!aDeletedFrame->GetPrevInFlow()) {
|
||||||
NS_ASSERTION(aDeletedFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW),
|
NS_ASSERTION(aDeletedFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW),
|
||||||
"Expected out-of-flow frame");
|
"Expected out-of-flow frame");
|
||||||
DoRemoveOutOfFlowFrame(aDeletedFrame);
|
DoRemoveOutOfFlowFrame(aDeletedFrame, aContext);
|
||||||
} else {
|
} else {
|
||||||
|
// FIXME(emilio): aContext is lost here, maybe it's not a big deal?
|
||||||
nsContainerFrame::DeleteNextInFlowChild(aDeletedFrame,
|
nsContainerFrame::DeleteNextInFlowChild(aDeletedFrame,
|
||||||
(aFlags & FRAMES_ARE_EMPTY) != 0);
|
(aFlags & FRAMES_ARE_EMPTY) != 0);
|
||||||
}
|
}
|
||||||
@@ -6559,7 +6557,7 @@ void nsBlockFrame::DoRemoveFrameInternal(nsIFrame* aDeletedFrame,
|
|||||||
deletedNextContinuation = nullptr;
|
deletedNextContinuation = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
aDeletedFrame->DestroyFrom(aDeletedFrame, aPostDestroyData);
|
aDeletedFrame->Destroy(aContext);
|
||||||
aDeletedFrame = deletedNextContinuation;
|
aDeletedFrame = deletedNextContinuation;
|
||||||
|
|
||||||
bool haveAdvancedToNextLine = false;
|
bool haveAdvancedToNextLine = false;
|
||||||
@@ -6666,7 +6664,7 @@ void nsBlockFrame::DoRemoveFrameInternal(nsIFrame* aDeletedFrame,
|
|||||||
nsBlockFrame* nextBlock = do_QueryFrame(aDeletedFrame->GetParent());
|
nsBlockFrame* nextBlock = do_QueryFrame(aDeletedFrame->GetParent());
|
||||||
NS_ASSERTION(nextBlock, "Our child's continuation's parent is not a block?");
|
NS_ASSERTION(nextBlock, "Our child's continuation's parent is not a block?");
|
||||||
uint32_t flags = (aFlags & REMOVE_FIXED_CONTINUATIONS);
|
uint32_t flags = (aFlags & REMOVE_FIXED_CONTINUATIONS);
|
||||||
nextBlock->DoRemoveFrameInternal(aDeletedFrame, flags, aPostDestroyData);
|
nextBlock->DoRemoveFrame(aDeletedFrame, flags, aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool FindBlockLineFor(nsIFrame* aChild, nsLineList::iterator aBegin,
|
static bool FindBlockLineFor(nsIFrame* aChild, nsLineList::iterator aBegin,
|
||||||
@@ -6780,7 +6778,9 @@ void nsBlockFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
|||||||
nsLayoutUtils::AssertTreeOnlyEmptyNextInFlows(aNextInFlow);
|
nsLayoutUtils::AssertTreeOnlyEmptyNextInFlows(aNextInFlow);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
DoRemoveFrame(aNextInFlow, aDeletingEmptyFrames ? FRAMES_ARE_EMPTY : 0);
|
DestroyContext context(aNextInFlow);
|
||||||
|
DoRemoveFrame(aNextInFlow, aDeletingEmptyFrames ? FRAMES_ARE_EMPTY : 0,
|
||||||
|
context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ class nsBlockFrame : public nsContainerFrame {
|
|||||||
mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||||
BaselineExportContext aExportContext) const override;
|
BaselineExportContext aExportContext) const override;
|
||||||
nscoord GetCaretBaseline() const override;
|
nscoord GetCaretBaseline() const override;
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
bool IsFloatContainingBlock() const override;
|
bool IsFloatContainingBlock() const override;
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
@@ -551,19 +551,14 @@ class nsBlockFrame : public nsContainerFrame {
|
|||||||
* -- destroys all removed frames
|
* -- destroys all removed frames
|
||||||
*/
|
*/
|
||||||
enum { REMOVE_FIXED_CONTINUATIONS = 0x02, FRAMES_ARE_EMPTY = 0x04 };
|
enum { REMOVE_FIXED_CONTINUATIONS = 0x02, FRAMES_ARE_EMPTY = 0x04 };
|
||||||
void DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags) {
|
void DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags, DestroyContext&);
|
||||||
AutoPostDestroyData data(PresContext());
|
|
||||||
DoRemoveFrameInternal(aDeletedFrame, aFlags, data.mData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReparentFloats(nsIFrame* aFirstFrame, nsBlockFrame* aOldParent,
|
void ReparentFloats(nsIFrame* aFirstFrame, nsBlockFrame* aOldParent,
|
||||||
bool aReparentSiblings);
|
bool aReparentSiblings);
|
||||||
|
|
||||||
virtual bool ComputeCustomOverflow(
|
bool ComputeCustomOverflow(mozilla::OverflowAreas&) override;
|
||||||
mozilla::OverflowAreas& aOverflowAreas) override;
|
|
||||||
|
|
||||||
virtual void UnionChildOverflow(
|
void UnionChildOverflow(mozilla::OverflowAreas&) override;
|
||||||
mozilla::OverflowAreas& aOverflowAreas) override;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load all of aFrame's floats into the float manager iff aFrame is not a
|
* Load all of aFrame's floats into the float manager iff aFrame is not a
|
||||||
@@ -601,10 +596,6 @@ class nsBlockFrame : public nsContainerFrame {
|
|||||||
bool IsInLineClampContext() const;
|
bool IsInLineClampContext() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** @see DoRemoveFrame */
|
|
||||||
void DoRemoveFrameInternal(nsIFrame* aDeletedFrame, uint32_t aFlags,
|
|
||||||
PostDestroyData& data);
|
|
||||||
|
|
||||||
/** grab overflow lines from this block's prevInFlow, and make them
|
/** grab overflow lines from this block's prevInFlow, and make them
|
||||||
* part of this block's mLines list.
|
* part of this block's mLines list.
|
||||||
* @return true if any lines were drained.
|
* @return true if any lines were drained.
|
||||||
@@ -677,7 +668,7 @@ class nsBlockFrame : public nsContainerFrame {
|
|||||||
bool aCollectFromSiblings);
|
bool aCollectFromSiblings);
|
||||||
|
|
||||||
// Remove a float, abs, rel positioned frame from the appropriate block's list
|
// Remove a float, abs, rel positioned frame from the appropriate block's list
|
||||||
static void DoRemoveOutOfFlowFrame(nsIFrame* aFrame);
|
static void DoRemoveOutOfFlowFrame(nsIFrame* aFrame, DestroyContext&);
|
||||||
|
|
||||||
/** set up the conditions necessary for an resize reflow
|
/** set up the conditions necessary for an resize reflow
|
||||||
* the primary task is to mark the minimumly sufficient lines dirty.
|
* the primary task is to mark the minimumly sufficient lines dirty.
|
||||||
|
|||||||
@@ -203,19 +203,18 @@ void nsCanvasFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsCanvasFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsCanvasFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
nsIScrollableFrame* sf =
|
nsIScrollableFrame* sf =
|
||||||
PresContext()->GetPresShell()->GetRootScrollFrameAsScrollable();
|
PresContext()->GetPresShell()->GetRootScrollFrameAsScrollable();
|
||||||
if (sf) {
|
if (sf) {
|
||||||
sf->RemoveScrollPositionListener(this);
|
sf->RemoveScrollPositionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
aPostDestroyData.AddAnonymousContent(mCustomContentContainer.forget());
|
aContext.AddAnonymousContent(mCustomContentContainer.forget());
|
||||||
if (mTooltipContent) {
|
if (mTooltipContent) {
|
||||||
aPostDestroyData.AddAnonymousContent(mTooltipContent.forget());
|
aContext.AddAnonymousContent(mTooltipContent.forget());
|
||||||
}
|
}
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsCanvasFrame::ScrollPositionWillChange(nscoord aX, nscoord aY) {
|
void nsCanvasFrame::ScrollPositionWillChange(nscoord aX, nscoord aY) {
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ class nsCanvasFrame final : public nsContainerFrame,
|
|||||||
|
|
||||||
Element* GetDefaultTooltip() override;
|
Element* GetDefaultTooltip() override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void SetInitialChildList(ChildListID aListID,
|
void SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList&& aChildList) override;
|
nsFrameList&& aChildList) override;
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ void nsContainerFrame::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
|
|||||||
// We really MUST use StealFrame() and nothing else here.
|
// We really MUST use StealFrame() and nothing else here.
|
||||||
// @see nsInlineFrame::StealFrame for details.
|
// @see nsInlineFrame::StealFrame for details.
|
||||||
parent->StealFrame(continuation);
|
parent->StealFrame(continuation);
|
||||||
continuation->Destroy();
|
DestroyContext context(continuation);
|
||||||
|
continuation->Destroy(context);
|
||||||
if (generateReflowCommand && parent != lastParent) {
|
if (generateReflowCommand && parent != lastParent) {
|
||||||
presShell->FrameNeedsReflow(parent, IntrinsicDirty::FrameAndAncestors,
|
presShell->FrameNeedsReflow(parent, IntrinsicDirty::FrameAndAncestors,
|
||||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||||
@@ -192,25 +193,23 @@ void nsContainerFrame::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsContainerFrame::DestroyAbsoluteFrames(
|
void nsContainerFrame::DestroyAbsoluteFrames(DestroyContext& aContext) {
|
||||||
nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) {
|
|
||||||
if (IsAbsoluteContainer()) {
|
if (IsAbsoluteContainer()) {
|
||||||
GetAbsoluteContainingBlock()->DestroyFrames(this, aDestructRoot,
|
GetAbsoluteContainingBlock()->DestroyFrames(aContext);
|
||||||
aPostDestroyData);
|
|
||||||
MarkAsNotAbsoluteContainingBlock();
|
MarkAsNotAbsoluteContainingBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsContainerFrame::SafelyDestroyFrameListProp(
|
void nsContainerFrame::SafelyDestroyFrameListProp(
|
||||||
nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData,
|
DestroyContext& aContext, mozilla::PresShell* aPresShell,
|
||||||
mozilla::PresShell* aPresShell, FrameListPropertyDescriptor aProp) {
|
FrameListPropertyDescriptor aProp) {
|
||||||
// Note that the last frame can be removed through another route and thus
|
// Note that the last frame can be removed through another route and thus
|
||||||
// delete the property -- that's why we fetch the property again before
|
// delete the property -- that's why we fetch the property again before
|
||||||
// removing each frame rather than fetching it once and iterating the list.
|
// removing each frame rather than fetching it once and iterating the list.
|
||||||
while (nsFrameList* frameList = GetProperty(aProp)) {
|
while (nsFrameList* frameList = GetProperty(aProp)) {
|
||||||
nsIFrame* frame = frameList->RemoveFirstChild();
|
nsIFrame* frame = frameList->RemoveFirstChild();
|
||||||
if (MOZ_LIKELY(frame)) {
|
if (MOZ_LIKELY(frame)) {
|
||||||
frame->DestroyFrom(aDestructRoot, aPostDestroyData);
|
frame->Destroy(aContext);
|
||||||
} else {
|
} else {
|
||||||
Unused << TakeProperty(aProp);
|
Unused << TakeProperty(aProp);
|
||||||
frameList->Delete(aPresShell);
|
frameList->Delete(aPresShell);
|
||||||
@@ -219,17 +218,16 @@ void nsContainerFrame::SafelyDestroyFrameListProp(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsContainerFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// Prevent event dispatch during destruction.
|
// Prevent event dispatch during destruction.
|
||||||
if (HasView()) {
|
if (HasView()) {
|
||||||
GetView()->SetFrame(nullptr);
|
GetView()->SetFrame(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyAbsoluteFrames(aDestructRoot, aPostDestroyData);
|
DestroyAbsoluteFrames(aContext);
|
||||||
|
|
||||||
// Destroy frames on the principal child list.
|
// Destroy frames on the principal child list.
|
||||||
mFrames.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
mFrames.DestroyFrames(aContext);
|
||||||
|
|
||||||
// If we have any IB split siblings, clear their references to us.
|
// If we have any IB split siblings, clear their references to us.
|
||||||
if (HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT)) {
|
if (HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT)) {
|
||||||
@@ -275,19 +273,18 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
nsPresContext* pc = PresContext();
|
nsPresContext* pc = PresContext();
|
||||||
mozilla::PresShell* presShell = pc->PresShell();
|
mozilla::PresShell* presShell = pc->PresShell();
|
||||||
if (hasO) {
|
if (hasO) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell, OverflowProperty());
|
||||||
OverflowProperty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(
|
||||||
IsFrameOfType(eCanContainOverflowContainers) || !(hasOC || hasEOC),
|
IsFrameOfType(eCanContainOverflowContainers) || !(hasOC || hasEOC),
|
||||||
"this type of frame shouldn't have overflow containers");
|
"this type of frame shouldn't have overflow containers");
|
||||||
if (hasOC) {
|
if (hasOC) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell,
|
||||||
OverflowContainersProperty());
|
OverflowContainersProperty());
|
||||||
}
|
}
|
||||||
if (hasEOC) {
|
if (hasEOC) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell,
|
||||||
ExcessOverflowContainersProperty());
|
ExcessOverflowContainersProperty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,12 +292,11 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
StyleDisplay()->mTopLayer != StyleTopLayer::None,
|
StyleDisplay()->mTopLayer != StyleTopLayer::None,
|
||||||
"only top layer frame may have backdrop");
|
"only top layer frame may have backdrop");
|
||||||
if (hasBackdrop) {
|
if (hasBackdrop) {
|
||||||
SafelyDestroyFrameListProp(aDestructRoot, aPostDestroyData, presShell,
|
SafelyDestroyFrameListProp(aContext, presShell, BackdropProperty());
|
||||||
BackdropProperty());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsSplittableFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsSplittableFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -896,8 +892,7 @@ void nsContainerFrame::ReflowChild(
|
|||||||
// but only if the NoDeleteNextInFlowChild flag isn't set.
|
// but only if the NoDeleteNextInFlowChild flag isn't set.
|
||||||
if (!aStatus.IsInlineBreakBefore() && aStatus.IsFullyComplete() &&
|
if (!aStatus.IsInlineBreakBefore() && aStatus.IsFullyComplete() &&
|
||||||
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
||||||
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
if (nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow()) {
|
||||||
if (kidNextInFlow) {
|
|
||||||
// Remove all of the childs next-in-flows. Make sure that we ask
|
// Remove all of the childs next-in-flows. Make sure that we ask
|
||||||
// the right parent to do the removal (it's possible that the
|
// the right parent to do the removal (it's possible that the
|
||||||
// parent is not this because we are executing pullup code)
|
// parent is not this because we are executing pullup code)
|
||||||
@@ -936,8 +931,7 @@ void nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
// but only if the NoDeleteNextInFlowChild flag isn't set.
|
// but only if the NoDeleteNextInFlowChild flag isn't set.
|
||||||
if (aStatus.IsFullyComplete() &&
|
if (aStatus.IsFullyComplete() &&
|
||||||
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
!(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
|
||||||
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
if (nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow()) {
|
||||||
if (kidNextInFlow) {
|
|
||||||
// Remove all of the childs next-in-flows. Make sure that we ask
|
// Remove all of the childs next-in-flows. Make sure that we ask
|
||||||
// the right parent to do the removal (it's possible that the
|
// the right parent to do the removal (it's possible that the
|
||||||
// parent is not this because we are executing pullup code)
|
// parent is not this because we are executing pullup code)
|
||||||
@@ -1381,8 +1375,8 @@ void nsContainerFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
|||||||
frames.AppendElement(f);
|
frames.AppendElement(f);
|
||||||
}
|
}
|
||||||
for (nsIFrame* delFrame : Reversed(frames)) {
|
for (nsIFrame* delFrame : Reversed(frames)) {
|
||||||
delFrame->GetParent()->DeleteNextInFlowChild(delFrame,
|
nsContainerFrame* parent = delFrame->GetParent();
|
||||||
aDeletingEmptyFrames);
|
parent->DeleteNextInFlowChild(delFrame, aDeletingEmptyFrames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1397,7 +1391,8 @@ void nsContainerFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
|||||||
|
|
||||||
// Delete the next-in-flow frame and its descendants. This will also
|
// Delete the next-in-flow frame and its descendants. This will also
|
||||||
// remove it from its next-in-flow/prev-in-flow chain.
|
// remove it from its next-in-flow/prev-in-flow chain.
|
||||||
aNextInFlow->Destroy();
|
DestroyContext context(aNextInFlow);
|
||||||
|
aNextInFlow->Destroy(context);
|
||||||
|
|
||||||
MOZ_ASSERT(!prevInFlow->GetNextInFlow(), "non null next-in-flow");
|
MOZ_ASSERT(!prevInFlow->GetNextInFlow(), "non null next-in-flow");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,19 +46,19 @@ class nsContainerFrame : public nsSplittableFrame {
|
|||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
virtual nsContainerFrame* GetContentInsertionFrame() override { return this; }
|
nsContainerFrame* GetContentInsertionFrame() override { return this; }
|
||||||
|
|
||||||
virtual const nsFrameList& GetChildList(ChildListID aList) const override;
|
const nsFrameList& GetChildList(ChildListID aList) const override;
|
||||||
virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
|
void GetChildLists(nsTArray<ChildList>* aLists) const override;
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
virtual void ChildIsDirty(nsIFrame* aChild) override;
|
|
||||||
|
|
||||||
virtual FrameSearchResult PeekOffsetNoAmount(bool aForward,
|
void ChildIsDirty(nsIFrame* aChild) override;
|
||||||
int32_t* aOffset) override;
|
|
||||||
virtual FrameSearchResult PeekOffsetCharacter(
|
FrameSearchResult PeekOffsetNoAmount(bool aForward,
|
||||||
|
int32_t* aOffset) override;
|
||||||
|
FrameSearchResult PeekOffsetCharacter(
|
||||||
bool aForward, int32_t* aOffset,
|
bool aForward, int32_t* aOffset,
|
||||||
PeekOffsetCharacterOptions aOptions =
|
PeekOffsetCharacterOptions aOptions =
|
||||||
PeekOffsetCharacterOptions()) override;
|
PeekOffsetCharacterOptions()) override;
|
||||||
@@ -523,8 +523,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
|||||||
* Derived classes must do that too, if they destroy such frame lists.
|
* Derived classes must do that too, if they destroy such frame lists.
|
||||||
* See nsBlockFrame::DestroyFrom for an example.
|
* See nsBlockFrame::DestroyFrom for an example.
|
||||||
*/
|
*/
|
||||||
void DestroyAbsoluteFrames(nsIFrame* aDestructRoot,
|
void DestroyAbsoluteFrames(DestroyContext&);
|
||||||
PostDestroyData& aPostDestroyData);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for StealFrame. Returns true if aChild was removed from its list.
|
* Helper for StealFrame. Returns true if aChild was removed from its list.
|
||||||
@@ -852,8 +851,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
|||||||
* frame then remove the property and delete the frame list.
|
* frame then remove the property and delete the frame list.
|
||||||
* Nothing happens if the property doesn't exist.
|
* Nothing happens if the property doesn't exist.
|
||||||
*/
|
*/
|
||||||
void SafelyDestroyFrameListProp(nsIFrame* aDestructRoot,
|
void SafelyDestroyFrameListProp(DestroyContext&,
|
||||||
PostDestroyData& aPostDestroyData,
|
|
||||||
mozilla::PresShell* aPresShell,
|
mozilla::PresShell* aPresShell,
|
||||||
FrameListPropertyDescriptor aProp);
|
FrameListPropertyDescriptor aProp);
|
||||||
|
|
||||||
|
|||||||
@@ -37,17 +37,15 @@ void nsFrameList::Delete(mozilla::PresShell* aPresShell) {
|
|||||||
|
|
||||||
void nsFrameList::DestroyFrames() {
|
void nsFrameList::DestroyFrames() {
|
||||||
while (nsIFrame* frame = RemoveFirstChild()) {
|
while (nsIFrame* frame = RemoveFirstChild()) {
|
||||||
frame->Destroy();
|
FrameDestroyContext context(frame);
|
||||||
|
frame->Destroy(context);
|
||||||
}
|
}
|
||||||
mLastChild = nullptr;
|
mLastChild = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsFrameList::DestroyFramesFrom(nsIFrame* aDestructRoot,
|
void nsFrameList::DestroyFrames(FrameDestroyContext& aContext) {
|
||||||
PostFrameDestroyData& aPostDestroyData) {
|
|
||||||
MOZ_ASSERT(aDestructRoot, "Missing destruct root");
|
|
||||||
|
|
||||||
while (nsIFrame* frame = RemoveFirstChild()) {
|
while (nsIFrame* frame = RemoveFirstChild()) {
|
||||||
frame->DestroyFrom(aDestructRoot, aPostDestroyData);
|
frame->Destroy(aContext);
|
||||||
}
|
}
|
||||||
mLastChild = nullptr;
|
mLastChild = nullptr;
|
||||||
}
|
}
|
||||||
@@ -108,7 +106,8 @@ nsIFrame* nsFrameList::RemoveFirstChild() {
|
|||||||
void nsFrameList::DestroyFrame(nsIFrame* aFrame) {
|
void nsFrameList::DestroyFrame(nsIFrame* aFrame) {
|
||||||
MOZ_ASSERT(aFrame, "null ptr");
|
MOZ_ASSERT(aFrame, "null ptr");
|
||||||
RemoveFrame(aFrame);
|
RemoveFrame(aFrame);
|
||||||
aFrame->Destroy();
|
FrameDestroyContext context(aFrame);
|
||||||
|
aFrame->Destroy(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameList::Slice nsFrameList::InsertFrames(nsContainerFrame* aParent,
|
nsFrameList::Slice nsFrameList::InsertFrames(nsContainerFrame* aParent,
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ class nsIFrame;
|
|||||||
class nsPresContext;
|
class nsPresContext;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
struct FrameDestroyContext;
|
||||||
|
|
||||||
class PresShell;
|
class PresShell;
|
||||||
class FrameChildList;
|
class FrameChildList;
|
||||||
enum class FrameChildListID {
|
enum class FrameChildListID {
|
||||||
@@ -49,17 +52,6 @@ enum class FrameChildListID {
|
|||||||
NoReflowPrincipal,
|
NoReflowPrincipal,
|
||||||
};
|
};
|
||||||
|
|
||||||
// A helper class for nsIFrame::Destroy[From]. It's defined here because
|
|
||||||
// nsFrameList needs it and we can't use nsIFrame here.
|
|
||||||
struct PostFrameDestroyData {
|
|
||||||
PostFrameDestroyData(const PostFrameDestroyData&) = delete;
|
|
||||||
PostFrameDestroyData() = default;
|
|
||||||
|
|
||||||
AutoTArray<RefPtr<nsIContent>, 100> mAnonymousContent;
|
|
||||||
void AddAnonymousContent(already_AddRefed<nsIContent>&& aContent) {
|
|
||||||
mAnonymousContent.AppendElement(aContent);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
// Uncomment this to enable expensive frame-list integrity checking
|
// Uncomment this to enable expensive frame-list integrity checking
|
||||||
@@ -141,10 +133,9 @@ class nsFrameList {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For each frame in this list: remove it from the list then call
|
* For each frame in this list: remove it from the list then call
|
||||||
* DestroyFrom(aDestructRoot, aPostDestroyData) on it.
|
* Destroy() on it with the passed context as an argument.
|
||||||
*/
|
*/
|
||||||
void DestroyFramesFrom(nsIFrame* aDestructRoot,
|
void DestroyFrames(mozilla::FrameDestroyContext&);
|
||||||
mozilla::PostFrameDestroyData& aPostDestroyData);
|
|
||||||
|
|
||||||
void Clear() { mFirstChild = mLastChild = nullptr; }
|
void Clear() { mFirstChild = mLastChild = nullptr; }
|
||||||
|
|
||||||
|
|||||||
@@ -315,9 +315,8 @@ void nsHTMLScrollFrame::ScrollbarActivityStopped() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsHTMLScrollFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsHTMLScrollFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
DestroyAbsoluteFrames(aContext);
|
||||||
DestroyAbsoluteFrames(aDestructRoot, aPostDestroyData);
|
|
||||||
if (mIsRoot) {
|
if (mIsRoot) {
|
||||||
PresShell()->ResetVisualViewportOffset();
|
PresShell()->ResetVisualViewportOffset();
|
||||||
}
|
}
|
||||||
@@ -330,10 +329,10 @@ void nsHTMLScrollFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unbind the content created in CreateAnonymousContent later...
|
// Unbind the content created in CreateAnonymousContent later...
|
||||||
aPostDestroyData.AddAnonymousContent(mHScrollbarContent.forget());
|
aContext.AddAnonymousContent(mHScrollbarContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mVScrollbarContent.forget());
|
aContext.AddAnonymousContent(mVScrollbarContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mScrollCornerContent.forget());
|
aContext.AddAnonymousContent(mScrollCornerContent.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mResizerContent.forget());
|
aContext.AddAnonymousContent(mResizerContent.forget());
|
||||||
|
|
||||||
if (mPostedReflowCallback) {
|
if (mPostedReflowCallback) {
|
||||||
PresShell()->CancelReflowCallback(this);
|
PresShell()->CancelReflowCallback(this);
|
||||||
@@ -362,7 +361,7 @@ void nsHTMLScrollFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
if (mScrollEndEvent) {
|
if (mScrollEndEvent) {
|
||||||
mScrollEndEvent->Revoke();
|
mScrollEndEvent->Revoke();
|
||||||
}
|
}
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID,
|
void nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class nsHTMLScrollFrame : public nsContainerFrame,
|
|||||||
|
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) final;
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) final;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData&) override;
|
void Destroy(DestroyContext&) override;
|
||||||
|
|
||||||
nsIScrollableFrame* GetScrollTargetFrame() const final {
|
nsIScrollableFrame* GetScrollTargetFrame() const final {
|
||||||
return const_cast<nsHTMLScrollFrame*>(this);
|
return const_cast<nsHTMLScrollFrame*>(this);
|
||||||
|
|||||||
@@ -346,12 +346,11 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
|||||||
|
|
||||||
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
|
||||||
|
|
||||||
void nsHTMLCanvasFrame::DestroyFrom(nsIFrame* aDestroyRoot,
|
void nsHTMLCanvasFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (IsPrimaryFrame()) {
|
if (IsPrimaryFrame()) {
|
||||||
HTMLCanvasElement::FromNode(*mContent)->ResetPrintCallback();
|
HTMLCanvasElement::FromNode(*mContent)->ResetPrintCallback();
|
||||||
}
|
}
|
||||||
nsContainerFrame::DestroyFrom(aDestroyRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHTMLCanvasFrame::~nsHTMLCanvasFrame() = default;
|
nsHTMLCanvasFrame::~nsHTMLCanvasFrame() = default;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class nsHTMLCanvasFrame final : public nsContainerFrame {
|
|||||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame*, PostDestroyData&) override;
|
void Destroy(DestroyContext&) override;
|
||||||
|
|
||||||
bool UpdateWebRenderCanvasData(nsDisplayListBuilder* aBuilder,
|
bool UpdateWebRenderCanvasData(nsDisplayListBuilder* aBuilder,
|
||||||
WebRenderCanvasData* aCanvasData);
|
WebRenderCanvasData* aCanvasData);
|
||||||
|
|||||||
@@ -217,11 +217,10 @@ static void SetOrUpdateRectValuedProperty(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
FrameDestroyContext::~FrameDestroyContext() {
|
||||||
void nsIFrame::DestroyAnonymousContent(
|
auto* ps = mPresContext->PresShell();
|
||||||
nsPresContext* aPresContext, already_AddRefed<nsIContent>&& aContent) {
|
for (auto& content : mozilla::Reversed(mAnonymousContent)) {
|
||||||
if (nsCOMPtr<nsIContent> content = aContent) {
|
ps->NativeAnonymousContentRemoved(content);
|
||||||
aPresContext->PresShell()->NativeAnonymousContentRemoved(content);
|
|
||||||
content->UnbindFromTree();
|
content->UnbindFromTree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -764,13 +763,12 @@ void nsIFrame::InitPrimaryFrame() {
|
|||||||
HandleLastRememberedSize();
|
HandleLastRememberedSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsIFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsIFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||||
"destroy called on frame while scripts not blocked");
|
"destroy called on frame while scripts not blocked");
|
||||||
NS_ASSERTION(!GetNextSibling() && !GetPrevSibling(),
|
NS_ASSERTION(!GetNextSibling() && !GetPrevSibling(),
|
||||||
"Frames should be removed before destruction.");
|
"Frames should be removed before destruction.");
|
||||||
NS_ASSERTION(aDestructRoot, "Must specify destruct root");
|
NS_ASSERTION(aContext.DestructRoot(), "Must specify destruct root");
|
||||||
MOZ_ASSERT(!HasAbsolutelyPositionedChildren());
|
MOZ_ASSERT(!HasAbsolutelyPositionedChildren());
|
||||||
MOZ_ASSERT(!HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT),
|
MOZ_ASSERT(!HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT),
|
||||||
"NS_FRAME_PART_OF_IBSPLIT set on non-nsContainerFrame?");
|
"NS_FRAME_PART_OF_IBSPLIT set on non-nsContainerFrame?");
|
||||||
@@ -796,10 +794,10 @@ void nsIFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
if (HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
|
if (HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
|
||||||
nsPlaceholderFrame* placeholder = GetPlaceholderFrame();
|
nsPlaceholderFrame* placeholder = GetPlaceholderFrame();
|
||||||
NS_ASSERTION(
|
NS_ASSERTION(
|
||||||
!placeholder || (aDestructRoot != this),
|
!placeholder || aContext.DestructRoot() != this,
|
||||||
"Don't call Destroy() on OOFs, call Destroy() on the placeholder.");
|
"Don't call Destroy() on OOFs, call Destroy() on the placeholder.");
|
||||||
NS_ASSERTION(!placeholder || nsLayoutUtils::IsProperAncestorFrame(
|
NS_ASSERTION(!placeholder || nsLayoutUtils::IsProperAncestorFrame(
|
||||||
aDestructRoot, placeholder),
|
aContext.DestructRoot(), placeholder),
|
||||||
"Placeholder relationship should have been torn down already; "
|
"Placeholder relationship should have been torn down already; "
|
||||||
"this might mean we have a stray placeholder in the tree.");
|
"this might mean we have a stray placeholder in the tree.");
|
||||||
if (placeholder) {
|
if (placeholder) {
|
||||||
@@ -869,7 +867,7 @@ void nsIFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
// aPostDestroyData to unbind it after frame destruction is done.
|
// aPostDestroyData to unbind it after frame destruction is done.
|
||||||
if (HasAnyStateBits(NS_FRAME_GENERATED_CONTENT) &&
|
if (HasAnyStateBits(NS_FRAME_GENERATED_CONTENT) &&
|
||||||
mContent->IsRootOfNativeAnonymousSubtree()) {
|
mContent->IsRootOfNativeAnonymousSubtree()) {
|
||||||
aPostDestroyData.AddAnonymousContent(mContent.forget());
|
aContext.AddAnonymousContent(mContent.forget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -493,6 +493,37 @@ static void ReleaseValue(T* aPropertyValue) {
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
|
||||||
|
// A simple class to group stuff that we need to keep around when tearing down
|
||||||
|
// a frame tree.
|
||||||
|
//
|
||||||
|
// Native anonymous content created by the frames need to get unbound _after_
|
||||||
|
// the frame has been destroyed, see bug 1400618.
|
||||||
|
//
|
||||||
|
// We destroy the anonymous content bottom-up (so, in reverse order), because
|
||||||
|
// it's a bit simpler, though we generally don't have that much nested anonymous
|
||||||
|
// content (except for scrollbars).
|
||||||
|
struct MOZ_RAII FrameDestroyContext {
|
||||||
|
explicit FrameDestroyContext(nsIFrame* aRoot);
|
||||||
|
|
||||||
|
nsIFrame* DestructRoot() const { return mDestructRoot; }
|
||||||
|
void AddAnonymousContent(already_AddRefed<nsIContent>&& aContent) {
|
||||||
|
if (RefPtr<nsIContent> content = aContent) {
|
||||||
|
mAnonymousContent.AppendElement(std::move(content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
~FrameDestroyContext();
|
||||||
|
|
||||||
|
private:
|
||||||
|
nsIFrame* const mDestructRoot;
|
||||||
|
nsPresContext* const mPresContext;
|
||||||
|
AutoTArray<RefPtr<nsIContent>, 100> mAnonymousContent;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace mozilla
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A frame in the layout model. This interface is supported by all frame
|
* A frame in the layout model. This interface is supported by all frame
|
||||||
* objects.
|
* objects.
|
||||||
@@ -631,31 +662,7 @@ class nsIFrame : public nsQueryFrame {
|
|||||||
|
|
||||||
void* operator new(size_t, mozilla::PresShell*) MOZ_MUST_OVERRIDE;
|
void* operator new(size_t, mozilla::PresShell*) MOZ_MUST_OVERRIDE;
|
||||||
|
|
||||||
using PostDestroyData = mozilla::PostFrameDestroyData;
|
using DestroyContext = mozilla::FrameDestroyContext;
|
||||||
struct MOZ_RAII AutoPostDestroyData {
|
|
||||||
explicit AutoPostDestroyData(nsPresContext* aPresContext)
|
|
||||||
: mPresContext(aPresContext) {}
|
|
||||||
~AutoPostDestroyData() {
|
|
||||||
for (auto& content : mozilla::Reversed(mData.mAnonymousContent)) {
|
|
||||||
nsIFrame::DestroyAnonymousContent(mPresContext, content.forget());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nsPresContext* mPresContext;
|
|
||||||
PostDestroyData mData;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Destroys this frame and each of its child frames (recursively calls
|
|
||||||
* Destroy() for each child). If this frame is a first-continuation, this
|
|
||||||
* also removes the frame from the primary frame map and clears undisplayed
|
|
||||||
* content for its content node.
|
|
||||||
* If the frame is a placeholder, it also ensures the out-of-flow frame's
|
|
||||||
* removal and destruction.
|
|
||||||
*/
|
|
||||||
void Destroy() {
|
|
||||||
AutoPostDestroyData data(PresContext());
|
|
||||||
DestroyFrom(this, data.mData);
|
|
||||||
// Note that |this| is deleted at this point.
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flags for PeekOffsetCharacter, PeekOffsetNoAmount, PeekOffsetWord return
|
* Flags for PeekOffsetCharacter, PeekOffsetNoAmount, PeekOffsetWord return
|
||||||
@@ -689,32 +696,19 @@ class nsIFrame : public nsQueryFrame {
|
|||||||
: mRespectClusters(true), mIgnoreUserStyleAll(false) {}
|
: mRespectClusters(true), mIgnoreUserStyleAll(false) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
virtual void Destroy(DestroyContext&);
|
||||||
friend class nsBlockFrame; // for access to DestroyFrom
|
|
||||||
|
|
||||||
|
protected:
|
||||||
/**
|
/**
|
||||||
* Return true if the frame is part of a Selection.
|
* Return true if the frame is part of a Selection.
|
||||||
* Helper method to implement the public IsSelected() API.
|
* Helper method to implement the public IsSelected() API.
|
||||||
*/
|
*/
|
||||||
virtual bool IsFrameSelected() const;
|
virtual bool IsFrameSelected() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements Destroy(). Do not call this directly except from within a
|
|
||||||
* DestroyFrom() implementation.
|
|
||||||
*
|
|
||||||
* @note This will always be called, so it is not necessary to override
|
|
||||||
* Destroy() in subclasses of nsFrame, just DestroyFrom().
|
|
||||||
*
|
|
||||||
* @param aDestructRoot is the root of the subtree being destroyed
|
|
||||||
*/
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
|
||||||
PostDestroyData& aPostDestroyData);
|
|
||||||
friend class nsFrameList; // needed to pass aDestructRoot through to children
|
|
||||||
friend class nsLineBox; // needed to pass aDestructRoot through to children
|
|
||||||
friend class nsContainerFrame; // needed to pass aDestructRoot through to
|
|
||||||
// children
|
|
||||||
template <class Source>
|
template <class Source>
|
||||||
friend class do_QueryFrameHelper; // to read mClass
|
friend class do_QueryFrameHelper; // to read mClass
|
||||||
|
friend class nsBlockFrame; // for GetCaretBaseline
|
||||||
|
friend class nsContainerFrame; // for ReparentFrameViewTo
|
||||||
|
|
||||||
virtual ~nsIFrame();
|
virtual ~nsIFrame();
|
||||||
|
|
||||||
@@ -4900,9 +4894,6 @@ class nsIFrame : public nsQueryFrame {
|
|||||||
void HandleLastRememberedSize();
|
void HandleLastRememberedSize();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void DestroyAnonymousContent(nsPresContext* aPresContext,
|
|
||||||
already_AddRefed<nsIContent>&& aContent);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reparent this frame's view if it has one.
|
* Reparent this frame's view if it has one.
|
||||||
*/
|
*/
|
||||||
@@ -5624,4 +5615,13 @@ inline nsIFrame* nsFrameList::BackwardFrameTraversal::Prev(nsIFrame* aFrame) {
|
|||||||
return aFrame->GetNextSibling();
|
return aFrame->GetNextSibling();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
|
||||||
|
inline FrameDestroyContext::FrameDestroyContext(nsIFrame* aRoot)
|
||||||
|
: mDestructRoot(aRoot), mPresContext(aRoot->PresContext()) {
|
||||||
|
MOZ_ASSERT(mDestructRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif /* nsIFrame_h___ */
|
#endif /* nsIFrame_h___ */
|
||||||
|
|||||||
@@ -485,8 +485,7 @@ void nsImageFrame::DisconnectMap() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsImageFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
MaybeSendIntrinsicSizeAndRatioToEmbedder(Nothing(), Nothing());
|
MaybeSendIntrinsicSizeAndRatioToEmbedder(Nothing(), Nothing());
|
||||||
|
|
||||||
if (mReflowCallbackPosted) {
|
if (mReflowCallbackPosted) {
|
||||||
@@ -524,7 +523,7 @@ void nsImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
BrokenImageIcon::RemoveObserver(this);
|
BrokenImageIcon::RemoveObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAtomicContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsAtomicContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsImageFrame::DeinitOwnedRequest() {
|
void nsImageFrame::DeinitOwnedRequest() {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class nsImageFrame : public nsAtomicContainerFrame, public nsIReflowCallback {
|
|||||||
NS_DECL_FRAMEARENA_HELPERS(nsImageFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsImageFrame)
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData&) override;
|
void Destroy(DestroyContext&) override;
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldStyle) final;
|
void DidSetComputedStyle(ComputedStyle* aOldStyle) final;
|
||||||
|
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
|
|||||||
@@ -166,8 +166,7 @@ nsIFrame::FrameSearchResult nsInlineFrame::PeekOffsetCharacter(
|
|||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsInlineFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
nsFrameList* overflowFrames = GetOverflowFrames();
|
nsFrameList* overflowFrames = GetOverflowFrames();
|
||||||
if (overflowFrames) {
|
if (overflowFrames) {
|
||||||
// Fixup the parent pointers for any child frames on the OverflowList.
|
// Fixup the parent pointers for any child frames on the OverflowList.
|
||||||
@@ -175,7 +174,7 @@ void nsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
// container (an ancestor).
|
// container (an ancestor).
|
||||||
overflowFrames->ApplySetParent(this);
|
overflowFrames->ApplySetParent(this);
|
||||||
}
|
}
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsInlineFrame::StealFrame(nsIFrame* aChild) {
|
void nsInlineFrame::StealFrame(nsIFrame* aChild) {
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ class nsInlineFrame : public nsContainerFrame {
|
|||||||
PeekOffsetCharacterOptions aOptions =
|
PeekOffsetCharacterOptions aOptions =
|
||||||
PeekOffsetCharacterOptions()) override;
|
PeekOffsetCharacterOptions()) override;
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
void StealFrame(nsIFrame* aChild) override;
|
void StealFrame(nsIFrame* aChild) override;
|
||||||
|
|
||||||
// nsIHTMLReflow overrides
|
// nsIHTMLReflow overrides
|
||||||
|
|||||||
@@ -348,8 +348,7 @@ bool nsLineBox::CachedIsEmpty() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
void nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
||||||
nsIFrame* aDestructRoot, nsFrameList* aFrames,
|
nsFrameList* aFrames, DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
PresShell* presShell = aPresContext->PresShell();
|
PresShell* presShell = aPresContext->PresShell();
|
||||||
|
|
||||||
// Keep our line list and frame list up to date as we
|
// Keep our line list and frame list up to date as we
|
||||||
@@ -366,7 +365,7 @@ void nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
|||||||
MOZ_DIAGNOSTIC_ASSERT(child == line->mFirstChild, "Lines out of sync");
|
MOZ_DIAGNOSTIC_ASSERT(child == line->mFirstChild, "Lines out of sync");
|
||||||
line->mFirstChild = aFrames->FirstChild();
|
line->mFirstChild = aFrames->FirstChild();
|
||||||
line->NoteFrameRemoved(child);
|
line->NoteFrameRemoved(child);
|
||||||
child->DestroyFrom(aDestructRoot, aPostDestroyData);
|
child->Destroy(aContext);
|
||||||
}
|
}
|
||||||
MOZ_DIAGNOSTIC_ASSERT(line == aLines.front(),
|
MOZ_DIAGNOSTIC_ASSERT(line == aLines.front(),
|
||||||
"destroying child frames messed up our lines!");
|
"destroying child frames messed up our lines!");
|
||||||
|
|||||||
@@ -396,10 +396,9 @@ class nsLineBox final : public nsLineLink {
|
|||||||
mBounds.BSize(mWritingMode) = 0;
|
mBounds.BSize(mWritingMode) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
using PostDestroyData = nsIFrame::PostDestroyData;
|
using DestroyContext = nsIFrame::DestroyContext;
|
||||||
static void DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
static void DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
|
||||||
nsIFrame* aDestructRoot, nsFrameList* aFrames,
|
nsFrameList* aFrames, DestroyContext&);
|
||||||
PostDestroyData& aPostDestroyData);
|
|
||||||
|
|
||||||
// search from end to beginning of [aBegin, aEnd)
|
// search from end to beginning of [aBegin, aEnd)
|
||||||
// Returns true if it found the line and false if not.
|
// Returns true if it found the line and false if not.
|
||||||
|
|||||||
@@ -146,19 +146,18 @@ static FrameChildListID ChildListIDForOutOfFlow(nsFrameState aPlaceholderState,
|
|||||||
return FrameChildListID::Float;
|
return FrameChildListID::Float;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsPlaceholderFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
nsIFrame* oof = mOutOfFlowFrame;
|
nsIFrame* oof = mOutOfFlowFrame;
|
||||||
if (oof) {
|
if (oof) {
|
||||||
mOutOfFlowFrame = nullptr;
|
mOutOfFlowFrame = nullptr;
|
||||||
oof->RemoveProperty(nsIFrame::PlaceholderFrameProperty());
|
oof->RemoveProperty(nsIFrame::PlaceholderFrameProperty());
|
||||||
|
|
||||||
// If aDestructRoot is not an ancestor of the out-of-flow frame,
|
// If the destruct root is not an ancestor of the out-of-flow frame, then
|
||||||
// then call RemoveFrame on it here.
|
// call RemoveFrame on it here.
|
||||||
// Also destroy it here if it's a popup frame. (Bug 96291)
|
// Also destroy it here if it's a popup frame. (Bug 96291)
|
||||||
// FIXME(emilio): Is the popup special-case still needed?
|
// FIXME(emilio): Is the popup special-case still needed?
|
||||||
if (oof->IsMenuPopupFrame() ||
|
if (oof->IsMenuPopupFrame() ||
|
||||||
!nsLayoutUtils::IsProperAncestorFrame(aDestructRoot, oof)) {
|
!nsLayoutUtils::IsProperAncestorFrame(aContext.DestructRoot(), oof)) {
|
||||||
ChildListID listId = ChildListIDForOutOfFlow(GetStateBits(), oof);
|
ChildListID listId = ChildListIDForOutOfFlow(GetStateBits(), oof);
|
||||||
nsFrameManager* fm = PresContext()->FrameConstructor();
|
nsFrameManager* fm = PresContext()->FrameConstructor();
|
||||||
fm->RemoveFrame(listId, oof);
|
fm->RemoveFrame(listId, oof);
|
||||||
@@ -166,7 +165,7 @@ void nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
// else oof will be destroyed by its parent
|
// else oof will be destroyed by its parent
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
|
|||||||
@@ -102,8 +102,7 @@ class nsPlaceholderFrame final : public nsIFrame {
|
|||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
#if defined(DEBUG) || (defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF))
|
#if defined(DEBUG) || (defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF))
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
|
|||||||
@@ -260,8 +260,7 @@ void nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
|||||||
// line layout is not aware of the ruby text containers, hence
|
// line layout is not aware of the ruby text containers, hence
|
||||||
// it is necessary to remove them here.
|
// it is necessary to remove them here.
|
||||||
for (uint32_t i = 0; i < rtcCount; i++) {
|
for (uint32_t i = 0; i < rtcCount; i++) {
|
||||||
nsIFrame* nextRTC = textContainers[i]->GetNextInFlow();
|
if (nsIFrame* nextRTC = textContainers[i]->GetNextInFlow()) {
|
||||||
if (nextRTC) {
|
|
||||||
nextRTC->GetParent()->DeleteNextInFlowChild(nextRTC, true);
|
nextRTC->GetParent()->DeleteNextInFlowChild(nextRTC, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,14 @@ void nsSplittableFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
nsIFrame::Init(aContent, aParent, aPrevInFlow);
|
nsIFrame::Init(aContent, aParent, aPrevInFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsSplittableFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsSplittableFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// Disconnect from the flow list
|
// Disconnect from the flow list
|
||||||
if (mPrevContinuation || mNextContinuation) {
|
if (mPrevContinuation || mNextContinuation) {
|
||||||
RemoveFromFlow(this);
|
RemoveFromFlow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let the base class destroy the frame
|
// Let the base class destroy the frame
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* nsSplittableFrame::GetPrevContinuation() const {
|
nsIFrame* nsSplittableFrame::GetPrevContinuation() const {
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ class nsSplittableFrame : public nsIFrame {
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Frame continuations can be either fluid or non-fluid.
|
* Frame continuations can be either fluid or non-fluid.
|
||||||
|
|||||||
@@ -937,8 +937,7 @@ class nsHideViewer : public Runnable {
|
|||||||
|
|
||||||
static nsView* BeginSwapDocShellsForViews(nsView* aSibling);
|
static nsView* BeginSwapDocShellsForViews(nsView* aSibling);
|
||||||
|
|
||||||
void nsSubDocumentFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsSubDocumentFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
PropagateIsUnderHiddenEmbedderElementToSubView(true);
|
PropagateIsUnderHiddenEmbedderElementToSubView(true);
|
||||||
if (mPostedReflowCallback) {
|
if (mPostedReflowCallback) {
|
||||||
PresShell()->CancelReflowCallback(this);
|
PresShell()->CancelReflowCallback(this);
|
||||||
@@ -971,7 +970,7 @@ void nsSubDocumentFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAtomicContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsAtomicContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameLoader* nsSubDocumentFrame::FrameLoader() const {
|
nsFrameLoader* nsSubDocumentFrame::FrameLoader() const {
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ class nsSubDocumentFrame final : public nsAtomicContainerFrame,
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
|
|||||||
@@ -3868,8 +3868,7 @@ void nsTextFrame::ClearFrameOffsetCache() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTextFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTextFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
ClearFrameOffsetCache();
|
ClearFrameOffsetCache();
|
||||||
|
|
||||||
// We might want to clear NS_CREATE_FRAME_IF_NON_WHITESPACE or
|
// We might want to clear NS_CREATE_FRAME_IF_NON_WHITESPACE or
|
||||||
@@ -3880,7 +3879,7 @@ void nsTextFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
mNextContinuation->SetPrevInFlow(nullptr);
|
mNextContinuation->SetPrevInFlow(nullptr);
|
||||||
}
|
}
|
||||||
// Let the base class destroy the frame
|
// Let the base class destroy the frame
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsTArray<nsTextFrame*>* nsTextFrame::GetContinuations() {
|
nsTArray<nsTextFrame*>* nsTextFrame::GetContinuations() {
|
||||||
@@ -3922,8 +3921,7 @@ class nsContinuingTextFrame final : public nsTextFrame {
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) final;
|
nsIFrame* aPrevInFlow) final;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) final;
|
|
||||||
|
|
||||||
nsTextFrame* GetPrevContinuation() const final { return mPrevContinuation; }
|
nsTextFrame* GetPrevContinuation() const final { return mPrevContinuation; }
|
||||||
|
|
||||||
@@ -4089,8 +4087,7 @@ void nsContinuingTextFrame::Init(nsIContent* aContent,
|
|||||||
} // prev frame is bidi
|
} // prev frame is bidi
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsContinuingTextFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsContinuingTextFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
ClearFrameOffsetCache();
|
ClearFrameOffsetCache();
|
||||||
|
|
||||||
// The text associated with this frame will become associated with our
|
// The text associated with this frame will become associated with our
|
||||||
@@ -4113,7 +4110,7 @@ void nsContinuingTextFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
}
|
}
|
||||||
nsSplittableFrame::RemoveFromFlow(this);
|
nsSplittableFrame::RemoveFromFlow(this);
|
||||||
// Let the base class destroy the frame
|
// Let the base class destroy the frame
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame* nsContinuingTextFrame::FirstInFlow() const {
|
nsIFrame* nsContinuingTextFrame::FirstInFlow() const {
|
||||||
@@ -8896,7 +8893,8 @@ static void RemoveEmptyInFlows(nsTextFrame* aFrame,
|
|||||||
// Manually call DoRemoveFrame so we can tell it that we're
|
// Manually call DoRemoveFrame so we can tell it that we're
|
||||||
// removing empty frames; this will keep it from blowing away
|
// removing empty frames; this will keep it from blowing away
|
||||||
// text runs.
|
// text runs.
|
||||||
parentBlock->DoRemoveFrame(aFrame, nsBlockFrame::FRAMES_ARE_EMPTY);
|
nsIFrame::DestroyContext context(aFrame);
|
||||||
|
parentBlock->DoRemoveFrame(aFrame, nsBlockFrame::FRAMES_ARE_EMPTY, context);
|
||||||
} else {
|
} else {
|
||||||
// Just remove it normally; use FrameChildListID::NoReflowPrincipal to avoid
|
// Just remove it normally; use FrameChildListID::NoReflowPrincipal to avoid
|
||||||
// posting new reflows.
|
// posting new reflows.
|
||||||
|
|||||||
@@ -222,8 +222,7 @@ class nsTextFrame : public nsIFrame {
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
mozilla::Maybe<Cursor> GetCursor(const nsPoint&) final;
|
mozilla::Maybe<Cursor> GetCursor(const nsPoint&) final;
|
||||||
|
|
||||||
|
|||||||
@@ -147,14 +147,13 @@ nsIContent* nsVideoFrame::GetVideoControls() const {
|
|||||||
return mContent->GetShadowRoot()->GetFirstChild();
|
return mContent->GetShadowRoot()->GetFirstChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsVideoFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsVideoFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (mReflowCallbackPosted) {
|
if (mReflowCallbackPosted) {
|
||||||
PresShell()->CancelReflowCallback(this);
|
PresShell()->CancelReflowCallback(this);
|
||||||
}
|
}
|
||||||
aPostDestroyData.AddAnonymousContent(mCaptionDiv.forget());
|
aContext.AddAnonymousContent(mCaptionDiv.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mPosterImage.forget());
|
aContext.AddAnonymousContent(mPosterImage.forget());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DispatchResizeEvent : public Runnable {
|
class DispatchResizeEvent : public Runnable {
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ class nsVideoFrame final : public nsContainerFrame,
|
|||||||
mozilla::ComputeSizeFlags aFlags) override;
|
mozilla::ComputeSizeFlags aFlags) override;
|
||||||
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||||
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
||||||
const ReflowInput& aReflowInput,
|
const ReflowInput& aReflowInput,
|
||||||
|
|||||||
@@ -75,12 +75,11 @@ nsMathMLmunderoverFrame::InheritAutomaticData(nsIFrame* aParent) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMathMLmunderoverFrame::DestroyFrom(nsIFrame* aDestroyRoot,
|
void nsMathMLmunderoverFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (!mPostReflowIncrementScriptLevelCommands.IsEmpty()) {
|
if (!mPostReflowIncrementScriptLevelCommands.IsEmpty()) {
|
||||||
PresShell()->CancelReflowCallback(this);
|
PresShell()->CancelReflowCallback(this);
|
||||||
}
|
}
|
||||||
nsMathMLContainerFrame::DestroyFrom(aDestroyRoot, aPostDestroyData);
|
nsMathMLContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t nsMathMLmunderoverFrame::ScriptIncrement(nsIFrame* aFrame) {
|
uint8_t nsMathMLmunderoverFrame::ScriptIncrement(nsIFrame* aFrame) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class nsMathMLmunderoverFrame final : public nsMathMLContainerFrame,
|
|||||||
NS_IMETHOD UpdatePresentationData(uint32_t aFlagsValues,
|
NS_IMETHOD UpdatePresentationData(uint32_t aFlagsValues,
|
||||||
uint32_t aFlagsToUpdate) override;
|
uint32_t aFlagsToUpdate) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aRoot, PostDestroyData& aPostDestroyData) override;
|
void Destroy(DestroyContext&) override;
|
||||||
|
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ class SVGFEImageFrame final : public nsIFrame {
|
|||||||
|
|
||||||
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
bool IsFrameOfType(uint32_t aFlags) const override {
|
||||||
if (aFlags & eSupportsContainLayoutAndPaint) {
|
if (aFlags & eSupportsContainLayoutAndPaint) {
|
||||||
@@ -85,8 +84,7 @@ namespace mozilla {
|
|||||||
NS_IMPL_FRAMEARENA_HELPERS(SVGFEImageFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(SVGFEImageFrame)
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
void SVGFEImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void SVGFEImageFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
DecApproximateVisibleCount();
|
DecApproximateVisibleCount();
|
||||||
|
|
||||||
nsCOMPtr<nsIImageLoadingContent> imageLoader =
|
nsCOMPtr<nsIImageLoadingContent> imageLoader =
|
||||||
@@ -95,7 +93,7 @@ void SVGFEImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
imageLoader->FrameDestroyed(this);
|
imageLoader->FrameDestroyed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SVGFEImageFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void SVGFEImageFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ void SVGImageFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
void SVGImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void SVGImageFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
if (HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
||||||
DecApproximateVisibleCount();
|
DecApproximateVisibleCount();
|
||||||
}
|
}
|
||||||
@@ -139,7 +138,7 @@ void SVGImageFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
imageLoader->FrameDestroyed(this);
|
imageLoader->FrameDestroyed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsIFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ class SVGImageFrame final : public nsIFrame,
|
|||||||
|
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldStyle) final;
|
void DidSetComputedStyle(ComputedStyle* aOldStyle) final;
|
||||||
|
|
||||||
bool IsSVGTransformed(Matrix* aOwnTransforms = nullptr,
|
bool IsSVGTransformed(Matrix* aOwnTransforms = nullptr,
|
||||||
|
|||||||
@@ -774,15 +774,14 @@ void SVGOuterSVGFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SVGOuterSVGFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void SVGOuterSVGFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// This handles both the case when the root <svg> element is made display:none
|
// This handles both the case when the root <svg> element is made display:none
|
||||||
// (and thus loses its intrinsic size and aspect ratio), and when the frame
|
// (and thus loses its intrinsic size and aspect ratio), and when the frame
|
||||||
// is navigated elsewhere & we need to reset parent <object>/<embed>'s
|
// is navigated elsewhere & we need to reset parent <object>/<embed>'s
|
||||||
// recorded intrinsic size/ratio values.
|
// recorded intrinsic size/ratio values.
|
||||||
MaybeSendIntrinsicSizeAndRatioToEmbedder(Nothing(), Nothing());
|
MaybeSendIntrinsicSizeAndRatioToEmbedder(Nothing(), Nothing());
|
||||||
|
|
||||||
SVGDisplayContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
SVGDisplayContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -88,8 +88,7 @@ class SVGOuterSVGFrame final : public SVGDisplayContainerFrame,
|
|||||||
|
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ void nsTableCellFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTableCellFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTableCellFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
nsTableFrame::MaybeUnregisterPositionedTablePart(this,
|
||||||
nsTableFrame::MaybeUnregisterPositionedTablePart(this, aDestructRoot);
|
aContext.DestructRoot());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsIPercentBSizeObserver methods
|
// nsIPercentBSizeObserver methods
|
||||||
|
|||||||
@@ -66,8 +66,7 @@ class nsTableCellFrame : public nsContainerFrame,
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
mozilla::a11y::AccType AccessibleType() override;
|
mozilla::a11y::AccType AccessibleType() override;
|
||||||
|
|||||||
@@ -210,10 +210,9 @@ void nsTableFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
// the header only has forward declarations of them.
|
// the header only has forward declarations of them.
|
||||||
nsTableFrame::~nsTableFrame() = default;
|
nsTableFrame::~nsTableFrame() = default;
|
||||||
|
|
||||||
void nsTableFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTableFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
mColGroups.DestroyFrames(aContext);
|
||||||
mColGroups.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure any views are positioned properly
|
// Make sure any views are positioned properly
|
||||||
|
|||||||
@@ -197,8 +197,7 @@ class nsTableFrame : public nsContainerFrame {
|
|||||||
void RowOrColSpanChanged(nsTableCellFrame* aCellFrame);
|
void RowOrColSpanChanged(nsTableCellFrame* aCellFrame);
|
||||||
|
|
||||||
/** @see nsIFrame::DestroyFrom */
|
/** @see nsIFrame::DestroyFrom */
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
/** @see nsIFrame::DidSetComputedStyle */
|
/** @see nsIFrame::DidSetComputedStyle */
|
||||||
virtual void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
virtual void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
||||||
|
|||||||
@@ -154,10 +154,10 @@ void nsTableRowFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTableRowFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTableRowFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
nsTableFrame::MaybeUnregisterPositionedTablePart(this,
|
||||||
nsTableFrame::MaybeUnregisterPositionedTablePart(this, aDestructRoot);
|
aContext.DestructRoot());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ class nsTableRowFrame : public nsContainerFrame {
|
|||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ nsTableRowGroupFrame::nsTableRowGroupFrame(ComputedStyle* aStyle,
|
|||||||
|
|
||||||
nsTableRowGroupFrame::~nsTableRowGroupFrame() = default;
|
nsTableRowGroupFrame::~nsTableRowGroupFrame() = default;
|
||||||
|
|
||||||
void nsTableRowGroupFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTableRowGroupFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
nsTableFrame::MaybeUnregisterPositionedTablePart(this,
|
||||||
nsTableFrame::MaybeUnregisterPositionedTablePart(this, aDestructRoot);
|
aContext.DestructRoot());
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_QUERYFRAME_HEAD(nsTableRowGroupFrame)
|
NS_QUERYFRAME_HEAD(nsTableRowGroupFrame)
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ class nsTableRowGroupFrame final : public nsContainerFrame,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
/** @see nsIFrame::DidSetComputedStyle */
|
/** @see nsIFrame::DidSetComputedStyle */
|
||||||
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
|
||||||
|
|||||||
@@ -82,11 +82,10 @@ a11y::AccType nsTableWrapperFrame::AccessibleType() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void nsTableWrapperFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTableWrapperFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
DestroyAbsoluteFrames(aContext);
|
||||||
DestroyAbsoluteFrames(aDestructRoot, aPostDestroyData);
|
mCaptionFrames.DestroyFrames(aContext);
|
||||||
mCaptionFrames.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsFrameList& nsTableWrapperFrame::GetChildList(
|
const nsFrameList& nsTableWrapperFrame::GetChildList(
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ class nsTableWrapperFrame : public nsContainerFrame {
|
|||||||
|
|
||||||
// nsIFrame overrides - see there for a description
|
// nsIFrame overrides - see there for a description
|
||||||
|
|
||||||
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
|
virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
|
||||||
virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
|
virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
|
||||||
|
|||||||
@@ -2159,8 +2159,7 @@ void nsMenuPopupFrame::MoveToAttributePosition() {
|
|||||||
this, IntrinsicDirty::FrameAncestorsAndDescendants, NS_FRAME_IS_DIRTY);
|
this, IntrinsicDirty::FrameAncestorsAndDescendants, NS_FRAME_IS_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsMenuPopupFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsMenuPopupFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// XXX: Currently we don't fire popuphidden for these popups, that seems wrong
|
// XXX: Currently we don't fire popuphidden for these popups, that seems wrong
|
||||||
// but alas, also pre-existing.
|
// but alas, also pre-existing.
|
||||||
HidePopup(/* aDeselectMenu = */ false, ePopupClosed,
|
HidePopup(/* aDeselectMenu = */ false, ePopupClosed,
|
||||||
@@ -2170,7 +2169,7 @@ void nsMenuPopupFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
pm->PopupDestroyed(this);
|
pm->PopupDestroyed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsBlockFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsBlockFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsMargin nsMenuPopupFrame::GetMargin() const {
|
nsMargin nsMenuPopupFrame::GetMargin() const {
|
||||||
|
|||||||
@@ -195,8 +195,7 @@ class nsMenuPopupFrame final : public nsBlockFrame {
|
|||||||
int32_t aModType) override;
|
int32_t aModType) override;
|
||||||
|
|
||||||
// FIXME: This shouldn't run script (this can end up calling HidePopup).
|
// FIXME: This shouldn't run script (this can end up calling HidePopup).
|
||||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY void DestroyFrom(
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY void Destroy(DestroyContext&) override;
|
||||||
nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
bool HasRemoteContent() const;
|
bool HasRemoteContent() const;
|
||||||
|
|
||||||
|
|||||||
@@ -264,10 +264,9 @@ nsresult nsScrollbarButtonFrame::GetParentWithTag(nsAtom* toFind,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsScrollbarButtonFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsScrollbarButtonFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// Ensure our repeat service isn't going... it's possible that a scrollbar can
|
// Ensure our repeat service isn't going... it's possible that a scrollbar can
|
||||||
// disappear out from under you while you're in the process of scrolling.
|
// disappear out from under you while you're in the process of scrolling.
|
||||||
StopRepeat();
|
StopRepeat();
|
||||||
SimpleXULLeafFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
SimpleXULLeafFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ class nsScrollbarButtonFrame final : public mozilla::SimpleXULLeafFrame {
|
|||||||
: mozilla::SimpleXULLeafFrame(aStyle, aPresContext, kClassID) {}
|
: mozilla::SimpleXULLeafFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
friend nsIFrame* NS_NewScrollbarButtonFrame(mozilla::PresShell* aPresShell,
|
friend nsIFrame* NS_NewScrollbarButtonFrame(mozilla::PresShell* aPresShell,
|
||||||
ComputedStyle* aStyle);
|
ComputedStyle* aStyle);
|
||||||
|
|||||||
@@ -58,14 +58,13 @@ void nsScrollbarFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
AddStateBits(NS_FRAME_REFLOW_ROOT);
|
AddStateBits(NS_FRAME_REFLOW_ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsScrollbarFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsScrollbarFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
aContext.AddAnonymousContent(mUpTopButton.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mUpTopButton.forget());
|
aContext.AddAnonymousContent(mDownTopButton.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mDownTopButton.forget());
|
aContext.AddAnonymousContent(mSlider.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mSlider.forget());
|
aContext.AddAnonymousContent(mUpBottomButton.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mUpBottomButton.forget());
|
aContext.AddAnonymousContent(mDownBottomButton.forget());
|
||||||
aPostDestroyData.AddAnonymousContent(mDownBottomButton.forget());
|
nsContainerFrame::Destroy(aContext);
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsScrollbarFrame::Reflow(nsPresContext* aPresContext,
|
void nsScrollbarFrame::Reflow(nsPresContext* aPresContext,
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ class nsScrollbarFrame final : public nsContainerFrame,
|
|||||||
nsSize ScrollbarMinSize() const;
|
nsSize ScrollbarMinSize() const;
|
||||||
bool IsHorizontal() const;
|
bool IsHorizontal() const;
|
||||||
|
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
|
|||||||
@@ -1437,8 +1437,7 @@ nsSliderFrame::HandleRelease(nsPresContext* aPresContext,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsSliderFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsSliderFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
// tell our mediator if we have one we are gone.
|
// tell our mediator if we have one we are gone.
|
||||||
if (mMediator) {
|
if (mMediator) {
|
||||||
mMediator->SetSlider(nullptr);
|
mMediator->SetSlider(nullptr);
|
||||||
@@ -1447,7 +1446,7 @@ void nsSliderFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
StopRepeat();
|
StopRepeat();
|
||||||
|
|
||||||
// call base class Destroy()
|
// call base class Destroy()
|
||||||
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
nsContainerFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsSliderFrame::Notify() {
|
void nsSliderFrame::Notify() {
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ class nsSliderFrame final : public nsContainerFrame {
|
|||||||
nsReflowStatus& aStatus) override;
|
nsReflowStatus& aStatus) override;
|
||||||
|
|
||||||
// nsIFrame overrides
|
// nsIFrame overrides
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists) override;
|
const nsDisplayListSet& aLists) override;
|
||||||
|
|||||||
@@ -216,14 +216,13 @@ nsSplitterFrame::nsSplitterFrame(ComputedStyle* aStyle,
|
|||||||
nsPresContext* aPresContext)
|
nsPresContext* aPresContext)
|
||||||
: SimpleXULLeafFrame(aStyle, aPresContext, kClassID) {}
|
: SimpleXULLeafFrame(aStyle, aPresContext, kClassID) {}
|
||||||
|
|
||||||
void nsSplitterFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsSplitterFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (mInner) {
|
if (mInner) {
|
||||||
mInner->RemoveListener();
|
mInner->RemoveListener();
|
||||||
mInner->Disconnect();
|
mInner->Disconnect();
|
||||||
mInner = nullptr;
|
mInner = nullptr;
|
||||||
}
|
}
|
||||||
SimpleXULLeafFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
SimpleXULLeafFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsSplitterFrame::AttributeChanged(int32_t aNameSpaceID,
|
nsresult nsSplitterFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ class nsSplitterFrame final : public mozilla::SimpleXULLeafFrame {
|
|||||||
NS_DECL_FRAMEARENA_HELPERS(nsSplitterFrame)
|
NS_DECL_FRAMEARENA_HELPERS(nsSplitterFrame)
|
||||||
|
|
||||||
explicit nsSplitterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
explicit nsSplitterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
nsresult GetFrameName(nsAString& aResult) const override {
|
nsresult GetFrameName(nsAString& aResult) const override {
|
||||||
|
|||||||
@@ -298,8 +298,7 @@ void nsTreeBodyFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTreeBodyFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
void nsTreeBodyFrame::Destroy(DestroyContext& aContext) {
|
||||||
PostDestroyData& aPostDestroyData) {
|
|
||||||
if (mScrollbarActivity) {
|
if (mScrollbarActivity) {
|
||||||
mScrollbarActivity->Destroy();
|
mScrollbarActivity->Destroy();
|
||||||
mScrollbarActivity = nullptr;
|
mScrollbarActivity = nullptr;
|
||||||
@@ -334,7 +333,7 @@ void nsTreeBodyFrame::DestroyFrom(nsIFrame* aDestructRoot,
|
|||||||
mTree->BodyDestroyed(mTopRowIndex);
|
mTree->BodyDestroyed(mTopRowIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleXULLeafFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
SimpleXULLeafFrame::Destroy(aContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsTreeBodyFrame::EnsureView() {
|
void nsTreeBodyFrame::EnsureView() {
|
||||||
|
|||||||
@@ -157,8 +157,7 @@ class nsTreeBodyFrame final : public mozilla::SimpleXULLeafFrame,
|
|||||||
// Overridden from nsIFrame to cache our pres context.
|
// Overridden from nsIFrame to cache our pres context.
|
||||||
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
void Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||||
nsIFrame* aPrevInFlow) override;
|
nsIFrame* aPrevInFlow) override;
|
||||||
void DestroyFrom(nsIFrame* aDestructRoot,
|
void Destroy(DestroyContext&) override;
|
||||||
PostDestroyData& aPostDestroyData) override;
|
|
||||||
|
|
||||||
mozilla::Maybe<Cursor> GetCursor(const nsPoint&) override;
|
mozilla::Maybe<Cursor> GetCursor(const nsPoint&) override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user