diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:41:41 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:41:41 -0400 |
commit | 96dfc63bc583454fb895c7a23f685995f5410388 (patch) | |
tree | 0acc6ed7feed9267c63e7d388a4ef24c015af467 | |
parent | ed7faf3fde0000b139414648269d2ff82846bac1 (diff) | |
download | uxp-96dfc63bc583454fb895c7a23f685995f5410388.tar.gz |
Bug 1411754 - Rename PresShell::DestroyFramesFor to DestroyFramesForAndRestyle
Tag #1375
-rw-r--r-- | dom/base/Element.cpp | 2 | ||||
-rw-r--r-- | dom/base/ShadowRoot.cpp | 5 | ||||
-rw-r--r-- | dom/xbl/nsXBLService.cpp | 2 | ||||
-rw-r--r-- | layout/base/nsIPresShell.h | 2 | ||||
-rw-r--r-- | layout/base/nsPresShell.cpp | 14 | ||||
-rw-r--r-- | layout/base/nsPresShell.h | 2 |
6 files changed, 14 insertions, 13 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 5bbfbee9b4..ba5ba9c721 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1119,7 +1119,7 @@ Element::CreateShadowRoot(ErrorResult& aError) if (nsIDocument* doc = GetComposedDoc()) { if (nsIPresShell* shell = doc->GetShell()) { - shell->DestroyFramesFor(this); + shell->DestroyFramesForAndRestyle(this); MOZ_ASSERT(!shell->FrameManager()->GetDisplayContentsStyleFor(this)); } } diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index f19cad6df9..5f61b1f4dc 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -265,8 +265,7 @@ ShadowRoot::DistributionChanged() return; } - // FIXME(emilio): Rename this to DestroyFramesForAndRestyle? - shell->DestroyFramesFor(host); + shell->DestroyFramesForAndRestyle(host); } const HTMLContentElement* @@ -513,7 +512,7 @@ ShadowRoot::AttributeChanged(nsIDocument* aDocument, return; } - shell->DestroyFramesFor(aElement); + shell->DestroyFramesForAndRestyle(aElement); } bool diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index ef0d205643..b50b2c6fe3 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -125,7 +125,7 @@ public: // since if the binding fetch fails then we don't want to destroy the // frames. if (nsIPresShell* shell = doc->GetShell()) { - shell->DestroyFramesFor(mBoundElement->AsElement()); + shell->DestroyFramesForAndRestyle(mBoundElement->AsElement()); } MOZ_ASSERT(!mBoundElement->GetPrimaryFrame()); } diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 2df75489f8..5f83b9c153 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -544,7 +544,7 @@ public: * * Note that this may destroy frames for an ancestor instead. */ - virtual void DestroyFramesFor(mozilla::dom::Element* aElement) = 0; + virtual void DestroyFramesForAndRestyle(mozilla::dom::Element* aElement) = 0; /** * Recreates the frames for a node diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index f861e7b06e..bd5125637f 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2828,7 +2828,7 @@ PresShell::CancelAllPendingReflows() } void -PresShell::DestroyFramesFor(Element* aElement) +PresShell::DestroyFramesForAndRestyle(Element* aElement) { MOZ_ASSERT(aElement); NS_ENSURE_TRUE_VOID(mPresContext); @@ -2847,13 +2847,15 @@ PresShell::DestroyFramesFor(Element* aElement) fc->DestroyFramesFor(aElement, &didReconstruct); fc->EndUpdate(); - // XXXmats doesn't frame state need to be restored in this case? - if (!didReconstruct) { - PostRecreateFramesFor(aElement); - } + auto changeHint = didReconstruct + ? nsChangeHint(0) + : nsChangeHint_ReconstructFrame; + // NOTE(emilio): eRestyle_Subtree is needed to force also a full subtree + // restyle for the content (in Stylo, where the existence of frames != the + // existence of styles). mPresContext->RestyleManager()->PostRestyleEvent( - aElement, eRestyle_Subtree, nsChangeHint(0)); + aElement, eRestyle_Subtree, changeHint); --mChangeNestCount; } diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h index a0d2ea7530..628e613c88 100644 --- a/layout/base/nsPresShell.h +++ b/layout/base/nsPresShell.h @@ -139,7 +139,7 @@ public: virtual bool IsSafeToFlush() const override; virtual void FlushPendingNotifications(mozFlushType aType) override; virtual void FlushPendingNotifications(mozilla::ChangesToFlush aType) override; - virtual void DestroyFramesFor(mozilla::dom::Element* aElement) override; + virtual void DestroyFramesForAndRestyle(mozilla::dom::Element* aElement) override; /** * Recreates the frames for a node |