Bug 1338166 - Remove "list" from <menu>.type's known values. r=qdot

Also set <menu>.type's default value as "toolbar" and
remove HTMLButtonElement.menu per HTML spec.

MozReview-Commit-ID: jE6TmmvWa5
This commit is contained in:
btian
2017-05-25 10:11:07 +08:00
parent cc5436a07c
commit dabab7e973
3 changed files with 5 additions and 306 deletions

View File

@@ -25,19 +25,17 @@ namespace dom {
enum MenuType : uint8_t
{
MENU_TYPE_CONTEXT = 1,
MENU_TYPE_TOOLBAR,
MENU_TYPE_LIST
MENU_TYPE_TOOLBAR
};
static const nsAttrValue::EnumTable kMenuTypeTable[] = {
{ "context", MENU_TYPE_CONTEXT },
{ "toolbar", MENU_TYPE_TOOLBAR },
{ "list", MENU_TYPE_LIST },
{ nullptr, 0 }
};
static const nsAttrValue::EnumTable* kMenuDefaultType =
&kMenuTypeTable[2];
&kMenuTypeTable[1];
enum SeparatorType
{
@@ -49,7 +47,7 @@ enum SeparatorType
HTMLMenuElement::HTMLMenuElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST)
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_TOOLBAR)
{
}
@@ -84,7 +82,7 @@ HTMLMenuElement::SendShowEvent()
if (!shell) {
return;
}
RefPtr<nsPresContext> presContext = shell->GetPresContext();
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
@@ -244,7 +242,7 @@ HTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
if (aSeparator) {
return;
}
aBuilder->AddSeparator();
aSeparator = ST_TRUE;
}