aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/embedder/input_events.rs
diff options
context:
space:
mode:
authorEuclid Ye <yezhizhenjiakang@gmail.com>2025-04-19 03:27:57 +0800
committerGitHub <noreply@github.com>2025-04-18 19:27:57 +0000
commit46247a76210daef793fec29b001cf4c05281f2e4 (patch)
tree92a824783be48e82836002a2a352c478bb3d8eae /components/shared/embedder/input_events.rs
parent2ee8427665099987f715296d4d55b6388a480c08 (diff)
downloadservo-46247a76210daef793fec29b001cf4c05281f2e4.tar.gz
servo-46247a76210daef793fec29b001cf4c05281f2e4.zip
Move click event trigger from embedding layer to `ScriptThread` (#36413)
1. Move click event trigger from embedding layer to `ScriptThread` 2. Previously, the logic is to trigger click event at same position as `MouseButtonAction::Up` if `MouseButtonAction::Up` is within 10px of `MouseButtonAction::Down`, in embedding layer. This PR ~~removes the condition~~ moves the check to `ScriptThread`. Testing: tested for webdriver with self written test case. Perform actions of pointermove, pointerdown, pointerup in sequence. Click event can now be triggered. Fixes: #35395 cc @xiaochengh @jdm For `MAYBE? TODO:` part I added, should we do it? I read the [spec](https://w3c.github.io/uievents/#event-type-click), it doesn't specify we have to implement MDN's way. If we should work in the MDN's way, it also should be fixed in another PR, as this PR doesn't regress anything. Also I am not sure what is the best way to do it. Should I handle it in https://github.com/servo/servo/blob/4d4f94936f8859f039497df370083fd7ea35fb00/components/script/dom/document.rs#L1296-L1297? --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Diffstat (limited to 'components/shared/embedder/input_events.rs')
-rw-r--r--components/shared/embedder/input_events.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/shared/embedder/input_events.rs b/components/shared/embedder/input_events.rs
index 0268be6dd9c..16adccf8cd3 100644
--- a/components/shared/embedder/input_events.rs
+++ b/components/shared/embedder/input_events.rs
@@ -51,7 +51,7 @@ pub struct MouseButtonEvent {
pub point: DevicePoint,
}
-#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum MouseButton {
Left,
Middle,