Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement pointerMove webdriver action #23996
Conversation
highfive
commented
Aug 18, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Aug 18, 2019
| return Ok(()); | ||
| } | ||
|
|
||
| thread::sleep(Duration::from_millis(17)); |
This comment has been minimized.
This comment has been minimized.
jdm
Aug 18, 2019
Member
The current implementation is synchronous, so we don't match the constraints described by https://w3c.github.io/webdriver/#issue-container-generatedID-46. I think we should address that spawning a thread that is responsible for sending the remaining webdriver commands.
This comment has been minimized.
This comment has been minimized.
georgeroman
Aug 19, 2019
Author
Contributor
Since perform_move_action needs access to self, we'll also need to synchronize its shared usage, is that right?
This comment has been minimized.
This comment has been minimized.
jdm
Aug 20, 2019
Member
I recommend making perform_move_action a free function that accepts all of the state it requires as arguments. Can the input_state_table entry for a particular source id change? If not, we can pass the pointer input state and the constellation channel. If it can, then we can store the input state table inside of an Arc and pass that along with the constellation channel.
This comment has been minimized.
This comment has been minimized.
georgeroman
Aug 27, 2019
Author
Contributor
Running perform_move_action in a separate thread interferes with the ElementClick command, where we need to dispatch a pointerMove, a pointerDown and then a pointerUp action, in the proper order: https://w3c.github.io/webdriver/#element-click (steps 8.10 - 8.13). The pointerMove action might happen after the pointerDown and pointerUp actions, which is not desirable.
| let left = cmp::max(0, cmp::min(x, x + width)); | ||
| let right = cmp::min(innerWidth, cmp::max(x, x + width)); | ||
| let top = cmp::max(0, cmp::min(y, y + height)); | ||
| let bottom = cmp::min(innerHeight, cmp::max(y, y + height)); |
This comment has been minimized.
This comment has been minimized.
jdm
Aug 18, 2019
Member
It's not clear to me that comparing against innerWidth and innerHeight will work when an element is outside the initial viewport and the page is scrolled so that the element is in view.
This comment has been minimized.
This comment has been minimized.
georgeroman
Aug 19, 2019
Author
Contributor
This will not work in that case, it needs to take into account the whole available viewport not just the window. I'll address this issue. However, this case won't come up as scrolling into view is not supported yet.
This comment has been minimized.
This comment has been minimized.
georgeroman
Aug 20, 2019
Author
Contributor
Actually, I think this works. innerWidth and innerHeight should reflect the size of the whole viewport, not just the size of the window, if I understood correctly.
This comment has been minimized.
This comment has been minimized.
|
|
|
|
|
With the change to make subsequent pointer movements happen asynchronously, this should be ready to merge. |
|
Done. |
|
@bors-servo r+ |
|
|
|
|
|
@bors-servo r+ |
|
|
…r=jdm Implement pointerMove webdriver action <!-- 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 <!-- 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/23996) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
|
…r=jdm Implement pointerMove webdriver action <!-- 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 <!-- 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/23996) <!-- Reviewable:end -->
|
|
georgeroman commentedAug 18, 2019
•
edited by SimonSapin
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is