add Form related attribute to HTMLButtonElement

add formAction, formEnctype, formMethod, formTarget
This commit is contained in:
yodalee 2015-01-28 03:34:55 +08:00
parent a026ccd4bb
commit 15231db7d3
2 changed files with 21 additions and 4 deletions

View file

@ -88,6 +88,23 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
// https://html.spec.whatwg.org/multipage/forms.html#dom-button-type // https://html.spec.whatwg.org/multipage/forms.html#dom-button-type
make_setter!(SetType, "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> { impl<'a> VirtualMethods for JSRef<'a, HTMLButtonElement> {

View file

@ -8,11 +8,11 @@ interface HTMLButtonElement : HTMLElement {
// attribute boolean autofocus; // attribute boolean autofocus;
attribute boolean disabled; attribute boolean disabled;
//readonly attribute HTMLFormElement? form; //readonly attribute HTMLFormElement? form;
// attribute DOMString formAction; attribute DOMString formAction;
// attribute DOMString formEnctype; attribute DOMString formEnctype;
// attribute DOMString formMethod; attribute DOMString formMethod;
// attribute boolean formNoValidate; // attribute boolean formNoValidate;
// attribute DOMString formTarget; attribute DOMString formTarget;
// attribute DOMString name; // attribute DOMString name;
attribute DOMString type; attribute DOMString type;
// attribute DOMString value; // attribute DOMString value;