mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
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.
This commit is contained in:
parent
f686943eb4
commit
f932a6947a
2 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue