diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 482b98da2a45..b4029e4e2ca5 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -2101,9 +2101,12 @@ static nsIContent* GetNativeAnonymousSubtreeRoot(nsIContent* aContent) return nullptr; } auto* current = aContent; + // FIXME(emilio): This should not need to worry about current being null, but + // editor removes nodes in native anonymous subtrees, and we don't clean nodes + // from the current event content stack from ContentRemoved, so it can + // actually happen, see bug 1510208. while (current && !current->IsRootOfNativeAnonymousSubtree()) { current = current->GetFlattenedTreeParent(); - MOZ_DIAGNOSTIC_ASSERT(current, "How?"); } return current; }