mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Make get_nodes_under_mouse return Vec.
This commit is contained in:
parent
558986c87e
commit
20f649da71
3 changed files with 4 additions and 4 deletions
|
@ -830,7 +830,7 @@ impl LayoutTask {
|
||||||
fn mouse_over_test(x: Au,
|
fn mouse_over_test(x: Au,
|
||||||
y: Au,
|
y: Au,
|
||||||
list: &[DisplayItem],
|
list: &[DisplayItem],
|
||||||
result: &mut ~[UntrustedNodeAddress]) {
|
result: &mut Vec<UntrustedNodeAddress>) {
|
||||||
for item in list.rev_iter() {
|
for item in list.rev_iter() {
|
||||||
match *item {
|
match *item {
|
||||||
ClipDisplayItemClass(ref cc) => {
|
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),
|
let (x, y) = (Au::from_frac_px(point.x as f64),
|
||||||
Au::from_frac_px(point.y as f64));
|
Au::from_frac_px(point.y as f64));
|
||||||
match self.display_list {
|
match self.display_list {
|
||||||
|
|
|
@ -85,7 +85,7 @@ pub type UntrustedNodeAddress = *c_void;
|
||||||
pub struct ContentBoxResponse(pub Rect<Au>);
|
pub struct ContentBoxResponse(pub Rect<Au>);
|
||||||
pub struct ContentBoxesResponse(pub ~[Rect<Au>]);
|
pub struct ContentBoxesResponse(pub ~[Rect<Au>]);
|
||||||
pub struct HitTestResponse(pub UntrustedNodeAddress);
|
pub struct HitTestResponse(pub UntrustedNodeAddress);
|
||||||
pub struct MouseOverResponse(pub ~[UntrustedNodeAddress]);
|
pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>);
|
||||||
|
|
||||||
/// Determines which part of the
|
/// Determines which part of the
|
||||||
#[deriving(Eq, Ord, TotalEq, TotalOrd, Encodable)]
|
#[deriving(Eq, Ord, TotalEq, TotalOrd, Encodable)]
|
||||||
|
|
|
@ -459,7 +459,7 @@ impl Page {
|
||||||
address
|
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 frame = self.frame();
|
||||||
let document = frame.get_ref().document.clone();
|
let document = frame.get_ref().document.clone();
|
||||||
let root = document.get().GetDocumentElement();
|
let root = document.get().GetDocumentElement();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue