Closed
Bug 692183
Opened 13 years ago
Closed 13 years ago
Incorrect behavior of preventDefault() when used with context menu
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(firefox7 wontfix, firefox8 affected, firefox9 fixed, firefox10 fixed)
VERIFIED
FIXED
Firefox 9
People
(Reporter: dwalkowski, Assigned: wesj)
References
()
Details
(Whiteboard: [inbound])
Attachments
(2 files)
768 bytes,
text/html
|
Details | |
877 bytes,
patch
|
mbrubeck
:
review+
asa
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 Build ID: 20110928134238 Steps to reproduce: Please visit this page: mozilla.github.com/icongrid I am overriding the press-and-hold behavior by preventDefault() on the context menu event, and substituting my own. I am using the latest nightly of Fennec. Actual results: If, and only if, the page is not scrolled at all, then press-and-hold on an icon behaves correctly. Pressing for 1 second lifts the icon from the page, allowing you to reposition it. No context menu is shown. However, if the page is scrolled up even 1 pixel, this behavior does NOT happen, but instead it appears the the coordinate system is changed out from under me, causing the press and hold to fail. Expected results: The correct behavior should happen no matter how the page is scrolled. Please note that the correct behavior is observed on every other platform tested: Firefox Chrome Safari Safari Mobile Android default webkit browser.
Comment 1•13 years ago
|
||
A testcase would be nice.
Reporter | ||
Comment 2•13 years ago
|
||
I gave you a test case. Visit the page mentioned above: mozilla.github.com/icongrid, and follow the trivial steps mentioned above.
Updated•13 years ago
|
Comment 3•13 years ago
|
||
This is probably because e.touches[0].clientY returns something different in Fennec. That value seems in Fennec the vertical offset in the window plus the amount scrolled. In the Android stock browser, it's the vertical offset in the window.
Assignee | ||
Comment 4•13 years ago
|
||
The github example page seems to work now? Have you fixed something on your end? Is there still a bug in Fennec that we need to address. Martjin, your problem seems different. If there's a difference, can you file a separate bug to find out which impelementation is right.
Reporter | ||
Comment 5•13 years ago
|
||
No, the github page does not work. Be sure to scroll the page slightly to see the problem. I can demonstrate it for you if you are local to MV, I'm on second floor.
Assignee | ||
Comment 6•13 years ago
|
||
Not in MV. Looked into this some more, but I think the description here is wrong and Martijn's right. In every test I can throw at it, contextmenu is fired and preventDefault works. But AFAICT, your page doesn't use the contextmenu event for anything but hiding the context menu, which works. A reduced test case would probably have made this much easier to diagnose. The page is doing its own "longtap" detection by setting a timer on touchdown. They also register to pick up mouse events. We fire a mousemove event a few hundred ms after touchdown. The page compares the coordinates of touchdown and mousemove events and they don't match. We fire mouse events using DOMWindowUtils which automatically does the correct pixel conversions for us. We fire touchdown events using our own coordinates. This just makes us correct for client offset. I'm a bit worried about iframes... may need to look at this more. Note for Dan, if you call preventDefault on the touch events, we won't fire mouse events and you won't have this cross pollination problem. You also won't see our sidebars or the urlbar in us or other browsers pan in. Glad we found the real bug though.
Assignee: nobody → wjohnston
Attachment #565109 -
Flags: review?(mbrubeck)
Updated•13 years ago
|
Attachment #565109 -
Flags: review?(mbrubeck) → review+
Reporter | ||
Comment 7•13 years ago
|
||
wesj: and the real bug is that the e.touches[0].clientY is incorrect? any chance this will make it into a soonish nightly?
Assignee | ||
Comment 8•13 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/e53f415e6cc7
Whiteboard: [inbound]
Comment 9•13 years ago
|
||
Dan, you could adjust your code to circumvent this bug.
Comment 10•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e53f415e6cc7
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 10
Assignee | ||
Comment 11•13 years ago
|
||
Comment on attachment 565109 [details] [diff] [review] Patch nominating this for aurora. this is low risk and fixes bad behavior in our original touch events implementation.
Attachment #565109 -
Flags: approval-mozilla-aurora?
Comment 12•13 years ago
|
||
Additional comments for Aurora approval: This is a two-line Fennec-only patch that is a straightforward fix for a miscalculation. It fixes a web compatibility bug that affects at least one JavaScript library in the wild (and published by Mozilla!); see comment 0 for details.
Updated•13 years ago
|
status-firefox10:
--- → fixed
status-firefox7:
--- → wontfix
status-firefox8:
--- → affected
status-firefox9:
--- → affected
OS: Mac OS X → All
Hardware: x86 → All
Updated•13 years ago
|
Attachment #565109 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 13•13 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/fafffd7c801e
Target Milestone: Firefox 10 → Firefox 9
Comment 14•13 years ago
|
||
Build ID: Mozilla/5.0 (Android; Linux armv7l; rv:9.0a2) Gecko/20111017 Firefox/9.0a2 Fennec/9.0a2 Device: HTC Desire Z OS: Android 2.3 Verified issue on above environment: - If page is scrolled then press-and-hold on an icon behaves correctly: pressing for 1 second lifts the icon from the page, allowing you to reposition it. No context menu is shown. - OK - If page is NOT scrolled then pressing for 1 second lifts the icon from the page, allowing you to reposition it and also the entire page is scrolled up/down or left/right panels are displayed if moving icon left/right. Is this related to this bug or is it a new issue? I will reopen the bug for now. If this is a different issue I will close this bug and open a new one.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 15•13 years ago
|
||
Sounds like a new bug, seems to work for me, btw.
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Comment 16•13 years ago
|
||
Bug #695317 was logged for issue described in comment #14. BAsed on previous 2 comments, marking bug as verified fixed.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•