Auto merge of #13633 - glennw:forward-touch-events, r=mbrubeck

Send touch events to root pipeline, and allow forwarding to iframes.

Instead of letting the compositor try to find the correct scroll
layer for a touch event, switch touch events to work the same way
that mouse events do.

Touch events are now dispatched to the root pipeline, and then
forwarded to child iframes as required.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13633)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-07 19:07:24 -05:00 committed by GitHub
commit 9d3fc76463
5 changed files with 118 additions and 71 deletions

View file

@ -867,22 +867,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
debug!("constellation got focus message");
self.handle_focus_msg(pipeline_id);
}
FromScriptMsg::ForwardMouseButtonEvent(pipeline_id, event_type, button, point) => {
let event = CompositorEvent::MouseButtonEvent(event_type, button, point);
FromScriptMsg::ForwardEvent(pipeline_id, event) => {
let msg = ConstellationControlMsg::SendEvent(pipeline_id, event);
let result = match self.pipelines.get(&pipeline_id) {
None => { debug!("Pipeline {:?} got mouse button event after closure.", pipeline_id); return; }
Some(pipeline) => pipeline.script_chan.send(msg),
};
if let Err(e) = result {
self.handle_send_error(pipeline_id, e);
}
}
FromScriptMsg::ForwardMouseMoveEvent(pipeline_id, point) => {
let event = CompositorEvent::MouseMoveEvent(Some(point));
let msg = ConstellationControlMsg::SendEvent(pipeline_id, event);
let result = match self.pipelines.get(&pipeline_id) {
None => { debug!("Pipeline {:?} got mouse move event after closure.", pipeline_id); return; }
None => { debug!("Pipeline {:?} got event after closure.", pipeline_id); return; }
Some(pipeline) => pipeline.script_chan.send(msg),
};
if let Err(e) = result {