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

Remove pointer event defaults #666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove pointer event defaults #666

wants to merge 1 commit into from

Conversation

jrandolf-2
Copy link
Contributor

@jrandolf-2 jrandolf-2 commented Feb 20, 2024

We enforce default pointer properties although the WebDriver spec does not specify any.


Preview | Diff

@jrandolf-2 jrandolf-2 requested a review from OrKoN February 20, 2024 13:48
@OrKoN
Copy link
Contributor

OrKoN commented Feb 20, 2024

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

@jrandolf-2 jrandolf-2 closed this Feb 20, 2024
@jrandolf-2 jrandolf-2 deleted the jrandolf/defaults branch February 20, 2024 13:53
@jrandolf-2 jrandolf-2 restored the jrandolf/defaults branch February 20, 2024 13:55
@jrandolf-2 jrandolf-2 reopened this Feb 20, 2024
@jrandolf-2
Copy link
Contributor Author

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

This is implementation-defined. See https://www.w3.org/TR/webdriver2/#dfn-dispatch-a-pointerdown-action

@OrKoN OrKoN changed the title chore: remove pointer defaults Remove pointer events defaults Feb 20, 2024
@jrandolf-2 jrandolf-2 changed the title Remove pointer events defaults Remove pointer event defaults Feb 20, 2024
Copy link
Contributor

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (as the classic spec does not require actual default values). @juliandescottes @jgraham PTAL

@jgraham
Copy link
Member

jgraham commented Feb 26, 2024

The defaults match the defaults if you construct an event in the DOM API, per: https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces. I think that's what's intended by classic, and saying "this is just implementation defined" is not OK (authors should be able to depend on event properties being consistent between browsers for a given input).

@jrandolf-2
Copy link
Contributor Author

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

The defaults don't really make sense for a lot of events. For example, for pointer, the default pressure is always 0.5 (try it on any browser)

@jgraham
Copy link
Member

jgraham commented Feb 26, 2024

That seems like a reason to update those specs, rather than a reason to throw our hands up and say "implementation defined".

@jrandolf-2
Copy link
Contributor Author

jrandolf-2 commented Feb 26, 2024

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

PointerEventInit is used for custom events built from the DOM. It does not reflect what is expected from the automation side. We could take your arguments and apply them to keyboard events and etc, but this wouldn't benefit an automation user. In particular, keyboard events, e.g., allow setting the ctrl state, but we know for automation they probably want to integrate with the browser state.

As an alternative, we can try to specify the defaults within WebDriver in detail. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants