Implement name and value attributes of HTMLButtonElement (fixes #6003)

Implemented getter and setter of the attributes.
This commit is contained in:
Jinwoo Song 2015-05-11 17:47:44 +09:00
parent c76d73d124
commit 94c3077edc
4 changed files with 16 additions and 274 deletions

View file

@ -108,6 +108,18 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
make_getter!(FormTarget);
make_setter!(SetFormTarget, "formtarget");
// https://html.spec.whatwg.org/multipage/#dom-fe-name
make_getter!(Name);
// https://html.spec.whatwg.org/multipage/#dom-fe-name
make_setter!(SetName, "name");
// https://html.spec.whatwg.org/multipage/#dom-button-value
make_getter!(Value);
// https://html.spec.whatwg.org/multipage/#dom-button-value
make_setter!(SetValue, "value");
}
impl<'a> VirtualMethods for JSRef<'a, HTMLButtonElement> {

View file

@ -6,16 +6,16 @@
// https://www.whatwg.org/html/#htmlbuttonelement
interface HTMLButtonElement : HTMLElement {
// attribute boolean autofocus;
attribute boolean disabled;
attribute boolean disabled;
//readonly attribute HTMLFormElement? form;
attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
// attribute boolean formNoValidate;
attribute DOMString formTarget;
// attribute DOMString name;
attribute DOMString type;
// attribute DOMString value;
attribute DOMString name;
attribute DOMString type;
attribute DOMString value;
// attribute HTMLMenuElement? menu;
//readonly attribute boolean willValidate;

View file

@ -5739,12 +5739,6 @@
[HTMLButtonElement interface: attribute formNoValidate]
expected: FAIL
[HTMLButtonElement interface: attribute name]
expected: FAIL
[HTMLButtonElement interface: attribute value]
expected: FAIL
[HTMLButtonElement interface: attribute menu]
expected: FAIL
@ -5775,12 +5769,6 @@
[HTMLButtonElement interface: document.createElement("button") must inherit property "formNoValidate" with the proper type (6)]
expected: FAIL
[HTMLButtonElement interface: document.createElement("button") must inherit property "name" with the proper type (8)]
expected: FAIL
[HTMLButtonElement interface: document.createElement("button") must inherit property "value" with the proper type (10)]
expected: FAIL
[HTMLButtonElement interface: document.createElement("button") must inherit property "menu" with the proper type (11)]
expected: FAIL

View file

@ -7278,264 +7278,6 @@
[button.formNoValidate: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[button.name: typeof IDL attribute]
expected: FAIL
[button.name: IDL get with DOM attribute unset]
expected: FAIL
[button.name: setAttribute() to "" followed by IDL get]
expected: FAIL
[button.name: 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
[button.name: setAttribute() to undefined followed by IDL get]
expected: FAIL
[button.name: setAttribute() to 7 followed by IDL get]
expected: FAIL
[button.name: setAttribute() to 1.5 followed by IDL get]
expected: FAIL
[button.name: setAttribute() to true followed by IDL get]
expected: FAIL
[button.name: setAttribute() to false followed by IDL get]
expected: FAIL
[button.name: setAttribute() to object "[object Object\]" followed by IDL get]
expected: FAIL
[button.name: setAttribute() to NaN followed by IDL get]
expected: FAIL
[button.name: setAttribute() to Infinity followed by IDL get]
expected: FAIL
[button.name: setAttribute() to -Infinity followed by IDL get]
expected: FAIL
[button.name: setAttribute() to "\\0" followed by IDL get]
expected: FAIL
[button.name: setAttribute() to null followed by IDL get]
expected: FAIL
[button.name: setAttribute() to object "test-toString" followed by IDL get]
expected: FAIL
[button.name: setAttribute() to object "test-valueOf" followed by IDL get]
expected: FAIL
[button.name: IDL set to "" followed by getAttribute()]
expected: FAIL
[button.name: 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 getAttribute()]
expected: FAIL
[button.name: IDL set to undefined followed by getAttribute()]
expected: FAIL
[button.name: IDL set to undefined followed by IDL get]
expected: FAIL
[button.name: IDL set to 7 followed by getAttribute()]
expected: FAIL
[button.name: IDL set to 7 followed by IDL get]
expected: FAIL
[button.name: IDL set to 1.5 followed by getAttribute()]
expected: FAIL
[button.name: IDL set to 1.5 followed by IDL get]
expected: FAIL
[button.name: IDL set to true followed by getAttribute()]
expected: FAIL
[button.name: IDL set to true followed by IDL get]
expected: FAIL
[button.name: IDL set to false followed by getAttribute()]
expected: FAIL
[button.name: IDL set to false followed by IDL get]
expected: FAIL
[button.name: IDL set to object "[object Object\]" followed by getAttribute()]
expected: FAIL
[button.name: IDL set to object "[object Object\]" followed by IDL get]
expected: FAIL
[button.name: IDL set to NaN followed by getAttribute()]
expected: FAIL
[button.name: IDL set to NaN followed by IDL get]
expected: FAIL
[button.name: IDL set to Infinity followed by getAttribute()]
expected: FAIL
[button.name: IDL set to Infinity followed by IDL get]
expected: FAIL
[button.name: IDL set to -Infinity followed by getAttribute()]
expected: FAIL
[button.name: IDL set to -Infinity followed by IDL get]
expected: FAIL
[button.name: IDL set to "\\0" followed by getAttribute()]
expected: FAIL
[button.name: IDL set to null followed by getAttribute()]
expected: FAIL
[button.name: IDL set to null followed by IDL get]
expected: FAIL
[button.name: IDL set to object "test-toString" followed by getAttribute()]
expected: FAIL
[button.name: IDL set to object "test-toString" followed by IDL get]
expected: FAIL
[button.name: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[button.value: typeof IDL attribute]
expected: FAIL
[button.value: IDL get with DOM attribute unset]
expected: FAIL
[button.value: setAttribute() to "" followed by IDL get]
expected: FAIL
[button.value: 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
[button.value: setAttribute() to undefined followed by IDL get]
expected: FAIL
[button.value: setAttribute() to 7 followed by IDL get]
expected: FAIL
[button.value: setAttribute() to 1.5 followed by IDL get]
expected: FAIL
[button.value: setAttribute() to true followed by IDL get]
expected: FAIL
[button.value: setAttribute() to false followed by IDL get]
expected: FAIL
[button.value: setAttribute() to object "[object Object\]" followed by IDL get]
expected: FAIL
[button.value: setAttribute() to NaN followed by IDL get]
expected: FAIL
[button.value: setAttribute() to Infinity followed by IDL get]
expected: FAIL
[button.value: setAttribute() to -Infinity followed by IDL get]
expected: FAIL
[button.value: setAttribute() to "\\0" followed by IDL get]
expected: FAIL
[button.value: setAttribute() to null followed by IDL get]
expected: FAIL
[button.value: setAttribute() to object "test-toString" followed by IDL get]
expected: FAIL
[button.value: setAttribute() to object "test-valueOf" followed by IDL get]
expected: FAIL
[button.value: IDL set to "" followed by getAttribute()]
expected: FAIL
[button.value: 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 getAttribute()]
expected: FAIL
[button.value: IDL set to undefined followed by getAttribute()]
expected: FAIL
[button.value: IDL set to undefined followed by IDL get]
expected: FAIL
[button.value: IDL set to 7 followed by getAttribute()]
expected: FAIL
[button.value: IDL set to 7 followed by IDL get]
expected: FAIL
[button.value: IDL set to 1.5 followed by getAttribute()]
expected: FAIL
[button.value: IDL set to 1.5 followed by IDL get]
expected: FAIL
[button.value: IDL set to true followed by getAttribute()]
expected: FAIL
[button.value: IDL set to true followed by IDL get]
expected: FAIL
[button.value: IDL set to false followed by getAttribute()]
expected: FAIL
[button.value: IDL set to false followed by IDL get]
expected: FAIL
[button.value: IDL set to object "[object Object\]" followed by getAttribute()]
expected: FAIL
[button.value: IDL set to object "[object Object\]" followed by IDL get]
expected: FAIL
[button.value: IDL set to NaN followed by getAttribute()]
expected: FAIL
[button.value: IDL set to NaN followed by IDL get]
expected: FAIL
[button.value: IDL set to Infinity followed by getAttribute()]
expected: FAIL
[button.value: IDL set to Infinity followed by IDL get]
expected: FAIL
[button.value: IDL set to -Infinity followed by getAttribute()]
expected: FAIL
[button.value: IDL set to -Infinity followed by IDL get]
expected: FAIL
[button.value: IDL set to "\\0" followed by getAttribute()]
expected: FAIL
[button.value: IDL set to null followed by getAttribute()]
expected: FAIL
[button.value: IDL set to null followed by IDL get]
expected: FAIL
[button.value: IDL set to object "test-toString" followed by getAttribute()]
expected: FAIL
[button.value: IDL set to object "test-toString" followed by IDL get]
expected: FAIL
[button.value: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[button.itemScope: typeof IDL attribute]
expected: FAIL