mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #5951 - SimonSapin:au-cleanup, r=mbrubeck
Fix #5943. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5951) <!-- Reviewable:end -->
This commit is contained in:
commit
1721cf45ed
27 changed files with 190 additions and 248 deletions
|
@ -135,8 +135,8 @@ impl<'a> Activatable for JSRef<'a, HTMLAnchorElement> {
|
|||
let target_node = NodeCast::to_ref(target).unwrap();
|
||||
let rect = window_from_node(target_node).root().r().content_box_query(target_node.to_trusted_node_address());
|
||||
ismap_suffix = Some(
|
||||
format!("?{},{}", mouse_event.ClientX().to_f32().unwrap() - rect.origin.x.to_frac32_px(),
|
||||
mouse_event.ClientY().to_f32().unwrap() - rect.origin.y.to_frac32_px())
|
||||
format!("?{},{}", mouse_event.ClientX().to_f32().unwrap() - rect.origin.x.to_f32_px(),
|
||||
mouse_event.ClientY().to_f32().unwrap() - rect.origin.y.to_f32_px())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
|
|||
use dom::node::{document_from_node, Node, NodeTypeId, NodeHelpers, NodeDamage, window_from_node};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use dom::window::WindowHelpers;
|
||||
use util::geometry::to_px;
|
||||
use util::str::DOMString;
|
||||
use string_cache::Atom;
|
||||
|
||||
|
@ -188,7 +187,7 @@ impl<'a> HTMLImageElementMethods for JSRef<'a, HTMLImageElement> {
|
|||
fn Width(self) -> u32 {
|
||||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
let rect = node.get_bounding_content_box();
|
||||
to_px(rect.size.width) as u32
|
||||
rect.size.width.to_px() as u32
|
||||
}
|
||||
|
||||
fn SetWidth(self, width: u32) {
|
||||
|
@ -199,7 +198,7 @@ impl<'a> HTMLImageElementMethods for JSRef<'a, HTMLImageElement> {
|
|||
fn Height(self) -> u32 {
|
||||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
let rect = node.get_bounding_content_box();
|
||||
to_px(rect.size.height) as u32
|
||||
rect.size.height.to_px() as u32
|
||||
}
|
||||
|
||||
fn SetHeight(self, height: u32) {
|
||||
|
|
|
@ -917,10 +917,10 @@ impl Window {
|
|||
}
|
||||
|
||||
fn should_move_clip_rect(clip_rect: Rect<Au>, new_viewport: Rect<f32>) -> bool{
|
||||
let clip_rect = Rect(Point2D(geometry::to_frac_px(clip_rect.origin.x) as f32,
|
||||
geometry::to_frac_px(clip_rect.origin.y) as f32),
|
||||
Size2D(geometry::to_frac_px(clip_rect.size.width) as f32,
|
||||
geometry::to_frac_px(clip_rect.size.height) as f32));
|
||||
let clip_rect = Rect(Point2D(clip_rect.origin.x.to_f32_px(),
|
||||
clip_rect.origin.y.to_f32_px()),
|
||||
Size2D(clip_rect.size.width.to_f32_px(),
|
||||
clip_rect.size.height.to_f32_px()));
|
||||
|
||||
// We only need to move the clip rect if the viewport is getting near the edge of
|
||||
// our preexisting clip rect. We use half of the size of the viewport as a heuristic
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue