diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 834e465d4b7db..caee9eebcccd6 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -2857,7 +2857,7 @@ void Element::removedFromAncestor(RemovalType removalType, ContainerNode& oldPar { ContainerNode::removedFromAncestor(removalType, oldParentOfRemovedTree); - if (RefPtr page = document().page()) { + if (RefPtrAllowingPartiallyDestroyed page = document().page()) { #if ENABLE(POINTER_LOCK) page->pointerLockController().elementWasRemoved(*this); #endif