diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp index 6e808f87e8..bba5d38ab2 100644 --- a/dom/html/nsHTMLContentSink.cpp +++ b/dom/html/nsHTMLContentSink.cpp @@ -265,7 +265,8 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed&& return NS_ERROR_OUT_OF_MEMORY; } - if (isCustomElementName || aIs) { + if (CustomElementRegistry::IsCustomElementEnabled() && + (isCustomElementName || aIs)) { nsContentUtils::SetupCustomElement(*aResult, aIs); }