Bug 1845223 - Destroy ContainStyleScopes before recalculating counters & quotes during frame destruction r=emilio
Instead of recalculating quotes and counter before destroying contain style scopes, calculate them after. This prevents stale frame pointers from sticking around during counter and quote recalculation. Differential Revision: https://phabricator.services.mozilla.com/D188254
This commit is contained in:
@@ -1478,6 +1478,10 @@ nsCSSFrameConstructor::nsCSSFrameConstructor(Document* aDocument,
|
||||
}
|
||||
|
||||
void nsCSSFrameConstructor::NotifyDestroyingFrame(nsIFrame* aFrame) {
|
||||
if (aFrame->StyleDisplay()->IsContainStyle()) {
|
||||
mContainStyleScopeManager.DestroyScopesFor(aFrame);
|
||||
}
|
||||
|
||||
if (aFrame->HasAnyStateBits(NS_FRAME_GENERATED_CONTENT) &&
|
||||
mContainStyleScopeManager.DestroyQuoteNodesFor(aFrame)) {
|
||||
QuotesDirty();
|
||||
@@ -1491,10 +1495,6 @@ void nsCSSFrameConstructor::NotifyDestroyingFrame(nsIFrame* aFrame) {
|
||||
CountersDirty();
|
||||
}
|
||||
|
||||
if (aFrame->StyleDisplay()->IsContainStyle()) {
|
||||
mContainStyleScopeManager.DestroyScopesFor(aFrame);
|
||||
}
|
||||
|
||||
RestyleManager()->NotifyDestroyingFrame(aFrame);
|
||||
}
|
||||
|
||||
@@ -3703,7 +3703,8 @@ nsCSSFrameConstructor::FindCanvasData(const Element& aElement,
|
||||
return &sCanvasData;
|
||||
}
|
||||
|
||||
static MOZ_NEVER_INLINE void DestroyFramesInList(PresShell* aPs, nsFrameList& aList) {
|
||||
static MOZ_NEVER_INLINE void DestroyFramesInList(PresShell* aPs,
|
||||
nsFrameList& aList) {
|
||||
nsIFrame::DestroyContext context(aPs);
|
||||
aList.DestroyFrames(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user