Skip to content

Commit

Permalink
Implement name and value attributes of HTMLButtonElement (fixes #6003)
Browse files Browse the repository at this point in the history
Implemented getter and setter of the attributes.
  • Loading branch information
Jinwoo-Song committed May 12, 2015
1 parent c76d73d commit 94c3077
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 274 deletions.
12 changes: 12 additions & 0 deletions components/script/dom/htmlbuttonelement.rs
Expand Up @@ -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> {
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/webidls/HTMLButtonElement.webidl
Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions tests/wpt/metadata/html/dom/interfaces.html.ini
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
258 changes: 0 additions & 258 deletions tests/wpt/metadata/html/dom/reflection-forms.html.ini
Expand Up @@ -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

Expand Down

0 comments on commit 94c3077

Please sign in to comment.