diff options
author | Matthew Rasmus <mattr@zzntd.com> | 2014-11-27 15:22:02 -0800 |
---|---|---|
committer | Matthew Rasmus <mattr@zzntd.com> | 2014-12-16 11:06:56 -0800 |
commit | f932a6947a0c5df0ab82bbeebf0a289ab2fc1ae8 (patch) | |
tree | 0a5d5210ae6ec31bf874584f826c57c8c92f3d85 /components/script/dom | |
parent | f686943eb40aa25e0a06837eeae6a907d9617d2b (diff) | |
download | servo-f932a6947a0c5df0ab82bbeebf0a289ab2fc1ae8.tar.gz servo-f932a6947a0c5df0ab82bbeebf0a289ab2fc1ae8.zip |
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.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 11 | ||||
-rw-r--r-- | components/script/dom/webidls/HTMLInputElement.webidl | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 5b0133395a7..12d6e11a639 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -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) diff --git a/components/script/dom/webidls/HTMLInputElement.webidl b/components/script/dom/webidls/HTMLInputElement.webidl index 434da309f21..532ac73e25a 100644 --- a/components/script/dom/webidls/HTMLInputElement.webidl +++ b/components/script/dom/webidls/HTMLInputElement.webidl @@ -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; |