Make get_nodes_under_mouse return Vec.

This commit is contained in:
Ms2ger 2014-04-26 12:25:50 +02:00
parent 558986c87e
commit 20f649da71
3 changed files with 4 additions and 4 deletions

View file

@ -830,7 +830,7 @@ impl LayoutTask {
fn mouse_over_test(x: Au,
y: Au,
list: &[DisplayItem],
result: &mut ~[UntrustedNodeAddress]) {
result: &mut Vec<UntrustedNodeAddress>) {
for item in list.rev_iter() {
match *item {
ClipDisplayItemClass(ref cc) => {
@ -856,7 +856,7 @@ impl LayoutTask {
}
}
let mut mouse_over_list:~[UntrustedNodeAddress] = ~[];
let mut mouse_over_list: Vec<UntrustedNodeAddress> = vec!();
let (x, y) = (Au::from_frac_px(point.x as f64),
Au::from_frac_px(point.y as f64));
match self.display_list {

View file

@ -85,7 +85,7 @@ pub type UntrustedNodeAddress = *c_void;
pub struct ContentBoxResponse(pub Rect<Au>);
pub struct ContentBoxesResponse(pub ~[Rect<Au>]);
pub struct HitTestResponse(pub UntrustedNodeAddress);
pub struct MouseOverResponse(pub ~[UntrustedNodeAddress]);
pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>);
/// Determines which part of the
#[deriving(Eq, Ord, TotalEq, TotalOrd, Encodable)]

View file

@ -459,7 +459,7 @@ impl Page {
address
}
pub fn get_nodes_under_mouse(&self, point: &Point2D<f32>) -> Option<~[UntrustedNodeAddress]> {
pub fn get_nodes_under_mouse(&self, point: &Point2D<f32>) -> Option<Vec<UntrustedNodeAddress>> {
let frame = self.frame();
let document = frame.get_ref().document.clone();
let root = document.get().GetDocumentElement();