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

Fix #227: Make createEvent("touchevent") sometimes throw #230

Merged
merged 3 commits into from
Apr 19, 2016
Merged

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Apr 18, 2016

Browsers typically disable touch events on non-touch devices, and
there exists Web content that detects this difference using
createEvent.


Also see w3c/touch-events#64 for a possible spec hook for this.

I'm not sure about the wording, happy to tweak it.

I updated bikeshed and got some unrelated differences in the output, FYI.

Browsers typically disable touch events on non-touch devices, and
there exists Web content that detects this difference using
createEvent.
in its current configuration, let <var>constructor</var> be null.

<p class=note>Typically user agents have the {{TouchEvent}} interface disabled in some
configurations.
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this just follow from new TouchEvent throwing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but that would result in a TypeError whereas WebKit/Chromium/Gecko (at last) throw NotSupportedError.
http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4078

I suppose TypeError is Web compatible enough but are implementors OK with changing to TypeError?

Copy link
Member

Choose a reason for hiding this comment

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

I see. I think it would be better then to where we talk about the initial value of constructor we check for that being undefined and if it's undefined we throw a NotSupportedError and mention that this can be the case for TouchEvent in a note.

@annevk annevk merged commit cb7c16b into master Apr 19, 2016
@annevk annevk deleted the touchevent branch April 19, 2016 05:47
@annevk
Copy link
Member

annevk commented Apr 19, 2016

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants