Meta hotkeys cannot be intercepted on Firefox Mac in an editable area

RESOLVED FIXED

Status

()

defect
P2
normal
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: m.kou, Assigned: jaas)

Tracking

unspecified
x86
macOS
Points:
---
Bug Flags:
blocking1.9 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3) Gecko/2008020511 Firefox/3.0b3
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3) Gecko/2008020511 Firefox/3.0b3

The ability to intercept hotkeys in JavaScript is important for web based editors since they need to keep track of the changes that the user have made. On Firefox Mac, all meta hotkeys cannot be intercepted by JavaScript with key events. This is really bad for web based editors since people would be able to change the document with hotkeys (e.g. Meta-X, Meta-V, Meta-Z, etc.) without the editor knowing about it. Also, it makes it impossible for a web based editor to implement its own undo/redo system to work with Firefox Mac.

Reproducible: Always

Steps to Reproduce:
1. Make an HTML that intercepts keydown events with document.addEventListener('keydown', ...);
2. Make the HTML document editable with document.designMode = 'on';
3. Open the editable HTML in Firefox for Mac.
4. Try to press some Meta key combos in the editable document - they can never be properly intercepted by the keydown event handler.
Actual Results:  
Meta key events cannot be intercepted by JavaScript in Firefox for Mac.

Expected Results:  
Meta combo key events should be detectable in JavaScript just like Ctrl combo key events in Firefox for Windows.
(Reporter)

Comment 1

11 years ago
Regression from the patch for bug 376077?  (That patch was landed on
2008-01-28, just before beta3 came out.)

Comment 3

11 years ago
I've added a second test file which demonstrates some more problems with Meta key handling on the Mac. Launch it and follow these steps. (Note! Need to do these carefully -- behavior is sensitive here.)

1. Select some text in the editable top pane.
2. Press down CMD key
3. Press down C key
4. Release C key
5. Release CMD key

In FF 3 beta 3, this produces two events (show in the logging pane at the bottom):
- key down on the meta key
- key up on the meta key

In FF 2, this produces three events:
- key down on the meta key
- key up on the C key
- key up on the meta key

On Windows (using CTRL instead of meta), this produces five events: key up AND key down events on both the CTRL and C, as well as a key press event.

It would be very nice to get all the key down and key up events on the Mac. However, at a minimum it would be good to at least get the key-up event that FF 2 used to produce. (My software has a critical dependency here!)

Comment 4

11 years ago
We need to fix this for final - Josh can you take..
Assignee: nobody → joshmoz
Flags: blocking1.9+
Priority: -- → P2

Comment 5

11 years ago
This bug (or a very similar one) also prevents the Flash player on the Mac from responding to CMD-A, CMD-X, CMD-C and CMD-V keys in text areas.  You can reproduce this with the text area of any Flash app -- here's a handy one:

http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html

To reproduce problem:
- in the left pane tree control, navigate to Form Elements/Text Area
- click in the "SANDBOX" text area to set focus
- try using CMD-A, CMD-X, CMD-C, CMD-V keys.  These do nothing in Firefox 3 beta 4; they work correctly in Firefox 2.
(Assignee)

Comment 6

11 years ago
This is a consequence of bug 382138, which we ultimately decided not to fix for Gecko 1.9. Please see the discussion in that bug. We might want to dupe this bug against that bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 7

11 years ago
Josh - what's the solution for flash then?
(Assignee)

Comment 8

11 years ago
Same deal. We need to fix bug 382138 and then it will work. We decided not to fix that bug because of risk at this stage of the release. I don't want to re-hash the discussion on bug 382138 too much, but I actually did start working on this a while back and I have part of the patch so I've seen this stuff work with it.
(Assignee)

Updated

11 years ago
Depends on: 398514
(Assignee)

Comment 9

11 years ago
Fixed in Gecko 1.9 by the final patch for bug 398514.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Comment 10

11 years ago
Note that this bug exists in Firefox 2 for Mac OS X.

Comment 11

11 years ago
I'm very glad this was fixed now -- thanks!

Although Firefox 2 did have some problems in this area, it didn't have exactly this bug.  See my comment #3 above for a comparision of FF 2 and FF 3 beta on Max OS X.

Also, see my comment #5 for another example of key handling in Flash that worked in FF2 but not in FF3 beta 3.
You need to log in before you can comment on or make changes to this bug.