TouchEvent.pageX/pageY should be undefined
Categories
(Core :: DOM: Events, defect, P3)
Tracking
()
People
(Reporter: kats, Assigned: smaug)
References
()
Details
(Keywords: compat, dev-doc-complete, site-compat, Whiteboard: [webcompat][needs-wpt-?])
Attachments
(1 file)
Reporter | ||
Updated•10 years ago
|
Assignee | ||
Comment 2•10 years ago
|
||
Reporter | ||
Comment 3•10 years ago
|
||
Reporter | ||
Comment 4•10 years ago
|
||
Reporter | ||
Comment 5•10 years ago
|
||
Reporter | ||
Comment 8•7 years ago
|
||
Reporter | ||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Updated•7 years ago
|
![]() |
||
Updated•6 years ago
|
![]() |
||
Updated•6 years ago
|
![]() |
||
Comment 14•6 years ago
|
||
Context for https://webcompat.com/issues/15381
It basically breaks this code by giving a whacky computation for the Justapoxe library used for creating sliders with two images Before/After.
https://github.com/NUKnightLab/juxtapose/blob/c4ec3e076319366bdf8b69647cd5855d25bbb772/juxtapose/js/juxtapose.js#L173-L183
function getPageX(e) {
var pageX;
if (e.pageX) {
pageX = e.pageX;
} else if (e.touches) {
pageX = e.touches[0].pageX;
} else {
pageX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
}
return pageX;
}
e.pageX
gives a very different result than e.touches[0].pageX
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 15•6 years ago
|
||
What spec should this live in?
Reporter | ||
Comment 16•6 years ago
|
||
It's already really part of the TouchEvents spec, in that there's no pageX/pageY defined on TouchEvent in the spec. Our implementation is just wrong.
Comment 17•6 years ago
|
||
Ah, I see. Thanks for clearing that up for me.
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Comment 22•6 years ago
|
||
Posted site compatibility note: https://www.fxsitecompat.dev/en-CA/docs/2019/pagex-pagey-have-been-moved-from-uievent-to-mouseevent/
Comment 23•6 years ago
|
||
I've added a rel note to the Fx 69 rel notes about this:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/69#APIs
(Some wording stolen from Kohei's compat post, as it was awesome!)
I don't think aanything else is needed here. MDN already lists these properties on MouseEvent and UIEvent, but the on the latter they are listed as non-standard/do not use. And the compat data looks reasonable.
Description
•