Closed
Bug 827863
Opened 11 years ago
Closed 6 years ago
Fix touch events example code regarding pageX/pageY offset postion
Categories
(Developer Documentation Graveyard :: API: DOM, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: romaxa, Unassigned)
References
()
Details
I've noticed that touch test example https://developer.mozilla.org/samples/domref/touchevents.html which is referred by page https://developer.mozilla.org/en-US/docs/DOM/Touch_events does not work correctly on Mobile Firefox, not sure if same issue on B2G. problem is that canvas painting line position has 8px (body default) offset off the finger screen position if I increase that distance a bit more, http://romaxa.info/tests/touch_wrong.html - then problem even more visible. I tested it on google chrome, safari it works the same way... so it seems documentation need to be updated and test fixed using canvas element position offset subtraction from touch.pageX/pageY. http://romaxa.info/tests/touch.html - like it is done here.
Updated•11 years ago
|
tracking-fennec: --- → ?
Comment 2•11 years ago
|
||
It sounds like Firefox, Chrome, and Safari all work the same way, so I would consider this a bug in the example code.
Flags: needinfo?(mbrubeck)
Reporter | ||
Comment 3•11 years ago
|
||
interesting question is why clientX/Y provide similar behavior? ideally it should give coordinates in space of canvas area... but it does not... is it some generic bug?
Reporter | ||
Updated•11 years ago
|
Reporter | ||
Comment 4•11 years ago
|
||
hmm mouse events works exactly same way...
Comment 5•11 years ago
|
||
clientX/Y and pageX/Y are the same if page isn't scrolled.
Comment 6•11 years ago
|
||
The simplest fix for the example code might be to position the <canvas> at the top left corner of the page (e.g. remove any padding or margins on the <body> or <canvas>). Or we can use the more robust fix linked in comment 0.
tracking-fennec: ? → ---
Component: DOM → Other
Product: Core → Mozilla Developer Network
Summary: Fix DOC or touch events regarding pageX/pageY offset postion → Fix touch events example code regarding pageX/pageY offset postion
Updated•10 years ago
|
Assignee: nobody → bruant.d
Component: General → DOM
Product: Mozilla Developer Network → Developer Documentation
Updated•10 years ago
|
Whiteboard: [triaged]
Updated•7 years ago
|
Assignee: bruant.d → nobody
Whiteboard: [triaged]
Comment 7•6 years ago
|
||
The https://developer.mozilla.org/en-US/docs/Web/API/Touch_events page does not reference the broken sample under https://developer.mozilla.org/samples/domref/touchevents.html anymore. All these static examples under https://developer.mozilla.org/samples/ will be removed in bug 1076893.
You need to log in
before you can comment on or make changes to this bug.
Description
•