Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements basic form resetting #4133

Merged
merged 12 commits into from Dec 16, 2014

Implements HTMLInputElement.defaultValue

...and changes SetValue to update the input text instead of the content
attr.

Also includes a comment summarizing everything I currently know with
respect to an input elements checkedness vs its IDL attributes vs its
content attributes.
  • Loading branch information
mttr committed Dec 16, 2014
commit f932a6947a0c5df0ab82bbeebf0a289ab2fc1ae8
@@ -223,7 +223,16 @@ impl<'a> HTMLInputElementMethods for JSRef<'a, HTMLInputElement> {
}

// https://html.spec.whatwg.org/multipage/forms.html#dom-input-value
make_setter!(SetValue, "value")
fn SetValue(self, value: DOMString) {
self.textinput.borrow_mut().set_content(value);
self.force_relayout();
}

// https://html.spec.whatwg.org/multipage/forms.html#dom-input-defaultvalue
make_getter!(DefaultValue, "value")

// https://html.spec.whatwg.org/multipage/forms.html#dom-input-defaultvalue
make_setter!(SetDefaultValue, "value")

// https://html.spec.whatwg.org/multipage/forms.html#attr-fe-name
make_getter!(Name)
@@ -38,7 +38,7 @@ interface HTMLInputElement : HTMLElement {
// attribute DOMString src;
// attribute DOMString step;
attribute DOMString type;
// attribute DOMString defaultValue;
attribute DOMString defaultValue;
[TreatNullAs=EmptyString] attribute DOMString value;
// attribute Date? valueAsDate;
// attribute unrestricted double valueAsNumber;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.