Skip to content

Commit

Permalink
Issue #10491 add HTMLInputElement attributes that reflect content ide…
Browse files Browse the repository at this point in the history
…ntically

it uses a new version of string-cache servo/string-cache#148
  • Loading branch information
amarant committed Apr 11, 2016
1 parent bc2237e commit 9b8f183
Show file tree
Hide file tree
Showing 24 changed files with 371 additions and 1,633 deletions.
2 changes: 1 addition & 1 deletion components/gfx/Cargo.toml
Expand Up @@ -27,7 +27,7 @@ serde = "0.7"
serde_macros = "0.7"
servo-skia = "0.20130412.0"
smallvec = "0.1"
string_cache = {version = "0.2.11", features = ["heap_size"]}
string_cache = {version = "0.2.12", features = ["heap_size"]}
time = "0.1.12"
unicode-script = { version = "0.1", features = ["harfbuzz"] }
url = {version = "0.5.7", features = ["heap_size"]}
Expand Down
2 changes: 1 addition & 1 deletion components/layout/Cargo.toml
Expand Up @@ -76,7 +76,7 @@ serde = "0.7"
serde_json = "0.7"
serde_macros = "0.7"
smallvec = "0.1"
string_cache = {version = "0.2.11", features = ["heap_size"]}
string_cache = {version = "0.2.12", features = ["heap_size"]}
time = "0.1"
unicode-bidi = "0.2"
unicode-script = { version = "0.1", features = ["harfbuzz"] }
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -91,7 +91,7 @@ rustc-serialize = "0.3"
selectors = {version = "0.5", features = ["heap_size"]}
serde = "0.7"
smallvec = "0.1"
string_cache = {version = "0.2.11", features = ["heap_size", "unstable"]}
string_cache = {version = "0.2.12", features = ["heap_size", "unstable"]}
time = "0.1.12"
unicase = "1.0"
url = {version = "0.5.7", features = ["heap_size"]}
Expand Down
61 changes: 61 additions & 0 deletions components/script/dom/htmlinputelement.rs
Expand Up @@ -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");

Expand Down Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions components/script/dom/webidls/HTMLInputElement.webidl
Expand Up @@ -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;
Expand All @@ -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]
Expand Down
34 changes: 17 additions & 17 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/style/Cargo.toml
Expand Up @@ -40,7 +40,7 @@ selectors = {version = "0.5", features = ["heap_size", "unstable"]}
serde = {version = "0.7", features = ["nightly"]}
serde_macros = "0.7"
smallvec = "0.1"
string_cache = {version = "0.2.11", features = ["heap_size"]}
string_cache = {version = "0.2.12", features = ["heap_size"]}
time = "0.1"
url = {version = "0.5.7", features = ["heap_size"]}

2 changes: 1 addition & 1 deletion components/util/Cargo.toml
Expand Up @@ -44,7 +44,7 @@ rustc-serialize = "0.3"
serde = "0.7"
serde_macros = "0.7"
smallvec = "0.1"
string_cache = {version = "0.2.11", features = ["heap_size"]}
string_cache = {version = "0.2.12", features = ["heap_size"]}
url = {version = "0.5.7", features = ["heap_size", "serde_serialization"]}

[target.x86_64-pc-windows-gnu.dependencies]
Expand Down
32 changes: 16 additions & 16 deletions ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b8f183

Please sign in to comment.