From 6ca867236ba72f2f0dd969e0a6ed4055376d5c88 Mon Sep 17 00:00:00 2001 From: btian Date: Thu, 25 May 2017 10:11:07 +0800 Subject: [PATCH] Bug 1338166 - Remove "list" from .type's known values. r=qdot Also set .type's default value as "toolbar" and remove HTMLButtonElement.menu per HTML spec. MozReview-Commit-ID: jE6TmmvWa5 --HG-- extra : rebase_source : f0ded9a69055777b9430aeb91b53fef1a43af8e0 --- dom/html/HTMLMenuElement.cpp | 12 +- dom/webidl/HTMLButtonElement.webidl | 2 - .../meta/html/dom/reflection-misc.html.ini | 297 ------------------ 3 files changed, 5 insertions(+), 306 deletions(-) diff --git a/dom/html/HTMLMenuElement.cpp b/dom/html/HTMLMenuElement.cpp index 7944e6a9c42c..14a662df2447 100644 --- a/dom/html/HTMLMenuElement.cpp +++ b/dom/html/HTMLMenuElement.cpp @@ -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& aNodeInfo) - : nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST) + : nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_TOOLBAR) { } @@ -84,7 +82,7 @@ HTMLMenuElement::SendShowEvent() if (!shell) { return; } - + RefPtr presContext = shell->GetPresContext(); nsEventStatus status = nsEventStatus_eIgnore; EventDispatcher::Dispatch(static_cast(this), presContext, @@ -244,7 +242,7 @@ HTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator) if (aSeparator) { return; } - + aBuilder->AddSeparator(); aSeparator = ST_TRUE; } diff --git a/dom/webidl/HTMLButtonElement.webidl b/dom/webidl/HTMLButtonElement.webidl index de0b154563dc..4b540dc0887c 100644 --- a/dom/webidl/HTMLButtonElement.webidl +++ b/dom/webidl/HTMLButtonElement.webidl @@ -35,8 +35,6 @@ interface HTMLButtonElement : HTMLElement { attribute DOMString type; [SetterThrows, Pure] attribute DOMString value; -// Not yet implemented: -// attribute HTMLMenuElement? menu; readonly attribute boolean willValidate; readonly attribute ValidityState validity; diff --git a/testing/web-platform/meta/html/dom/reflection-misc.html.ini b/testing/web-platform/meta/html/dom/reflection-misc.html.ini index 1c1d9458eefd..fab67021a1c5 100644 --- a/testing/web-platform/meta/html/dom/reflection-misc.html.ini +++ b/testing/web-platform/meta/html/dom/reflection-misc.html.ini @@ -49,147 +49,6 @@ [menu.tabIndex: setAttribute() to object "3" followed by IDL get] expected: FAIL - [menu.type: IDL get with DOM attribute unset] - expected: FAIL - - [menu.type: setAttribute() to "" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to undefined followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to 7 followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to 1.5 followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to true followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to false followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to object "[object Object\]" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to NaN followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to Infinity followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to -Infinity followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "\\0" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to null followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to object "test-toString" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to object "test-valueOf" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "popup" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "xpopup" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "popup\\0" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "opup" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "POPUP" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "xtoolbar" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "toolbar\\0" followed by IDL get] - expected: FAIL - - [menu.type: setAttribute() to "oolbar" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get] - expected: FAIL - - [menu.type: IDL set to undefined followed by IDL get] - expected: FAIL - - [menu.type: IDL set to 7 followed by IDL get] - expected: FAIL - - [menu.type: IDL set to 1.5 followed by IDL get] - expected: FAIL - - [menu.type: IDL set to true followed by IDL get] - expected: FAIL - - [menu.type: IDL set to false followed by IDL get] - expected: FAIL - - [menu.type: IDL set to object "[object Object\]" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to NaN followed by IDL get] - expected: FAIL - - [menu.type: IDL set to Infinity followed by IDL get] - expected: FAIL - - [menu.type: IDL set to -Infinity followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "\\0" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to null followed by IDL get] - expected: FAIL - - [menu.type: IDL set to object "test-toString" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to object "test-valueOf" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "popup" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "xpopup" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "popup\\0" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "opup" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "POPUP" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "xtoolbar" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "toolbar\\0" followed by IDL get] - expected: FAIL - - [menu.type: IDL set to "oolbar" followed by IDL get] - expected: FAIL - [menuitem.tabIndex: setAttribute() to object "3" followed by getAttribute()] expected: FAIL @@ -484,144 +343,6 @@ [undefinedelement.tabIndex: setAttribute() to object "3" followed by IDL get] expected: FAIL - [menu.type: setAttribute() to ""] - expected: FAIL - - [menu.type: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "] - expected: FAIL - - [menu.type: setAttribute() to undefined] - expected: FAIL - - [menu.type: setAttribute() to 7] - expected: FAIL - - [menu.type: setAttribute() to 1.5] - expected: FAIL - - [menu.type: setAttribute() to true] - expected: FAIL - - [menu.type: setAttribute() to false] - expected: FAIL - - [menu.type: setAttribute() to object "[object Object\]"] - expected: FAIL - - [menu.type: setAttribute() to NaN] - expected: FAIL - - [menu.type: setAttribute() to Infinity] - expected: FAIL - - [menu.type: setAttribute() to -Infinity] - expected: FAIL - - [menu.type: setAttribute() to "\\0"] - expected: FAIL - - [menu.type: setAttribute() to null] - expected: FAIL - - [menu.type: setAttribute() to object "test-toString"] - expected: FAIL - - [menu.type: setAttribute() to object "test-valueOf"] - expected: FAIL - - [menu.type: setAttribute() to "popup"] - expected: FAIL - - [menu.type: setAttribute() to "xpopup"] - expected: FAIL - - [menu.type: setAttribute() to "popup\\0"] - expected: FAIL - - [menu.type: setAttribute() to "opup"] - expected: FAIL - - [menu.type: setAttribute() to "POPUP"] - expected: FAIL - - [menu.type: setAttribute() to "xtoolbar"] - expected: FAIL - - [menu.type: setAttribute() to "toolbar\\0"] - expected: FAIL - - [menu.type: setAttribute() to "oolbar"] - expected: FAIL - - [menu.type: IDL set to ""] - expected: FAIL - - [menu.type: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "] - expected: FAIL - - [menu.type: IDL set to undefined] - expected: FAIL - - [menu.type: IDL set to 7] - expected: FAIL - - [menu.type: IDL set to 1.5] - expected: FAIL - - [menu.type: IDL set to true] - expected: FAIL - - [menu.type: IDL set to false] - expected: FAIL - - [menu.type: IDL set to object "[object Object\]"] - expected: FAIL - - [menu.type: IDL set to NaN] - expected: FAIL - - [menu.type: IDL set to Infinity] - expected: FAIL - - [menu.type: IDL set to -Infinity] - expected: FAIL - - [menu.type: IDL set to "\\0"] - expected: FAIL - - [menu.type: IDL set to null] - expected: FAIL - - [menu.type: IDL set to object "test-toString"] - expected: FAIL - - [menu.type: IDL set to object "test-valueOf"] - expected: FAIL - - [menu.type: IDL set to "popup"] - expected: FAIL - - [menu.type: IDL set to "xpopup"] - expected: FAIL - - [menu.type: IDL set to "popup\\0"] - expected: FAIL - - [menu.type: IDL set to "opup"] - expected: FAIL - - [menu.type: IDL set to "POPUP"] - expected: FAIL - - [menu.type: IDL set to "xtoolbar"] - expected: FAIL - - [menu.type: IDL set to "toolbar\\0"] - expected: FAIL - - [menu.type: IDL set to "oolbar"] - expected: FAIL - [menuitem.type: setAttribute() to ""] expected: FAIL @@ -1075,21 +796,3 @@ [script.noModule: IDL set to object "test-valueOf"] expected: FAIL - [menu.type: setAttribute() to "xcontext"] - expected: FAIL - - [menu.type: setAttribute() to "context\\0"] - expected: FAIL - - [menu.type: setAttribute() to "ontext"] - expected: FAIL - - [menu.type: IDL set to "xcontext"] - expected: FAIL - - [menu.type: IDL set to "context\\0"] - expected: FAIL - - [menu.type: IDL set to "ontext"] - expected: FAIL -