mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Auto merge of #23805 - georgeroman:initial_actions_support_in_webdriver, r=jdm
Initial Actions support in WebDriver <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/23805) <!-- Reviewable:end -->
This commit is contained in:
commit
376847c415
6 changed files with 291 additions and 6 deletions
|
@ -3468,6 +3468,28 @@ where
|
|||
}
|
||||
}
|
||||
},
|
||||
WebDriverCommandMsg::KeyboardAction(browsing_context_id, event) => {
|
||||
let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
|
||||
Some(browsing_context) => browsing_context.pipeline_id,
|
||||
None => {
|
||||
return warn!(
|
||||
"Browsing context {} KeyboardAction after closure.",
|
||||
browsing_context_id
|
||||
);
|
||||
},
|
||||
};
|
||||
let event_loop = match self.pipelines.get(&pipeline_id) {
|
||||
Some(pipeline) => pipeline.event_loop.clone(),
|
||||
None => return warn!("Pipeline {} KeyboardAction after closure.", pipeline_id),
|
||||
};
|
||||
let control_msg = ConstellationControlMsg::SendEvent(
|
||||
pipeline_id,
|
||||
CompositorEvent::KeyboardEvent(event),
|
||||
);
|
||||
if let Err(e) = event_loop.send(control_msg) {
|
||||
return self.handle_send_error(pipeline_id, e);
|
||||
}
|
||||
},
|
||||
WebDriverCommandMsg::TakeScreenshot(_, reply) => {
|
||||
self.compositor_proxy
|
||||
.send(ToCompositorMsg::CreatePng(reply));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue