Closed Bug 686824 Opened 13 years ago Closed 13 years ago

keypresses always bubble up even if you return false

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: davidkbolton, Unassigned)

Details

Attachments

(1 file)

141.86 KB, application/octet-stream
Details
Attached file bubbler.xpi
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Build ID: 20110902133214

Steps to reproduce:

Create an add with the following code. (Obviously this is a simplification of the practical case).

document.onkeypress = db_KeyBindings;

function db_KeyBindings(e) {
   return false;
}



Actual results:

All keypresses bubble up. 


Expected results:

None of the keypresses should bubble up. 

This worked fine in Add-on SDK 1.0b with Firefox 4. Unfortunately this regression prevents me from being able to update my addon (since current versions of versions of Firefox no longer support SDK 1.0b) 
https://addons.mozilla.org/en-US/firefox/addon/accentor/

The javascript also works fine in the normal webpage context (i.e. paste the code above into Shift+F4 Scratchpad)

Nothing has been mentioned in the release notes for SDK 1.0 about intentionally disabling keypress functionality.
It appears from talking with David on IRC that using unsafeWindow allows this to work, so I'm going to close this bug.

If anyone seeing this bug thinks that it (using plain 'document' to attach the listener) should be fixed, feel free to reopen.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: