aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-01-08 17:34:16 +0530
committerManish Goregaokar <manishsmail@gmail.com>2020-01-09 08:16:25 +0530
commit82002765beebed60b737d64b538bc0c33912f0e0 (patch)
tree3920bd768dcd34939e18023aa3eb1e60d10c3a48 /components
parent225254a6b357609129cb636d128b36d0ae4d7692 (diff)
downloadservo-82002765beebed60b737d64b538bc0c33912f0e0.tar.gz
servo-82002765beebed60b737d64b538bc0c33912f0e0.zip
Add select events
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/fakexrinputcontroller.rs26
-rw-r--r--components/script/dom/webidls/FakeXRInputController.webidl6
2 files changed, 28 insertions, 4 deletions
diff --git a/components/script/dom/fakexrinputcontroller.rs b/components/script/dom/fakexrinputcontroller.rs
index 4756baf5f0a..67e6f72cf70 100644
--- a/components/script/dom/fakexrinputcontroller.rs
+++ b/components/script/dom/fakexrinputcontroller.rs
@@ -13,7 +13,7 @@ use crate::dom::fakexrdevice::get_origin;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSender;
-use webxr_api::{InputId, MockDeviceMsg, MockInputMsg};
+use webxr_api::{InputId, MockDeviceMsg, MockInputMsg, SelectEvent, SelectKind};
#[dom_struct]
pub struct FakeXRInputController {
@@ -79,4 +79,28 @@ impl FakeXRInputControllerMethods for FakeXRInputController {
fn Reconnect(&self) {
self.send_message(MockInputMsg::Reconnect)
}
+
+ /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-startselection
+ fn StartSelection(&self) {
+ self.send_message(MockInputMsg::TriggerSelect(
+ SelectKind::Select,
+ SelectEvent::Start,
+ ))
+ }
+
+ /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-endselection
+ fn EndSelection(&self) {
+ self.send_message(MockInputMsg::TriggerSelect(
+ SelectKind::Select,
+ SelectEvent::End,
+ ))
+ }
+
+ /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-simulateselect
+ fn SimulateSelect(&self) {
+ self.send_message(MockInputMsg::TriggerSelect(
+ SelectKind::Select,
+ SelectEvent::Select,
+ ))
+ }
}
diff --git a/components/script/dom/webidls/FakeXRInputController.webidl b/components/script/dom/webidls/FakeXRInputController.webidl
index bdfd00a6f91..a50950cdee3 100644
--- a/components/script/dom/webidls/FakeXRInputController.webidl
+++ b/components/script/dom/webidls/FakeXRInputController.webidl
@@ -16,9 +16,9 @@ interface FakeXRInputController {
void disconnect();
void reconnect();
- // void startSelection();
- // void endSelection();
- // void simulateSelect();
+ void startSelection();
+ void endSelection();
+ void simulateSelect();
// void setSupportedButtons(sequence<FakeXRButtonStateInit> supportedButtons);
// void updateButtonState(FakeXRButtonStateInit buttonState);