summaryrefslogtreecommitdiffstats
path: root/layout/base
diff options
context:
space:
mode:
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsIPresShell.h2
-rw-r--r--layout/base/nsPresShell.cpp14
-rw-r--r--layout/base/nsPresShell.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h
index 2df75489f..5f83b9c15 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 f861e7b06..bd5125637 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 a0d2ea753..628e613c8 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