mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add form getter for input/button elements; update test expectations
This commit is contained in:
parent
ed30923156
commit
b677f0f4ae
6 changed files with 13 additions and 21 deletions
|
@ -15,7 +15,7 @@ use dom::event::Event;
|
|||
use dom::eventtarget::{EventTarget, EventTargetTypeId};
|
||||
use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
|
||||
use dom::htmlformelement::{FormControl, FormSubmitter};
|
||||
use dom::htmlformelement::{SubmittedFrom};
|
||||
use dom::htmlformelement::{SubmittedFrom, HTMLFormElement};
|
||||
use dom::node::{Node, NodeTypeId, document_from_node, window_from_node};
|
||||
use dom::validitystate::ValidityState;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
|
@ -82,6 +82,11 @@ impl HTMLButtonElementMethods for HTMLButtonElement {
|
|||
// https://www.whatwg.org/html/#dom-fe-disabled
|
||||
make_bool_setter!(SetDisabled, "disabled");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage#dom-fae-form
|
||||
fn GetForm(&self) -> Option<Root<HTMLFormElement>> {
|
||||
self.form_owner()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-button-type
|
||||
fn Type(&self) -> DOMString {
|
||||
let elem = ElementCast::from_ref(self);
|
||||
|
|
|
@ -229,6 +229,11 @@ impl HTMLInputElementMethods for HTMLInputElement {
|
|||
// https://www.whatwg.org/html/#dom-fe-disabled
|
||||
make_bool_setter!(SetDisabled, "disabled");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-fae-form
|
||||
fn GetForm(&self) -> Option<Root<HTMLFormElement>> {
|
||||
self.form_owner()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-input-defaultchecked
|
||||
make_bool_getter!(DefaultChecked, "checked");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
interface HTMLButtonElement : HTMLElement {
|
||||
// attribute boolean autofocus;
|
||||
attribute boolean disabled;
|
||||
//readonly attribute HTMLFormElement? form;
|
||||
readonly attribute HTMLFormElement? form;
|
||||
attribute DOMString formAction;
|
||||
attribute DOMString formEnctype;
|
||||
attribute DOMString formMethod;
|
||||
|
|
|
@ -13,7 +13,7 @@ interface HTMLInputElement : HTMLElement {
|
|||
attribute boolean checked;
|
||||
// attribute DOMString dirName;
|
||||
attribute boolean disabled;
|
||||
//readonly attribute HTMLFormElement? form;
|
||||
readonly attribute HTMLFormElement? form;
|
||||
//readonly attribute FileList? files;
|
||||
attribute DOMString formAction;
|
||||
attribute DOMString formEnctype;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue