mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Cleanup convert_length in ImageFragmentInfo.
This commit is contained in:
parent
37b5e78a2c
commit
d418c0da3a
1 changed files with 3 additions and 4 deletions
|
@ -311,10 +311,9 @@ impl ImageFragmentInfo {
|
|||
-> ImageFragmentInfo {
|
||||
fn convert_length(node: &ThreadSafeLayoutNode, name: &Atom) -> Option<Au> {
|
||||
let element = node.as_element();
|
||||
element.get_attr(&ns!(""), name).and_then(|string| {
|
||||
let n: Option<int> = FromStr::from_str(string).ok();
|
||||
n
|
||||
}).and_then(|pixels| Some(Au::from_px(pixels)))
|
||||
element.get_attr(&ns!(""), name)
|
||||
.and_then(|string| string.parse::<isize>().ok())
|
||||
.map(|pixels| Au::from_px(pixels))
|
||||
}
|
||||
|
||||
ImageFragmentInfo {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue