Link exposed to the WebIDL definition, remove potentially confusing note #1391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recently implemented this, and noticed that this could be linked, so this does that. However, on deeper investigation, I did notice that browsers didn't behave as I expected for DeviceMotionEvent since that is only exposed in secure contexts.
I expected browsers to throw on
document.createEvent('devicemotionevent')
like they do fornew DeviceMotionEvent('foo')
in non secure contexts, but from some limited testing they seem to not do that.Since the intent of the spec reads to throw in this situation, I'm just removing the spec note here which seems to indicate it only applies for TouchEvent and will write a corresponding WPT test if this change is fine.
Sidenote: TouchEvent by strict reading of the IDL is always exposed on window in the IDL definition and the spec instead uses a separate implementation defined boolean which reads to only apply for the mixin, so this wouldn't apply here. But that seems to not reflect with the intent of the touch events spec, and now that specification is unmaintained.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff