diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs
index 075df00bf91..7023a8ffdfe 100644
--- a/components/script/dom/htmlbuttonelement.rs
+++ b/components/script/dom/htmlbuttonelement.rs
@@ -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> {
+ self.form_owner()
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-button-type
fn Type(&self) -> DOMString {
let elem = ElementCast::from_ref(self);
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 0de98f19d49..33098d17730 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -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> {
+ self.form_owner()
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-input-defaultchecked
make_bool_getter!(DefaultChecked, "checked");
diff --git a/components/script/dom/webidls/HTMLButtonElement.webidl b/components/script/dom/webidls/HTMLButtonElement.webidl
index 7613bd56687..73eec85a198 100644
--- a/components/script/dom/webidls/HTMLButtonElement.webidl
+++ b/components/script/dom/webidls/HTMLButtonElement.webidl
@@ -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;
diff --git a/components/script/dom/webidls/HTMLInputElement.webidl b/components/script/dom/webidls/HTMLInputElement.webidl
index afd605bf6d5..60c45c4191e 100644
--- a/components/script/dom/webidls/HTMLInputElement.webidl
+++ b/components/script/dom/webidls/HTMLInputElement.webidl
@@ -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;
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index 29648c39c4b..f4b6a1162fc 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -5079,9 +5079,6 @@
[HTMLInputElement interface: attribute dirName]
expected: FAIL
- [HTMLInputElement interface: attribute form]
- expected: FAIL
-
[HTMLInputElement interface: attribute files]
expected: FAIL
@@ -5208,9 +5205,6 @@
[HTMLInputElement interface: document.createElement("input") must inherit property "dirName" with the proper type (6)]
expected: FAIL
- [HTMLInputElement interface: document.createElement("input") must inherit property "form" with the proper type (8)]
- expected: FAIL
-
[HTMLInputElement interface: document.createElement("input") must inherit property "files" with the proper type (9)]
expected: FAIL
@@ -5346,9 +5340,6 @@
[HTMLButtonElement interface: attribute autofocus]
expected: FAIL
- [HTMLButtonElement interface: attribute form]
- expected: FAIL
-
[HTMLButtonElement interface: attribute formNoValidate]
expected: FAIL
@@ -5376,9 +5367,6 @@
[HTMLButtonElement interface: document.createElement("button") must inherit property "autofocus" with the proper type (0)]
expected: FAIL
- [HTMLButtonElement interface: document.createElement("button") must inherit property "form" with the proper type (2)]
- expected: FAIL
-
[HTMLButtonElement interface: document.createElement("button") must inherit property "formNoValidate" with the proper type (6)]
expected: FAIL
diff --git a/tests/wpt/metadata/html/semantics/forms/form-control-infrastructure/form.html.ini b/tests/wpt/metadata/html/semantics/forms/form-control-infrastructure/form.html.ini
index 4ba65533c66..3a4b9321f4c 100644
--- a/tests/wpt/metadata/html/semantics/forms/form-control-infrastructure/form.html.ini
+++ b/tests/wpt/metadata/html/semantics/forms/form-control-infrastructure/form.html.ini
@@ -1,14 +1,8 @@
[form.html]
type: testharness
- [button.form]
- expected: FAIL
-
[fieldset.form]
expected: FAIL
- [input.form]
- expected: FAIL
-
[keygen.form]
expected: FAIL