# HG changeset patch # User Boris Zbarsky # Date 1519925552 18000 # Node ID f9d520b575f14558f24e060e663a92b84b72bb54 # Parent 1f9e787dc3e960b108827c06338ac88c2ec9aed5 Bug 1438326. Don't try to enqueue custom element callbacks when the custom element definition has been unlinked. r=smaug MozReview-Commit-ID: FLf6CJcpcVQ diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -421,16 +421,21 @@ CustomElementRegistry::EnqueueLifecycleC { CustomElementDefinition* definition = aDefinition; if (!definition) { definition = aCustomElement->GetCustomElementDefinition(); if (!definition || definition->mLocalName != aCustomElement->NodeInfo()->NameAtom()) { return; } + + if (!definition->mCallbacks) { + // definition has been unlinked. Don't try to mess with it. + return; + } } auto callback = CreateCustomElementCallback(aType, aCustomElement, aArgs, aAdoptedCallbackArgs, definition); if (!callback) { return; }