diff options
author | Arnaud Marant <arnaudmarant@gmail.com> | 2016-04-09 22:09:47 +0200 |
---|---|---|
committer | Arnaud Marant <arnaudmarant@gmail.com> | 2016-04-12 00:15:57 +0200 |
commit | 9b8f183cba3b01ca66a86de968330fd7df768322 (patch) | |
tree | 608fa2923894465c82df9d7bfbad68a3597eaefd /components/script/dom | |
parent | bc2237ea2ba3beac501ca4347b8118f3dccd9629 (diff) | |
download | servo-9b8f183cba3b01ca66a86de968330fd7df768322.tar.gz servo-9b8f183cba3b01ca66a86de968330fd7df768322.zip |
Issue #10491 add HTMLInputElement attributes that reflect content identically
it uses a new version of string-cache https://github.com/servo/string-cache/pull/148
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 61 | ||||
-rw-r--r-- | components/script/dom/webidls/HTMLInputElement.webidl | 20 |
2 files changed, 71 insertions, 10 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 174a312448f..328616a93d5 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -305,6 +305,25 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { } impl HTMLInputElementMethods for HTMLInputElement { + + // https://html.spec.whatwg.org/multipage/#attr-input-accept + make_getter!(Accept, "accept"); + + // https://html.spec.whatwg.org/multipage/#attr-input-accept + make_setter!(SetAccept, "accept"); + + // https://html.spec.whatwg.org/multipage/#attr-input-alt + make_getter!(Alt, "alt"); + + // https://html.spec.whatwg.org/multipage/#attr-input-alt + make_setter!(SetAlt, "alt"); + + // https://html.spec.whatwg.org/multipage/#attr-input-dirName + make_getter!(DirName, "dirname"); + + // https://html.spec.whatwg.org/multipage/#attr-input-dirName + make_setter!(SetDirName, "dirname"); + // https://html.spec.whatwg.org/multipage/#dom-fe-disabled make_bool_getter!(Disabled, "disabled"); @@ -458,12 +477,54 @@ impl HTMLInputElementMethods for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#attr-fs-formnovalidate make_bool_setter!(SetFormNoValidate, "formnovalidate"); + // https://html.spec.whatwg.org/multipage/#attr-input-max + make_getter!(Max, "max"); + + // https://html.spec.whatwg.org/multipage/#attr-input-max + make_setter!(SetMax, "max"); + // https://html.spec.whatwg.org/multipage/#dom-input-maxlength make_int_getter!(MaxLength, "maxlength", DEFAULT_MAX_LENGTH); // https://html.spec.whatwg.org/multipage/#dom-input-maxlength make_limited_int_setter!(SetMaxLength, "maxlength", DEFAULT_MAX_LENGTH); + // https://html.spec.whatwg.org/multipage/#attr-input-min + make_getter!(Min, "min"); + + // https://html.spec.whatwg.org/multipage/#attr-input-min + make_setter!(SetMin, "min"); + + // https://html.spec.whatwg.org/multipage/#attr-input-multiple + make_bool_getter!(Multiple, "multiple"); + + // https://html.spec.whatwg.org/multipage/#attr-input-multiple + make_bool_setter!(SetMultiple, "multiple"); + + // https://html.spec.whatwg.org/multipage/#attr-input-pattern + make_getter!(Pattern, "pattern"); + + // https://html.spec.whatwg.org/multipage/#attr-input-pattern + make_setter!(SetPattern, "pattern"); + + // https://html.spec.whatwg.org/multipage/#attr-input-required + make_bool_getter!(Required, "required"); + + // https://html.spec.whatwg.org/multipage/#attr-input-required + make_bool_setter!(SetRequired, "required"); + + // https://html.spec.whatwg.org/multipage/#attr-input-src + make_getter!(Src, "src"); + + // https://html.spec.whatwg.org/multipage/#attr-input-src + make_setter!(SetSrc, "src"); + + // https://html.spec.whatwg.org/multipage/#attr-input-step + make_getter!(Step, "step"); + + // https://html.spec.whatwg.org/multipage/#attr-input-step + make_setter!(SetStep, "step"); + // https://html.spec.whatwg.org/multipage/#dom-input-indeterminate fn Indeterminate(&self) -> bool { self.upcast::<Element>().state().contains(IN_INDETERMINATE_STATE) diff --git a/components/script/dom/webidls/HTMLInputElement.webidl b/components/script/dom/webidls/HTMLInputElement.webidl index 2e1c6215f2b..66907c5cd23 100644 --- a/components/script/dom/webidls/HTMLInputElement.webidl +++ b/components/script/dom/webidls/HTMLInputElement.webidl @@ -5,13 +5,13 @@ // https://html.spec.whatwg.org/multipage/#htmlinputelement interface HTMLInputElement : HTMLElement { - // attribute DOMString accept; - // attribute DOMString alt; + attribute DOMString accept; + attribute DOMString alt; // attribute DOMString autocomplete; // attribute boolean autofocus; attribute boolean defaultChecked; attribute boolean checked; - // attribute DOMString dirName; + attribute DOMString dirName; attribute boolean disabled; readonly attribute HTMLFormElement? form; //readonly attribute FileList? files; @@ -24,21 +24,21 @@ interface HTMLInputElement : HTMLElement { attribute boolean indeterminate; // attribute DOMString inputMode; //readonly attribute HTMLElement? list; - // attribute DOMString max; + attribute DOMString max; [SetterThrows] attribute long maxLength; - // attribute DOMString min; + attribute DOMString min; // attribute long minLength; - // attribute boolean multiple; + attribute boolean multiple; attribute DOMString name; - // attribute DOMString pattern; + attribute DOMString pattern; attribute DOMString placeholder; attribute boolean readOnly; - // attribute boolean required; + attribute boolean required; [SetterThrows] attribute unsigned long size; - // attribute DOMString src; - // attribute DOMString step; + attribute DOMString src; + attribute DOMString step; attribute DOMString type; attribute DOMString defaultValue; [TreatNullAs=EmptyString, SetterThrows] |