diff options
author | Moonchild <moonchild@palemoon.org> | 2021-01-25 23:18:58 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-01-25 23:18:58 +0000 |
commit | 874330d4538bd4704730d57fa35fd678c7d6fbf2 (patch) | |
tree | 3b89c8f0a55a99a90aef812e73966a9e2ba6cbb9 /dom/html/HTMLMenuItemElement.cpp | |
parent | 1126548deecfd736755f1e1b7e7d551b42e73780 (diff) | |
download | UXP-874330d4538bd4704730d57fa35fd678c7d6fbf2.tar UXP-874330d4538bd4704730d57fa35fd678c7d6fbf2.tar.gz UXP-874330d4538bd4704730d57fa35fd678c7d6fbf2.tar.lz UXP-874330d4538bd4704730d57fa35fd678c7d6fbf2.tar.xz UXP-874330d4538bd4704730d57fa35fd678c7d6fbf2.zip |
Issue #1719 - Make <menuitem> pref-controlled and disable by default.
Resolves #1719
Diffstat (limited to 'dom/html/HTMLMenuItemElement.cpp')
-rw-r--r-- | dom/html/HTMLMenuItemElement.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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<mozilla::dom::NodeInfo>&& aNodeInfo, + mozilla::dom::FromParser aFromParser) { + RefPtr<mozilla::dom::NodeInfo> 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 { |