-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 document.createEvent("touchevent") #27250
Conversation
cynthia@ could you please take a look, thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to remove TouchEvent from dom/nodes/Document-createEvent.js
and add it to the not-supported list in dom/nodes/Document-createEvent.https.html
.
touch-events/historical.html
Outdated
var touchEvent = document.createEvent("touchevent"); | ||
assert_false("initTouchEvent" in touchEvent, | ||
"Should not be supported on the instance"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this test, but use the constructor to create touchEvent
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to remove TouchEvent from
dom/nodes/Document-createEvent.js
and add it to the not-supported list indom/nodes/Document-createEvent.https.html
.
Done, thank you.
touch-events/historical.html
Outdated
var touchEvent = document.createEvent("touchevent"); | ||
assert_false("initTouchEvent" in touchEvent, | ||
"Should not be supported on the instance"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
This is still exposed on mobile as it happens. Properly specifying this in the DOM Standard depends on w3c/touch-events#64. I'm not sure how we would expose that boolean in tests though. |
@annevk gah, didn't see your comment before merging. Lemme know if I should revert. |
I think it's fine. Once that issue is fixed we'll need to have another look at this and for desktop these are the correct results. |
Since in DOM spec, createEvent(interface) is not recommended and suggests "Event constructors ought to be used instead." Also, Chrome, Edge, Firefox and Safari do not support document.createEvent("touchevent"), we should just delete it.
DOM spec: https://dom.spec.whatwg.org/#dom-document-createevent.