mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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 -->
This commit is contained in:
commit
64e968d8bc
4 changed files with 5058 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue