Repository navigation
Move click event trigger from embedding layer to ScriptThread - #36413
Conversation
aee567b to
ce38d66
Compare
|
@mrobinson @jdm I also have some follow up commits to fix #35666. Do you think it should be added to this PR tho? |
I would prefer to keep that change in a separate PR. |
ce38d66 to
db856ea
Compare
|
Do we have a principle which UI events are triggered at which layers? |
mrobinson
left a comment
There was a problem hiding this comment.
Is it possible to remove MouseButtonAction::Click as well with this change?
Not without further changes to the egl port, which synthesizes click events from touch events I believe. |
From my observation, most UI events are eventually fired from |
|
I don't get it. Shouldn't most of the UI events triggered from the compositor? |
I think that |
Is it correct to draw the line between device (or raw, low level) events and synthesized (or semantical, higher level) events? In this way, |
Yes, I think we are, though it seems like |
Signed-off-by: Euclid Ye <[email protected]> Add back `webview_relative_mouse_down_point` Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
db856ea to
7ce5c08
Compare
Signed-off-by: Euclid Ye <[email protected]>
jdm
left a comment
There was a problem hiding this comment.
This looks good! Thanks for fixing this.
|
I know this is merged. But after pondering, should Otherwise, we might
|
|
I thought about that when reading the code. I'm not sure it matters, because the user would still need to perform a second mouse down action before another mouse up, which would reset the state. |
|
What if I mouse down in one iframe, and then drag by 8px to another pipeline, and then release? |
…ce (#36619) Rework `ScriptThread::handle_input_event` for correct behaviour and better performance 1. Only trigger click event with primary button, according to spec 2. Avoid unnecessary clone of `ConstellationInputEvent` This is a follow up of #36413 Testing: Manually tested. Right mouse won't trigger click event now. Fixes: #35666 cc @jdm @xiaochengh Signed-off-by: Euclid Ye <[email protected]>
|
@yezhizhen I feel like this can be left as an open issue to discuss. With mouse, we probably want to avoid such behaviors. But with touch, we probably need such behaviors since touch coordinates are not accurate. |
After `InputEvent::Touch` processed by Script, it sends `TouchEventProcessed` back to Constellation, which goes through hit-test etc. and loops back to Script again. However, `WebViewRenderer::simulate_mouse_click` should not send `MouseButtonAction::Click` due to #36413 Testing: Manually tested by converting mouse to touch cc @jdm @xiaochengh Signed-off-by: Euclid Ye <[email protected]>
ScriptThreadMouseButtonAction::UpifMouseButtonAction::Upis within 10px ofMouseButtonAction::Down, in embedding layer. This PRremoves the conditionmoves the check toScriptThread.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, 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
servo/components/script/dom/document.rs
Lines 1296 to 1297 in 4d4f949