mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
fix unit of clientrect &
add width,height test in src/test/html/content/test_getBoundingClientRect.html
This commit is contained in:
parent
2b487ed3e9
commit
e0a04fff46
3 changed files with 24 additions and 18 deletions
|
@ -415,10 +415,10 @@ impl Element {
|
|||
do rects.map |r| {
|
||||
ClientRect::new(
|
||||
win,
|
||||
r.origin.y.to_f32().unwrap(),
|
||||
(r.origin.y + r.size.height).to_f32().unwrap(),
|
||||
r.origin.x.to_f32().unwrap(),
|
||||
(r.origin.x + r.size.width).to_f32().unwrap())
|
||||
r.origin.y,
|
||||
r.origin.y + r.size.height,
|
||||
r.origin.x,
|
||||
r.origin.x + r.size.width)
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -435,10 +435,10 @@ impl Element {
|
|||
ContentBoxResponse(rect) => {
|
||||
ClientRect::new(
|
||||
win,
|
||||
rect.origin.y.to_f32().unwrap(),
|
||||
(rect.origin.y + rect.size.height).to_f32().unwrap(),
|
||||
rect.origin.x.to_f32().unwrap(),
|
||||
(rect.origin.x + rect.size.width).to_f32().unwrap())
|
||||
rect.origin.y,
|
||||
rect.origin.y + rect.size.height,
|
||||
rect.origin.x,
|
||||
rect.origin.x + rect.size.width)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue