Bug 1372276 - Part 6: Remove <menuitem> HTML element support; r?bz,wchen,froydnj,dietrich,masayuki draft
authorGordon P. Hemsley <gphemsley@gmail.com>
Sat, 29 Jul 2017 03:43:08 -0400
changeset 618203 4e1374fe0ec7215954331027465dcba2a384fae4
parent 618200 17995bbf0f7ff25ae9d14ef86c052242f0d6d724
child 639982 5cab88819b3fd3d7af348d5a4ba73b7bf082e8cd
push id71237
push userbmo:gphemsley@gphemsley.org
push dateSun, 30 Jul 2017 15:06:27 +0000
reviewersbz, wchen, froydnj, dietrich, masayuki
bugs1372276
milestone56.0a1
Bug 1372276 - Part 6: Remove <menuitem> HTML element support; r?bz,wchen,froydnj,dietrich,masayuki MozReview-Commit-ID: 7NoVi79eco4
addon-sdk/source/test/addons/l10n/data/test-localization.html
addon-sdk/source/test/addons/l10n/main.js
dom/html/HTMLMenuElement.cpp
dom/html/HTMLMenuItemElement.cpp
dom/html/HTMLMenuItemElement.h
dom/html/moz.build
dom/html/nsGenericHTMLElement.h
dom/html/test/mochitest.ini
dom/html/test/test_bug617528.html
dom/html/test/test_bug677463.html
dom/html/test/test_checked.html
dom/interfaces/html/moz.build
dom/interfaces/html/nsIDOMHTMLMenuItemElement.idl
dom/tests/mochitest/general/test_interfaces.js
dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js
dom/webidl/HTMLMenuItemElement.webidl
dom/webidl/moz.build
editor/libeditor/HTMLEditUtils.cpp
parser/htmlparser/nsElementTable.cpp
parser/htmlparser/nsHTMLTagList.h
testing/web-platform/meta/html/dom/interfaces.html.ini
testing/web-platform/meta/html/semantics/interactive-elements/contextmenu-historical.html.ini
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/addon-sdk/source/test/addons/l10n/data/test-localization.html
+++ b/addon-sdk/source/test/addons/l10n/data/test-localization.html
@@ -17,13 +17,10 @@
       </li>
     </ul>
     <div data-l10n-id="text-content">No</div>
     <div data-l10n-id="Translated">
       A data-l10n-id value can be used in multiple elements
     </div>
     <a data-l10n-id="link-attributes" title="Certain whitelisted attributes get translated too" alt="No" accesskey="A"></a>
     <input data-l10n-id="input" type="text" placeholder="Form placeholders are translateable">
-    <menu>
-      <menuitem data-l10n-id="contextitem" label="Labels of select options and context menus are translateable">
-    </menu>
   </body>
 </html
--- a/addon-sdk/source/test/addons/l10n/main.js
+++ b/addon-sdk/source/test/addons/l10n/main.js
@@ -107,18 +107,17 @@ exports.testHtmlLocalizationPageWorker =
                         nodes[2].innerHTML,
                         nodes[3].innerHTML,
                         nodes[4].title,
                         nodes[4].getAttribute("alt"),
                         nodes[4].getAttribute("accesskey"),
                         nodes[4].getAttribute("aria-label"),
                         nodes[4].getAttribute("aria-valuetext"),
                         nodes[4].getAttribute("aria-moz-hint"),
-                        nodes[5].placeholder,
-                        nodes[6].label]);
+                        nodes[5].placeholder]);
     },
     onMessage: function (data) {
       assert.equal(
         data[0],
         "Kept as-is",
         "Nodes with unknown id in .properties are kept 'as-is'"
       );
       assert.equal(data[1], "Yes", "HTML is translated");
@@ -135,18 +134,16 @@ exports.testHtmlLocalizationPageWorker =
       assert.equal(data[6], "B", "Accesskey gets translated.");
       
       assert.equal(data[7], "Yes", "Aria-Label gets translated.");
       assert.equal(data[8], "Value", "Aria-valuetext gets translated.");
       assert.equal(data[9], "Hint", "Aria-moz-hint gets translated.");
       
       assert.equal(data[10], "Yes", "Form placeholders are translateable.");
       
-      assert.equal(data[11], "Yes", "Labels of select options and context menus are translateable.");
-
       done();
     }
   });
 });
 
 exports.testHtmlLocalization = createTest("en-GB", function(assert, loader, done) {
   // Ensure initing html component that watch document creations
   // Note that this module is automatically initialized in
@@ -167,18 +164,17 @@ exports.testHtmlLocalization = createTes
                             nodes[2].innerHTML,
                             nodes[3].innerHTML,
                             nodes[4].title,
                             nodes[4].getAttribute("alt"),
                             nodes[4].getAttribute("accesskey"),
                             nodes[4].getAttribute("aria-label"),
                             nodes[4].getAttribute("aria-valuetext"),
                             nodes[4].getAttribute("aria-moz-hint"),
-                            nodes[5].placeholder,
-                            nodes[6].label]);
+                            nodes[5].placeholder]);
         },
         onMessage: function (data) {
           assert.equal(
             data[0],
             "Kept as-is",
             "Nodes with unknown id in .properties are kept 'as-is'"
           );
           assert.equal(data[1], "Yes", "HTML is translated");
@@ -195,18 +191,16 @@ exports.testHtmlLocalization = createTes
           assert.equal(data[6], "B", "Accesskey gets translated.");
           
           assert.equal(data[7], "Yes", "Aria-Label gets translated.");
           assert.equal(data[8], "Value", "Aria-valuetext gets translated.");
           assert.equal(data[9], "Hint", "Aria-moz-hint gets translated.");
           
           assert.equal(data[10], "Yes", "Form placeholders are translateable.");
           
-          assert.equal(data[11], "Yes", "Labels of select options and context menus are translateable.");
-
           tab.close(done);
         }
       });
     }
   });
 });
 
 exports.testEnUsLocaleName = createTest("en-US", function(assert, loader, done) {
--- a/dom/html/HTMLMenuElement.cpp
+++ b/dom/html/HTMLMenuElement.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/HTMLMenuElement.h"
 
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/dom/HTMLMenuElementBinding.h"
-#include "mozilla/dom/HTMLMenuItemElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsContentUtils.h"
 #include "nsIURI.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
 
 namespace mozilla {
 namespace dom {
deleted file mode 100644
--- a/dom/html/HTMLMenuItemElement.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/HTMLMenuItemElement.h"
-
-#include "mozilla/BasicEvents.h"
-#include "mozilla/EventDispatcher.h"
-#include "mozilla/dom/HTMLMenuItemElementBinding.h"
-#include "nsAttrValueInlines.h"
-#include "nsContentUtils.h"
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(MenuItem)
-
-namespace mozilla {
-namespace dom {
-
-// First bits are needed for the menuitem type.
-#define NS_CHECKED_IS_TOGGLED (1 << 2)
-#define NS_ORIGINAL_CHECKED_VALUE (1 << 3)
-#define NS_MENUITEM_TYPE(bits) ((bits) & ~( \
-  NS_CHECKED_IS_TOGGLED | NS_ORIGINAL_CHECKED_VALUE))
-
-enum CmdType : uint8_t
-{
-  CMD_TYPE_MENUITEM = 1,
-  CMD_TYPE_CHECKBOX,
-  CMD_TYPE_RADIO
-};
-
-static const nsAttrValue::EnumTable kMenuItemTypeTable[] = {
-  { "menuitem", CMD_TYPE_MENUITEM },
-  { "checkbox", CMD_TYPE_CHECKBOX },
-  { "radio", CMD_TYPE_RADIO },
-  { nullptr, 0 }
-};
-
-static const nsAttrValue::EnumTable* kMenuItemDefaultType =
-  &kMenuItemTypeTable[0];
-
-// A base class inherited by all radio visitors.
-class Visitor
-{
-public:
-  Visitor() { }
-  virtual ~Visitor() { }
-
-  /**
-   * Visit a node in the tree. This is meant to be called on all radios in a
-   * group, sequentially. If the method returns false then the iteration is
-   * stopped.
-   */
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem) = 0;
-};
-
-// Find the selected radio, see GetSelectedRadio().
-class GetCheckedVisitor : public Visitor
-{
-public:
-  explicit GetCheckedVisitor(HTMLMenuItemElement** aResult)
-    : mResult(aResult)
-    { }
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem)
-  {
-    if (aMenuItem->IsChecked()) {
-      *mResult = aMenuItem;
-      return false;
-    }
-    return true;
-  }
-protected:
-  HTMLMenuItemElement** mResult;
-};
-
-// Deselect all radios except the one passed to the constructor.
-class ClearCheckedVisitor : public Visitor
-{
-public:
-  explicit ClearCheckedVisitor(HTMLMenuItemElement* aExcludeMenuItem)
-    : mExcludeMenuItem(aExcludeMenuItem)
-    { }
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem)
-  {
-    if (aMenuItem != mExcludeMenuItem && aMenuItem->IsChecked()) {
-      aMenuItem->ClearChecked();
-    }
-    return true;
-  }
-protected:
-  HTMLMenuItemElement* mExcludeMenuItem;
-};
-
-// Get current value of the checked dirty flag. The same value is stored on all
-// radios in the group, so we need to check only the first one.
-class GetCheckedDirtyVisitor : public Visitor
-{
-public:
-  GetCheckedDirtyVisitor(bool* aCheckedDirty,
-                         HTMLMenuItemElement* aExcludeMenuItem)
-    : mCheckedDirty(aCheckedDirty),
-      mExcludeMenuItem(aExcludeMenuItem)
-    { }
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem)
-  {
-    if (aMenuItem == mExcludeMenuItem) {
-      return true;
-    }
-    *mCheckedDirty = aMenuItem->IsCheckedDirty();
-    return false;
-  }
-protected:
-  bool* mCheckedDirty;
-  HTMLMenuItemElement* mExcludeMenuItem;
-};
-
-// Set checked dirty to true on all radios in the group.
-class SetCheckedDirtyVisitor : public Visitor
-{
-public:
-  SetCheckedDirtyVisitor()
-    { }
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem)
-  {
-    aMenuItem->SetCheckedDirty();
-    return true;
-  }
-};
-
-// A helper visitor that is used to combine two operations (visitors) to avoid
-// iterating over radios twice.
-class CombinedVisitor : public Visitor
-{
-public:
-  CombinedVisitor(Visitor* aVisitor1, Visitor* aVisitor2)
-    : mVisitor1(aVisitor1), mVisitor2(aVisitor2),
-      mContinue1(true), mContinue2(true)
-    { }
-  virtual bool Visit(HTMLMenuItemElement* aMenuItem)
-  {
-    if (mContinue1) {
-      mContinue1 = mVisitor1->Visit(aMenuItem);
-    }
-    if (mContinue2) {
-      mContinue2 = mVisitor2->Visit(aMenuItem);
-    }
-    return mContinue1 || mContinue2;
-  }
-protected:
-  Visitor* mVisitor1;
-  Visitor* mVisitor2;
-  bool mContinue1;
-  bool mContinue2;
-};
-
-
-HTMLMenuItemElement::HTMLMenuItemElement(
-  already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo, FromParser aFromParser)
-  : nsGenericHTMLElement(aNodeInfo),
-    mType(kMenuItemDefaultType->value),
-    mParserCreating(false),
-    mShouldInitChecked(false),
-    mCheckedDirty(false),
-    mChecked(false)
-{
-  mParserCreating = aFromParser;
-}
-
-HTMLMenuItemElement::~HTMLMenuItemElement()
-{
-}
-
-
-NS_IMPL_ISUPPORTS_INHERITED(HTMLMenuItemElement, nsGenericHTMLElement,
-                            nsIDOMHTMLMenuItemElement)
-
-//NS_IMPL_ELEMENT_CLONE(HTMLMenuItemElement)
-nsresult
-HTMLMenuItemElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
-                           bool aPreallocateArrays) const
-{
-  *aResult = nullptr;
-  already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
-  RefPtr<HTMLMenuItemElement> it =
-    new HTMLMenuItemElement(ni, NOT_FROM_PARSER);
-  nsresult rv = const_cast<HTMLMenuItemElement*>(this)->CopyInnerTo(it, aPreallocateArrays);
-  if (NS_SUCCEEDED(rv)) {
-    switch (mType) {
-      case CMD_TYPE_CHECKBOX:
-      case CMD_TYPE_RADIO:
-        if (mCheckedDirty) {
-          // We no longer have our original checked state.  Set our
-          // checked state on the clone.
-          it->mCheckedDirty = true;
-          it->mChecked = mChecked;
-        }
-        break;
-    }
-
-    it.forget(aResult);
-  }
-
-  return rv;
-}
-
-
-NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMenuItemElement, Type, type,
-                                kMenuItemDefaultType->tag)
-// GetText returns a whitespace compressed .textContent value.
-NS_IMPL_STRING_ATTR_WITH_FALLBACK(HTMLMenuItemElement, Label, label, GetText)
-NS_IMPL_URI_ATTR(HTMLMenuItemElement, Icon, icon)
-NS_IMPL_BOOL_ATTR(HTMLMenuItemElement, Disabled, disabled)
-NS_IMPL_BOOL_ATTR(HTMLMenuItemElement, DefaultChecked, checked)
-//NS_IMPL_BOOL_ATTR(HTMLMenuItemElement, Checked, checked)
-NS_IMPL_STRING_ATTR(HTMLMenuItemElement, Radiogroup, radiogroup)
-
-NS_IMETHODIMP
-HTMLMenuItemElement::GetChecked(bool* aChecked)
-{
-  *aChecked = mChecked;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLMenuItemElement::SetChecked(bool aChecked)
-{
-  bool checkedChanged = mChecked != aChecked;
-
-  mChecked = aChecked;
-
-  if (mType == CMD_TYPE_RADIO) {
-    if (checkedChanged) {
-      if (mCheckedDirty) {
-        ClearCheckedVisitor visitor(this);
-        WalkRadioGroup(&visitor);
-      } else {
-        ClearCheckedVisitor visitor1(this);
-        SetCheckedDirtyVisitor visitor2;
-        CombinedVisitor visitor(&visitor1, &visitor2);
-        WalkRadioGroup(&visitor);
-      }
-    } else if (!mCheckedDirty) {
-      SetCheckedDirtyVisitor visitor;
-      WalkRadioGroup(&visitor);
-    }
-  } else {
-    mCheckedDirty = true;
-  }
-
-  return NS_OK;
-}
-
-nsresult
-HTMLMenuItemElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
-{
-  if (aVisitor.mEvent->mMessage == eMouseClick) {
-
-    bool originalCheckedValue = false;
-    switch (mType) {
-      case CMD_TYPE_CHECKBOX:
-        originalCheckedValue = mChecked;
-        SetChecked(!originalCheckedValue);
-        aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
-        break;
-      case CMD_TYPE_RADIO:
-        nsCOMPtr<nsIDOMHTMLMenuItemElement> selectedRadio = GetSelectedRadio();
-        aVisitor.mItemData = selectedRadio;
-
-        originalCheckedValue = mChecked;
-        if (!originalCheckedValue) {
-          SetChecked(true);
-          aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
-        }
-        break;
-    }
-
-    if (originalCheckedValue) {
-      aVisitor.mItemFlags |= NS_ORIGINAL_CHECKED_VALUE;
-    }
-
-    // We must cache type because mType may change during JS event.
-    aVisitor.mItemFlags |= mType;
-  }
-
-  return nsGenericHTMLElement::GetEventTargetParent(aVisitor);
-}
-
-nsresult
-HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
-{
-  // Check to see if the event was cancelled.
-  if (aVisitor.mEvent->mMessage == eMouseClick &&
-      aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
-      aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
-    bool originalCheckedValue =
-      !!(aVisitor.mItemFlags & NS_ORIGINAL_CHECKED_VALUE);
-    uint8_t oldType = NS_MENUITEM_TYPE(aVisitor.mItemFlags);
-
-    nsCOMPtr<nsIDOMHTMLMenuItemElement> selectedRadio =
-      do_QueryInterface(aVisitor.mItemData);
-    if (selectedRadio) {
-      selectedRadio->SetChecked(true);
-      if (mType != CMD_TYPE_RADIO) {
-        SetChecked(false);
-      }
-    } else if (oldType == CMD_TYPE_CHECKBOX) {
-      SetChecked(originalCheckedValue);
-    }
-  }
-
-  return NS_OK;
-}
-
-nsresult
-HTMLMenuItemElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                                nsIContent* aBindingParent,
-                                bool aCompileEventHandlers)
-{
-  nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
-                                                 aBindingParent,
-                                                 aCompileEventHandlers);
-
-  if (NS_SUCCEEDED(rv) && aDocument && mType == CMD_TYPE_RADIO) {
-    AddedToRadioGroup();
-  }
-
-  return rv;
-}
-
-bool
-HTMLMenuItemElement::ParseAttribute(int32_t aNamespaceID,
-                                    nsIAtom* aAttribute,
-                                    const nsAString& aValue,
-                                    nsAttrValue& aResult)
-{
-  if (aNamespaceID == kNameSpaceID_None) {
-    if (aAttribute == nsGkAtoms::type) {
-      return aResult.ParseEnumValue(aValue, kMenuItemTypeTable, false,
-                                    kMenuItemDefaultType);
-    }
-
-    if (aAttribute == nsGkAtoms::radiogroup) {
-      aResult.ParseAtom(aValue);
-      return true;
-    }
-  }
-
-  return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
-
-void
-HTMLMenuItemElement::DoneCreatingElement()
-{
-  mParserCreating = false;
-
-  if (mShouldInitChecked) {
-    InitChecked();
-    mShouldInitChecked = false;
-  }
-}
-
-void
-HTMLMenuItemElement::GetText(nsAString& aText)
-{
-  nsAutoString text;
-  nsContentUtils::GetNodeTextContent(this, false, text);
-
-  text.CompressWhitespace(true, true);
-  aText = text;
-}
-
-nsresult
-HTMLMenuItemElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                  const nsAttrValue* aValue,
-                                  const nsAttrValue* aOldValue, bool aNotify)
-{
-  if (aNameSpaceID == kNameSpaceID_None) {
-    // Handle type changes first, since some of the later conditions in this
-    // method look at mType and want to see the new value.
-    if (aName == nsGkAtoms::type) {
-      if (aValue) {
-        mType = aValue->GetEnumValue();
-      } else {
-        mType = kMenuItemDefaultType->value;
-      }
-    }
-
-    if ((aName == nsGkAtoms::radiogroup || aName == nsGkAtoms::type) &&
-        mType == CMD_TYPE_RADIO &&
-        !mParserCreating) {
-      if (IsInUncomposedDoc() && GetParent()) {
-        AddedToRadioGroup();
-      }
-    }
-
-    // Checked must be set no matter what type of menuitem it is, since
-    // GetChecked() must reflect the new value
-    if (aName == nsGkAtoms::checked &&
-        !mCheckedDirty) {
-      if (mParserCreating) {
-        mShouldInitChecked = true;
-      } else {
-        InitChecked();
-      }
-    }
-  }
-
-  return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
-                                            aOldValue, aNotify);
-}
-
-void
-HTMLMenuItemElement::WalkRadioGroup(Visitor* aVisitor)
-{
-  nsIContent* parent = GetParent();
-  if (!parent) {
-    aVisitor->Visit(this);
-    return;
-  }
-
-  BorrowedAttrInfo info1(GetAttrInfo(kNameSpaceID_None,
-                               nsGkAtoms::radiogroup));
-  bool info1Empty = !info1.mValue || info1.mValue->IsEmptyString();
-
-  for (nsIContent* cur = parent->GetFirstChild();
-       cur;
-       cur = cur->GetNextSibling()) {
-    HTMLMenuItemElement* menuitem = HTMLMenuItemElement::FromContent(cur);
-
-    if (!menuitem || menuitem->GetType() != CMD_TYPE_RADIO) {
-      continue;
-    }
-
-    BorrowedAttrInfo info2(menuitem->GetAttrInfo(kNameSpaceID_None,
-                                           nsGkAtoms::radiogroup));
-    bool info2Empty = !info2.mValue || info2.mValue->IsEmptyString();
-
-    if (info1Empty != info2Empty ||
-        (info1.mValue && info2.mValue && !info1.mValue->Equals(*info2.mValue))) {
-      continue;
-    }
-
-    if (!aVisitor->Visit(menuitem)) {
-      break;
-    }
-  }
-}
-
-HTMLMenuItemElement*
-HTMLMenuItemElement::GetSelectedRadio()
-{
-  HTMLMenuItemElement* result = nullptr;
-
-  GetCheckedVisitor visitor(&result);
-  WalkRadioGroup(&visitor);
-
-  return result;
-}
-
-void
-HTMLMenuItemElement::AddedToRadioGroup()
-{
-  bool checkedDirty = mCheckedDirty;
-  if (mChecked) {
-    ClearCheckedVisitor visitor1(this);
-    GetCheckedDirtyVisitor visitor2(&checkedDirty, this);
-    CombinedVisitor visitor(&visitor1, &visitor2);
-    WalkRadioGroup(&visitor);
-  } else {
-    GetCheckedDirtyVisitor visitor(&checkedDirty, this);
-    WalkRadioGroup(&visitor);
-  }
-  mCheckedDirty = checkedDirty;
-}
-
-void
-HTMLMenuItemElement::InitChecked()
-{
-  bool defaultChecked;
-  GetDefaultChecked(&defaultChecked);
-  mChecked = defaultChecked;
-  if (mType == CMD_TYPE_RADIO) {
-    ClearCheckedVisitor visitor(this);
-    WalkRadioGroup(&visitor);
-  }
-}
-
-JSObject*
-HTMLMenuItemElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return HTMLMenuItemElementBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} // namespace mozilla
-
-#undef NS_ORIGINAL_CHECKED_VALUE
deleted file mode 100644
--- a/dom/html/HTMLMenuItemElement.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_HTMLMenuItemElement_h
-#define mozilla_dom_HTMLMenuItemElement_h
-
-#include "mozilla/Attributes.h"
-#include "nsIDOMHTMLMenuItemElement.h"
-#include "nsGenericHTMLElement.h"
-
-namespace mozilla {
-
-class EventChainPreVisitor;
-
-namespace dom {
-
-class Visitor;
-
-class HTMLMenuItemElement final : public nsGenericHTMLElement,
-                                  public nsIDOMHTMLMenuItemElement
-{
-public:
-  using mozilla::dom::Element::GetText;
-
-  HTMLMenuItemElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
-                      mozilla::dom::FromParser aFromParser);
-
-  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuItemElement, menuitem)
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMHTMLMenuItemElement
-  NS_DECL_NSIDOMHTMLMENUITEMELEMENT
-
-  virtual nsresult GetEventTargetParent(
-                     EventChainPreVisitor& aVisitor) override;
-  virtual nsresult PostHandleEvent(
-                     EventChainPostVisitor& aVisitor) override;
-
-  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                              nsIContent* aBindingParent,
-                              bool aCompileEventHandlers) override;
-
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult) override;
-
-  virtual void DoneCreatingElement() override;
-
-  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
-                         bool aPreallocateChildren) const override;
-
-  uint8_t GetType() const { return mType; }
-
-  /**
-   * Syntax sugar to make it easier to check for checked and checked dirty
-   */
-  bool IsChecked() const { return mChecked; }
-  bool IsCheckedDirty() const { return mCheckedDirty; }
-
-  void GetText(nsAString& aText);
-
-  // WebIDL
-
-  // The XPCOM GetType is OK for us
-  void SetType(const nsAString& aType, ErrorResult& aError)
-  {
-    SetHTMLAttr(nsGkAtoms::type, aType, aError);
-  }
-
-  // The XPCOM GetLabel is OK for us
-  void SetLabel(const nsAString& aLabel, ErrorResult& aError)
-  {
-    SetAttrHelper(nsGkAtoms::label, aLabel);
-  }
-
-  // The XPCOM GetIcon is OK for us
-  void SetIcon(const nsAString& aIcon, ErrorResult& aError)
-  {
-    SetAttrHelper(nsGkAtoms::icon, aIcon);
-  }
-
-  bool Disabled() const
-  {
-    return GetBoolAttr(nsGkAtoms::disabled);
-  }
-  void SetDisabled(bool aDisabled, ErrorResult& aError)
-  {
-    SetHTMLBoolAttr(nsGkAtoms::disabled, aDisabled, aError);
-  }
-
-  bool Checked() const
-  {
-    return mChecked;
-  }
-  void SetChecked(bool aChecked, ErrorResult& aError)
-  {
-    aError = SetChecked(aChecked);
-  }
-
-  // The XPCOM GetRadiogroup is OK for us
-  void SetRadiogroup(const nsAString& aRadiogroup, ErrorResult& aError)
-  {
-    SetHTMLAttr(nsGkAtoms::radiogroup, aRadiogroup, aError);
-  }
-
-  bool DefaultChecked() const
-  {
-    return GetBoolAttr(nsGkAtoms::checked);
-  }
-  void SetDefaultChecked(bool aDefault, ErrorResult& aError)
-  {
-    SetHTMLBoolAttr(nsGkAtoms::checked, aDefault, aError);
-  }
-
-protected:
-  virtual ~HTMLMenuItemElement();
-
-  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-
-protected:
-  virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
-                                const nsAttrValue* aValue,
-                                const nsAttrValue* aOldValue,
-                                bool aNotify) override;
-
-  void WalkRadioGroup(Visitor* aVisitor);
-
-  HTMLMenuItemElement* GetSelectedRadio();
-
-  void AddedToRadioGroup();
-
-  void InitChecked();
-
-  friend class ClearCheckedVisitor;
-  friend class SetCheckedDirtyVisitor;
-
-  void ClearChecked() { mChecked = false; }
-  void SetCheckedDirty() { mCheckedDirty = true; }
-
-private:
-  uint8_t mType : 2;
-  bool mParserCreating : 1;
-  bool mShouldInitChecked : 1;
-  bool mCheckedDirty : 1;
-  bool mChecked : 1;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_HTMLMenuItemElement_h
--- a/dom/html/moz.build
+++ b/dom/html/moz.build
@@ -73,17 +73,16 @@ EXPORTS.mozilla.dom += [
     'HTMLInputElement.h',
     'HTMLLabelElement.h',
     'HTMLLegendElement.h',
     'HTMLLIElement.h',
     'HTMLLinkElement.h',
     'HTMLMapElement.h',
     'HTMLMediaElement.h',
     'HTMLMenuElement.h',
-    'HTMLMenuItemElement.h',
     'HTMLMetaElement.h',
     'HTMLMeterElement.h',
     'HTMLModElement.h',
     'HTMLObjectElement.h',
     'HTMLOptGroupElement.h',
     'HTMLOptionElement.h',
     'HTMLOptionsCollection.h',
     'HTMLOutputElement.h',
@@ -153,17 +152,16 @@ UNIFIED_SOURCES += [
     'HTMLInputElement.cpp',
     'HTMLLabelElement.cpp',
     'HTMLLegendElement.cpp',
     'HTMLLIElement.cpp',
     'HTMLLinkElement.cpp',
     'HTMLMapElement.cpp',
     'HTMLMediaElement.cpp',
     'HTMLMenuElement.cpp',
-    'HTMLMenuItemElement.cpp',
     'HTMLMetaElement.cpp',
     'HTMLMeterElement.cpp',
     'HTMLModElement.cpp',
     'HTMLObjectElement.cpp',
     'HTMLOptGroupElement.cpp',
     'HTMLOptionElement.cpp',
     'HTMLOptionsCollection.cpp',
     'HTMLOutputElement.cpp',
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -1547,17 +1547,16 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(IFrame)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Image)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Input)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(LI)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Label)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Legend)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Link)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Map)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Menu)
-NS_DECLARE_NS_NEW_HTML_ELEMENT(MenuItem)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Meta)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Meter)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Object)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(OptGroup)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Option)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Output)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Paragraph)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Picture)
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -347,17 +347,16 @@ skip-if = toolkit == 'android' #TIMED_OU
 skip-if = toolkit == 'android' # form control not selected/checked with synthesizeMouse
 [test_bug613113.html]
 [test_bug613019.html]
 [test_bug613722.html]
 [test_bug613979.html]
 [test_bug615595.html]
 [test_bug615833.html]
 skip-if = toolkit == 'android' || os == 'mac' #TIMED_OUT # form control not selected/checked with synthesizeMouse, osx(bug 1275664)
-[test_bug617528.html]
 [test_bug618948.html]
 [test_bug619278.html]
 [test_bug622558.html]
 [test_bug622597.html]
 [test_bug623291.html]
 [test_bug6296.html]
 [test_bug629801.html]
 [test_bug633058.html]
@@ -384,17 +383,16 @@ support-files =
 [test_bug660959-1.html]
 [test_bug660959-2.html]
 [test_bug660959-3.html]
 [test_bug666200.html]
 [test_bug666666.html]
 [test_bug669012.html]
 [test_bug674558.html]
 [test_bug674927.html]
-[test_bug677463.html]
 [test_bug677658.html]
 [test_bug682886.html]
 [test_bug691.html]
 [test_bug694.html]
 [test_bug694503.html]
 [test_bug696.html]
 [test_bug717819.html]
 [test_bug742030.html]
deleted file mode 100644
--- a/dom/html/test/test_bug617528.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=617528
--->
-<head>
-  <title>Test for Bug 617528</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=617528">Mozilla Bug 617528</a>
-<p id="display"></p>
-<div id="content">
-  <menu>
-    <menuitem id="checkbox" type="checkbox" label="Checkbox" checked></menuitem>
-    <menuitem id="radio1" type="radio" label="Radio1" checked></menuitem>
-    <menuitem id="radio2" type="radio" label="Radio2"></menuitem>
-  </menu>
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 617528 **/
-
-SimpleTest.waitForExplicitFinish();
-addLoadEvent(function() {
-  function click(element, preventDefault, checked) {
-    function handleClick(event) {
-      is(this.checked, checked,
-         "checking .checked (" + this.id + ")");
-      if (preventDefault)
-        event.preventDefault();
-    }
-    element.addEventListener("click", handleClick);
-    element.click();
-    element.removeEventListener("click", handleClick);
-  }
-
-  function verify(elements, data) {
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      is(element.checked, data[i*2],
-         "checking .checked (" + element.id + ")");
-      is(element.defaultChecked, data[i*2+1],
-         'checking .defaultChecked (' + element.id + ")");
-    }
-  }
-
-  var checkbox = document.getElementById("checkbox");
-  click(checkbox, false, false);
-  verify([checkbox], [false, true]);
-
-  click(checkbox, true, true);
-  verify([checkbox], [false, true]);
-
-  var radio1 = document.getElementById("radio1");
-  var radio2 = document.getElementById("radio2");
-  click(radio2, false, true);
-  verify([radio1, radio2], [false, true,
-                            true, false]);
-
-  click(radio1, true, true);
-  verify([radio1, radio2], [false, true,
-                            true, false]);
-
-  SimpleTest.finish();
-});
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/html/test/test_bug677463.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=677463
--->
-<head>
-  <title>Test for Bug 677463</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=677463">Mozilla Bug 677463</a>
-<p id="display"></p>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 677463 **/
-
-var o = document.createElement("option");
-var m = document.createElement("menuitem");
-is(o.label, m.label, "Should have same labels");
-o.textContent = "   ";
-is(o.label, m.label, "Should have same labels");
-m.textContent = " ";
-is(o.label, m.label, "Should have same labels");
-o.textContent = " foo";
-isnot(o.label, m.label, "Shouldn't have same labels");
-m.textContent = "foo ";
-is(o.label, m.label, "Should have same labels");
-m.label = "bar";
-isnot(o.label, m.label, "Shouldn't have same labels");
-o.label = "bar";
-is(o.label, m.label, "Should have same labels");
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/html/test/test_checked.html
+++ b/dom/html/test/test_checked.html
@@ -28,17 +28,17 @@ and
 <pre id="test">
 <script class="testbody" type="text/javascript; version=1.7">
 
 /** Test for Bug 418756 and 617528 **/
 var group1;
 var group2;
 var group3;
 
-var tags = ["input", "menuitem"];
+var tags = ["input"];
 for (let tag of tags) {
 
 function bounce(node) {
   let n = node.nextSibling;
   let p = node.parentNode;
   p.removeChild(node);
   p.insertBefore(node, n);
 }
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -31,17 +31,16 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLImageElement.idl',
     'nsIDOMHTMLInputElement.idl',
     'nsIDOMHTMLLabelElement.idl',
     'nsIDOMHTMLLIElement.idl',
     'nsIDOMHTMLLinkElement.idl',
     'nsIDOMHTMLMapElement.idl',
     'nsIDOMHTMLMediaElement.idl',
     'nsIDOMHTMLMenuElement.idl',
-    'nsIDOMHTMLMenuItemElement.idl',
     'nsIDOMHTMLMetaElement.idl',
     'nsIDOMHTMLObjectElement.idl',
     'nsIDOMHTMLOListElement.idl',
     'nsIDOMHTMLOptGroupElement.idl',
     'nsIDOMHTMLOptionElement.idl',
     'nsIDOMHTMLOptionsCollection.idl',
     'nsIDOMHTMLParagraphElement.idl',
     'nsIDOMHTMLPictureElement.idl',
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMHTMLMenuItemElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIDOMHTMLElement.idl"
-
-/**
- * The nsIDOMHTMLMenuItemElement interface is the interface to a HTML
- * <menuitem> element.
- */
-
-[uuid(979d6e44-5930-4232-b405-873939655c19)]
-interface nsIDOMHTMLMenuItemElement : nsISupports
-{
-           attribute DOMString        type;
-           attribute DOMString        label;
-           attribute DOMString        icon;
-           attribute boolean          disabled;
-
-           // This should be 'default' but in the IDL implementation
-           // this has been renamed 'defaultChecked'.
-           attribute boolean defaultChecked;
-
-           attribute boolean          checked;
-           attribute DOMString        radiogroup;
-
-           // Currently not implemented.
-  // readonly attribute HTMLElement? command;
-};
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -469,18 +469,16 @@ var interfaceNamesInGlobalScope =
     "HTMLLinkElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLMapElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLMediaElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLMenuElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    "HTMLMenuItemElement",
-// IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLMetaElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLMeterElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLModElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLObjectElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js
+++ b/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js
@@ -67,17 +67,16 @@
   ['li', 'LI'],
   ['link', 'Link'],
   ['listing', 'Pre'],
   ['main', ''],
   ['map', 'Map'],
   ['mark', ''],
   ['marquee', 'Div'],
   ['menu', 'Menu'],
-  ['menuitem', 'MenuItem'],
   ['meta', 'Meta'],
   ['meter', 'Meter'],
   ['nav', ''],
   ['nobr', ''],
   ['noembed', ''],
   ['noframes', ''],
   ['noscript', ''],
   ['object', 'Object'],
deleted file mode 100644
--- a/dom/webidl/HTMLMenuItemElement.webidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element
- *
- * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
- * Opera Software ASA. You are granted a license to use, reproduce
- * and create derivative works of this document.
- */
-
-// http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element
-[HTMLConstructor]
-interface HTMLMenuItemElement : HTMLElement {
-           [CEReactions, SetterThrows]
-           attribute DOMString type;
-           [CEReactions, SetterThrows]
-           attribute DOMString label;
-           [CEReactions, SetterThrows]
-           attribute DOMString icon;
-           [CEReactions, SetterThrows]
-           attribute boolean disabled;
-           [CEReactions, SetterThrows]
-           attribute boolean checked;
-           [CEReactions, SetterThrows]
-           attribute DOMString radiogroup;
-
-           // This should be 'default' but in the IDL implementation
-           // this has been renamed 'defaultChecked'.
-           [CEReactions, SetterThrows]
-           attribute boolean defaultChecked;
-
-           // Currently not implemented.
-//  readonly attribute HTMLElement? command;
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -589,17 +589,16 @@ WEBIDL_FILES = [
     'HTMLInputElement.webidl',
     'HTMLLabelElement.webidl',
     'HTMLLegendElement.webidl',
     'HTMLLIElement.webidl',
     'HTMLLinkElement.webidl',
     'HTMLMapElement.webidl',
     'HTMLMediaElement.webidl',
     'HTMLMenuElement.webidl',
-    'HTMLMenuItemElement.webidl',
     'HTMLMetaElement.webidl',
     'HTMLMeterElement.webidl',
     'HTMLModElement.webidl',
     'HTMLObjectElement.webidl',
     'HTMLOListElement.webidl',
     'HTMLOptGroupElement.webidl',
     'HTMLOptionElement.webidl',
     'HTMLOptionsCollection.webidl',
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -673,18 +673,17 @@ static const ElementInfo kElements[eHTML
   ELEM(legend, true, true, GROUP_NONE, GROUP_INLINE_ELEMENT),
   ELEM(li, true, false, GROUP_LI, GROUP_FLOW_ELEMENT),
   ELEM(link, false, false, GROUP_HEAD_CONTENT, GROUP_NONE),
   ELEM(listing, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(main, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(map, true, true, GROUP_SPECIAL, GROUP_BLOCK | GROUP_MAP_CONTENT),
   ELEM(mark, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(marquee, false, false, GROUP_NONE, GROUP_NONE),
-  ELEM(menu, true, true, GROUP_BLOCK, GROUP_LI | GROUP_FLOW_ELEMENT),
-  ELEM(menuitem, false, false, GROUP_NONE, GROUP_NONE),
+  ELEM(menu, true, true, GROUP_BLOCK, GROUP_LI),
   ELEM(meta, false, false, GROUP_HEAD_CONTENT, GROUP_NONE),
   ELEM(meter, true, false, GROUP_SPECIAL, GROUP_FLOW_ELEMENT),
   ELEM(multicol, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(nav, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(nobr, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(noembed, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(noframes, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(noscript, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
--- a/parser/htmlparser/nsElementTable.cpp
+++ b/parser/htmlparser/nsElementTable.cpp
@@ -323,20 +323,16 @@ const nsHTMLElement gHTMLElements[] = {
     /*tag*/         eHTMLTag_marquee,
     /*parent,leaf*/ kSpecial, false
   },
   {
     /*tag*/         eHTMLTag_menu,
     /*parent,leaf*/ kList, false
   },
   {
-    /*tag*/         eHTMLTag_menuitem,
-    /*parent,leaf*/ kFlowEntity, false
-  },
-  {
     /*tag*/         eHTMLTag_meta,
     /*parent,leaf*/ kHeadContent, true
   },
   {
     /*tag*/         eHTMLTag_meter,
     /*parent,leaf*/ kFormControl, false
   },
   {
--- a/parser/htmlparser/nsHTMLTagList.h
+++ b/parser/htmlparser/nsHTMLTagList.h
@@ -112,17 +112,16 @@ HTML_TAG(legend, Legend, Legend)
 HTML_TAG(li, LI, LI)
 HTML_TAG(link, Link, Link)
 HTML_TAG(listing, Pre, Pre)
 HTML_HTMLELEMENT_TAG(main)
 HTML_TAG(map, Map, Map)
 HTML_HTMLELEMENT_TAG(mark)
 HTML_TAG(marquee, Div, Div)
 HTML_TAG(menu, Menu, Menu)
-HTML_TAG(menuitem, MenuItem, MenuItem)
 HTML_TAG(meta, Meta, Meta)
 HTML_TAG(meter, Meter, Meter)
 HTML_TAG(multicol, Unknown, Unknown)
 HTML_HTMLELEMENT_TAG(nav)
 HTML_HTMLELEMENT_TAG(nobr)
 HTML_HTMLELEMENT_TAG(noembed)
 HTML_HTMLELEMENT_TAG(noframes)
 HTML_HTMLELEMENT_TAG(noscript)
--- a/testing/web-platform/meta/html/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/html/dom/interfaces.html.ini
@@ -1205,22 +1205,16 @@
     expected: FAIL
 
   [HTMLKeygenElement interface: calling setCustomValidity(DOMString) on document.createElement("keygen") with too few arguments must throw TypeError]
     expected: FAIL
 
   [HTMLKeygenElement interface: document.createElement("keygen") must inherit property "labels" with the proper type (13)]
     expected: FAIL
 
-  [HTMLMenuItemElement interface: attribute default]
-    expected: FAIL
-
-  [HTMLMenuItemElement interface: attribute command]
-    expected: FAIL
-
   [RelatedEvent interface: existence and properties of interface object]
     expected: FAIL
 
   [RelatedEvent interface object length]
     expected: FAIL
 
   [RelatedEvent interface: existence and properties of interface prototype object]
     expected: FAIL
--- a/testing/web-platform/meta/html/semantics/interactive-elements/contextmenu-historical.html.ini
+++ b/testing/web-platform/meta/html/semantics/interactive-elements/contextmenu-historical.html.ini
@@ -1,12 +1,12 @@
 [contextmenu-historical.html]
   type: testharness
   [HTMLMenuItemElement must not be not present]
-    expected: FAIL
+    expected: PASS
 
   [onshow must not be present on the GlobalEventHandlers locations]
     expected: PASS
 
   [el.contextMenu must not be present]
     expected: PASS
 
   [menu.type must not exist or reflect the content attribute]
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -69,17 +69,16 @@
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLLIElement.h"
 #include "nsIDOMHTMLLabelElement.h"
 #include "nsIDOMHTMLLinkElement.h"
 #include "nsIDOMHTMLMapElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMHTMLMenuElement.h"
-#include "nsIDOMHTMLMenuItemElement.h"
 #include "nsIDOMHTMLMetaElement.h"
 #include "nsIDOMHTMLOListElement.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLOptGroupElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMHTMLOptionsCollection.h"
 #include "nsIDOMHTMLParagraphElement.h"
 #include "nsIDOMHTMLPreElement.h"
@@ -197,17 +196,16 @@
 #include "mozilla/dom/HTMLImageElementBinding.h"
 #include "mozilla/dom/HTMLInputElementBinding.h"
 #include "mozilla/dom/HTMLLIElementBinding.h"
 #include "mozilla/dom/HTMLLabelElementBinding.h"
 #include "mozilla/dom/HTMLLinkElementBinding.h"
 #include "mozilla/dom/HTMLMapElementBinding.h"
 #include "mozilla/dom/HTMLMediaElementBinding.h"
 #include "mozilla/dom/HTMLMenuElementBinding.h"
-#include "mozilla/dom/HTMLMenuItemElementBinding.h"
 #include "mozilla/dom/HTMLMetaElementBinding.h"
 #include "mozilla/dom/HTMLOListElementBinding.h"
 #include "mozilla/dom/HTMLObjectElementBinding.h"
 #include "mozilla/dom/HTMLOptGroupElementBinding.h"
 #include "mozilla/dom/HTMLOptionElementBinding.h"
 #include "mozilla/dom/HTMLOptionsCollectionBinding.h"
 #include "mozilla/dom/HTMLParagraphElementBinding.h"
 #include "mozilla/dom/HTMLPreElementBinding.h"
@@ -384,17 +382,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLImageElement),
   DEFINE_SHIM(HTMLInputElement),
   DEFINE_SHIM(HTMLLIElement),
   DEFINE_SHIM(HTMLLabelElement),
   DEFINE_SHIM(HTMLLinkElement),
   DEFINE_SHIM(HTMLMapElement),
   DEFINE_SHIM(HTMLMediaElement),
   DEFINE_SHIM(HTMLMenuElement),
-  DEFINE_SHIM(HTMLMenuItemElement),
   DEFINE_SHIM(HTMLMetaElement),
   DEFINE_SHIM(HTMLOListElement),
   DEFINE_SHIM(HTMLObjectElement),
   DEFINE_SHIM(HTMLOptGroupElement),
   DEFINE_SHIM(HTMLOptionElement),
   DEFINE_SHIM(HTMLOptionsCollection),
   DEFINE_SHIM(HTMLParagraphElement),
   DEFINE_SHIM(HTMLPreElement),