mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
merge from master
This commit is contained in:
commit
6e774ea6eb
1044 changed files with 46059 additions and 1506 deletions
|
@ -415,7 +415,7 @@ pub struct ScriptTask {
|
|||
mouse_over_targets: DOMRefCell<Vec<JS<Element>>>,
|
||||
|
||||
/// List of pipelines that have been owned and closed by this script task.
|
||||
closed_pipelines: RefCell<HashSet<PipelineId>>,
|
||||
closed_pipelines: DOMRefCell<HashSet<PipelineId>>,
|
||||
|
||||
scheduler_chan: Sender<TimerEventRequest>,
|
||||
timer_event_chan: Sender<TimerEvent>,
|
||||
|
@ -644,7 +644,7 @@ impl ScriptTask {
|
|||
|
||||
js_runtime: Rc::new(runtime),
|
||||
mouse_over_targets: DOMRefCell::new(vec!()),
|
||||
closed_pipelines: RefCell::new(HashSet::new()),
|
||||
closed_pipelines: DOMRefCell::new(HashSet::new()),
|
||||
|
||||
scheduler_chan: state.scheduler_chan,
|
||||
timer_event_chan: timer_event_chan,
|
||||
|
@ -1657,28 +1657,34 @@ impl ScriptTask {
|
|||
}
|
||||
|
||||
fn notify_devtools(&self, title: DOMString, url: Url, ids: (PipelineId, Option<WorkerId>)) {
|
||||
match self.devtools_chan {
|
||||
None => {}
|
||||
Some(ref chan) => {
|
||||
let page_info = DevtoolsPageInfo {
|
||||
title: title,
|
||||
url: url,
|
||||
};
|
||||
chan.send(ScriptToDevtoolsControlMsg::NewGlobal(
|
||||
ids,
|
||||
self.devtools_sender.clone(),
|
||||
page_info)).unwrap();
|
||||
}
|
||||
if let Some(ref chan) = self.devtools_chan {
|
||||
let page_info = DevtoolsPageInfo {
|
||||
title: title,
|
||||
url: url,
|
||||
};
|
||||
chan.send(ScriptToDevtoolsControlMsg::NewGlobal(
|
||||
ids,
|
||||
self.devtools_sender.clone(),
|
||||
page_info)).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn scroll_fragment_point(&self, pipeline_id: PipelineId, element: &Element) {
|
||||
let rect = element.upcast::<Node>().get_bounding_content_box();
|
||||
let point = Point2D::new(rect.origin.x.to_f32_px(), rect.origin.y.to_f32_px());
|
||||
// FIXME(#2003, pcwalton): This is pretty bogus when multiple layers are involved.
|
||||
// FIXME(#8275, pcwalton): This is pretty bogus when multiple layers are involved.
|
||||
// Really what needs to happen is that this needs to go through layout to ask which
|
||||
// layer the element belongs to, and have it send the scroll message to the
|
||||
// compositor.
|
||||
let rect = element.upcast::<Node>().get_bounding_content_box();
|
||||
|
||||
// In order to align with element edges, we snap to unscaled pixel boundaries, since the
|
||||
// paint task currently does the same for drawing elements. This is important for pages
|
||||
// that require pixel perfect scroll positioning for proper display (like Acid2). Since we
|
||||
// don't have the device pixel ratio here, this might not be accurate, but should work as
|
||||
// long as the ratio is a whole number. Once #8275 is fixed this should actually take into
|
||||
// account the real device pixel ratio.
|
||||
let point = Point2D::new(rect.origin.x.to_nearest_px() as f32,
|
||||
rect.origin.y.to_nearest_px() as f32);
|
||||
|
||||
self.compositor.borrow_mut().send(ScriptToCompositorMsg::ScrollFragmentPoint(
|
||||
pipeline_id, LayerId::null(), point, false)).unwrap();
|
||||
}
|
||||
|
@ -1742,9 +1748,8 @@ impl ScriptTask {
|
|||
|
||||
// Notify Constellation about the topmost anchor mouse over target.
|
||||
for target in &*mouse_over_targets {
|
||||
let target = target.root();
|
||||
if target.upcast::<Node>().is_anchor_element() {
|
||||
let status = target.r().get_attribute(&ns!(""), &atom!("href"))
|
||||
let status = target.get_attribute(&ns!(""), &atom!("href"))
|
||||
.and_then(|href| {
|
||||
let value = href.value();
|
||||
let url = document.r().url();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue