Skip to content

Commit

Permalink
add Form related attribute to HTMLButtonElement
Browse files Browse the repository at this point in the history
add formAction, formEnctype, formMethod, formTarget
  • Loading branch information
yodalee committed Feb 3, 2015
1 parent a026ccd commit 15231db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions components/script/dom/htmlbuttonelement.rs
Expand Up @@ -88,6 +88,23 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {

// https://html.spec.whatwg.org/multipage/forms.html#dom-button-type
make_setter!(SetType, "type");

// https://html.spec.whatwg.org/multipage/forms.html#htmlbuttonelement
make_url_or_base_getter!(FormAction);

make_setter!(SetFormAction, "formaction");

make_enumerated_getter!(FormEnctype, "application/x-www-form-urlencoded", ("text/plain") | ("multipart/form-data"));

make_setter!(SetFormEnctype, "formenctype");

make_enumerated_getter!(FormMethod, "get", ("post") | ("dialog"));

make_setter!(SetFormMethod, "formmethod");

make_getter!(FormTarget);

make_setter!(SetFormTarget, "formtarget");
}

impl<'a> VirtualMethods for JSRef<'a, HTMLButtonElement> {
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/webidls/HTMLButtonElement.webidl
Expand Up @@ -8,11 +8,11 @@ interface HTMLButtonElement : HTMLElement {
// attribute boolean autofocus;
attribute boolean disabled;
//readonly attribute HTMLFormElement? form;
// attribute DOMString formAction;
// attribute DOMString formEnctype;
// attribute DOMString formMethod;
attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
// attribute boolean formNoValidate;
// attribute DOMString formTarget;
attribute DOMString formTarget;
// attribute DOMString name;
attribute DOMString type;
// attribute DOMString value;
Expand Down

0 comments on commit 15231db

Please sign in to comment.