Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pointerMove webdriver action #23996

Merged
merged 1 commit into from Aug 27, 2019
Merged

Conversation

@georgeroman
Copy link
Contributor

georgeroman commented Aug 18, 2019


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors

This change is Reviewable

@highfive
Copy link

highfive commented Aug 18, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/webdriver_handlers.rs, components/webdriver_server/lib.rs, components/constellation/constellation.rs, components/webdriver_server/actions.rs, components/script/script_thread.rs
  • @cbrewster: components/constellation/constellation.rs
  • @jgraham: components/webdriver_server/lib.rs, components/webdriver_server/actions.rs
  • @KiChjang: components/script/webdriver_handlers.rs, components/script/script_thread.rs, components/script_traits/webdriver_msg.rs, components/script_traits/lib.rs
@highfive
Copy link

highfive commented Aug 18, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
components/compositing/compositor.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
components/webdriver_server/actions.rs Outdated Show resolved Hide resolved
components/webdriver_server/actions.rs Outdated Show resolved Hide resolved
components/webdriver_server/actions.rs Outdated Show resolved Hide resolved
return Ok(());
}

thread::sleep(Duration::from_millis(17));

This comment has been minimized.

@jdm

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.

@georgeroman

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.

@jdm

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.

@georgeroman

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.

@jdm

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.

@georgeroman

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.

@georgeroman

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.

@jdm

jdm Aug 20, 2019

Member

The viewport is the window size.

components/script/webdriver_handlers.rs Outdated Show resolved Hide resolved
@jdm jdm assigned jdm and unassigned emilio Aug 18, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Aug 19, 2019

The latest upstream changes (presumably #23951) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Aug 20, 2019

The latest upstream changes (presumably #23943) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

jdm left a comment

With the change to make subsequent pointer movements happen asynchronously, this should be ready to merge.

@georgeroman
Copy link
Contributor Author

georgeroman commented Aug 21, 2019

Done.

@jdm
Copy link
Member

jdm commented Aug 21, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2019

📌 Commit a516ee1 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 22, 2019

The latest upstream changes (presumably #23947) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm
Copy link
Member

jdm commented Aug 26, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 26, 2019

📌 Commit f064883 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 26, 2019

Testing commit f064883 with merge ddd93db...

bors-servo added a commit that referenced this pull request Aug 26, 2019
…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
Copy link
Contributor

bors-servo commented Aug 27, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Aug 27, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Aug 27, 2019

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

bors-servo commented Aug 27, 2019

Testing commit f064883 with merge b2a7fc9...

bors-servo added a commit that referenced this pull request Aug 27, 2019
…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
Copy link
Contributor

bors-servo commented Aug 27, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing b2a7fc9 to master...

@bors-servo bors-servo merged commit f064883 into servo:master Aug 27, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
Taskcluster (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.