From 874330d4538bd4704730d57fa35fd678c7d6fbf2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Mon, 25 Jan 2021 23:18:58 +0000 Subject: Issue #1719 - Make pref-controlled and disable by default. Resolves #1719 --- dom/html/HTMLMenuItemElement.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'dom/html/HTMLMenuItemElement.cpp') diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index 5c5cf8d76..6cf4eb40c 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -7,12 +7,22 @@ #include "mozilla/BasicEvents.h" #include "mozilla/EventDispatcher.h" +#include "mozilla/Preferences.h" #include "mozilla/dom/HTMLMenuItemElementBinding.h" +#include "mozilla/dom/HTMLUnknownElement.h" #include "nsAttrValueInlines.h" #include "nsContentUtils.h" - -NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(MenuItem) +nsGenericHTMLElement* +NS_NewHTMLMenuItemElement(already_AddRefed&& aNodeInfo, + mozilla::dom::FromParser aFromParser) { + RefPtr nodeInfo(aNodeInfo); + if (mozilla::Preferences::GetBool("dom.menuitem.enabled")) { + return new mozilla::dom::HTMLMenuItemElement(nodeInfo.forget(), aFromParser); + } else { + return new mozilla::dom::HTMLUnknownElement(nodeInfo.forget()); + } +} namespace mozilla { namespace dom { -- cgit v1.2.3