diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-06 08:57:19 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-06 08:57:19 +0530 |
commit | 64e968d8bc88f646ebe9ae148c883d1b036f73d1 (patch) | |
tree | db9150c03fc7759ff28372beb2b42924eb54a5f7 /components/script/dom | |
parent | 25c2b7dec6cd8415f018893c06888abaacc7da17 (diff) | |
parent | 74905f0f3cd152cc6217b50b84be3b8f1f4c030a (diff) | |
download | servo-64e968d8bc88f646ebe9ae148c883d1b036f73d1.tar.gz servo-64e968d8bc88f646ebe9ae148c883d1b036f73d1.zip |
Auto merge of #9119 - TheKK:input_element_size, r=eefriedman
Parse size attribute of HTMLInputElemnt correctly
Should fix #8773
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9119)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/element.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 360623f3df9..3fed8b02819 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -358,16 +358,21 @@ impl LayoutElementHelpers for LayoutJS<Element> { let size = if let Some(this) = self.downcast::<HTMLInputElement>() { // FIXME(pcwalton): More use of atoms, please! - // FIXME(Ms2ger): this is nonsense! Invalid values also end up as - // a text field match (*self.unsafe_get()).get_attr_val_for_layout(&ns!(), &atom!("type")) { - Some("text") | Some("password") => { + // Not text entry widget + Some("hidden") | Some("date") | Some("month") | Some("week") | + Some("time") | Some("datetime-local") | Some("number") | Some("range") | + Some("color") | Some("checkbox") | Some("radio") | Some("file") | + Some("submit") | Some("image") | Some("reset") | Some("button") => { + None + }, + // Others + _ => { match this.get_size_for_layout() { 0 => None, s => Some(s as i32), } - } - _ => None, + }, } } else { None |