Loading browser/base/content/test/contextMenu/browser_contextmenu.js +4 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,10 @@ add_task(async function test_xul_text_link_label() { add_task(async function test_setup_html() { let url = example_base + "subtst_contextmenu.html"; await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); await BrowserTestUtils.openNewForegroundTab(gBrowser, url); await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() { Loading browser/base/content/test/contextMenu/browser_contextmenu_childprocess.js +4 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ const gBaseURL = "https://example.com/browser/browser/base/content/test/contextMenu/"; add_task(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); let tab = await BrowserTestUtils.openNewForegroundTab( gBrowser, gBaseURL + "subtst_contextmenu.html" Loading dom/html/HTMLMenuElement.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ nsresult HTMLMenuElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName, const nsAttrValue* aOldValue, nsIPrincipal* aSubjectPrincipal, bool aNotify) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::type) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::type && StaticPrefs::dom_menuitem_enabled()) { if (aValue) { mType = aValue->GetEnumValue(); } else { Loading @@ -102,7 +103,8 @@ bool HTMLMenuElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type && StaticPrefs::dom_menuitem_enabled()) { return aResult.ParseEnumValue(aValue, kMenuTypeTable, false, kMenuDefaultType); } Loading dom/html/HTMLMenuItemElement.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,22 @@ #include "mozilla/BasicEvents.h" #include "mozilla/EventDispatcher.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); auto* nim = nodeInfo->NodeInfoManager(); MOZ_ASSERT(nim); if (mozilla::StaticPrefs::dom_menuitem_enabled()) { return new (nim) mozilla::dom::HTMLMenuItemElement(nodeInfo.forget(), aFromParser); } return new (nim) mozilla::dom::HTMLUnknownElement(nodeInfo.forget()); } namespace mozilla::dom { Loading dom/html/test/browser_content_contextmenu_userinput.js +3 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ const kPage = "http://example.org/browser/" + "dom/html/test/file_content_contextmenu.html"; add_task(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); await BrowserTestUtils.withNewTab( { gBrowser, Loading Loading
browser/base/content/test/contextMenu/browser_contextmenu.js +4 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,10 @@ add_task(async function test_xul_text_link_label() { add_task(async function test_setup_html() { let url = example_base + "subtst_contextmenu.html"; await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); await BrowserTestUtils.openNewForegroundTab(gBrowser, url); await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() { Loading
browser/base/content/test/contextMenu/browser_contextmenu_childprocess.js +4 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ const gBaseURL = "https://example.com/browser/browser/base/content/test/contextMenu/"; add_task(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); let tab = await BrowserTestUtils.openNewForegroundTab( gBrowser, gBaseURL + "subtst_contextmenu.html" Loading
dom/html/HTMLMenuElement.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ nsresult HTMLMenuElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName, const nsAttrValue* aOldValue, nsIPrincipal* aSubjectPrincipal, bool aNotify) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::type) { if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::type && StaticPrefs::dom_menuitem_enabled()) { if (aValue) { mType = aValue->GetEnumValue(); } else { Loading @@ -102,7 +103,8 @@ bool HTMLMenuElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue, nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) { if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type && StaticPrefs::dom_menuitem_enabled()) { return aResult.ParseEnumValue(aValue, kMenuTypeTable, false, kMenuDefaultType); } Loading
dom/html/HTMLMenuItemElement.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,22 @@ #include "mozilla/BasicEvents.h" #include "mozilla/EventDispatcher.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); auto* nim = nodeInfo->NodeInfoManager(); MOZ_ASSERT(nim); if (mozilla::StaticPrefs::dom_menuitem_enabled()) { return new (nim) mozilla::dom::HTMLMenuItemElement(nodeInfo.forget(), aFromParser); } return new (nim) mozilla::dom::HTMLUnknownElement(nodeInfo.forget()); } namespace mozilla::dom { Loading
dom/html/test/browser_content_contextmenu_userinput.js +3 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ const kPage = "http://example.org/browser/" + "dom/html/test/file_content_contextmenu.html"; add_task(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.menuitem.enabled", true]], }); await BrowserTestUtils.withNewTab( { gBrowser, Loading