Last Comment Bug 290801 - Javascript cannot cancel accesskey on an <input> tag.
: Javascript cannot cancel accesskey on an <input> tag.
Status: NEW
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Linux
: -- normal with 4 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://www.shlomifish.org/bugs/mozill...
Depends on: 278623
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-18 03:07 PDT by Shlomi Fish
Modified: 2009-08-22 12:18 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Shlomi Fish 2005-04-18 03:07:26 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

One cannot cancel an accesskey on an <input tag using the following Javascript code:

<<<<<<<<<<<
function accesskeys()
{
    var elems = document.getElementsByTagName("*");
    for (var i=0; i<elems.length; i++)
    {
        elems[i].accessKey = "";
    }
}
window.onload = accesskeys;
>>>>>>>>>>>>>>

cancelling an accesskey on <a /> elements works fine using this method. The
HTMLs in:

http://www.shlomifish.org/bugs/mozilla/remove-accesskeys/

demonstrate the problem.

Reproducible: Always

Steps to Reproduce:
1. Go to http://www.shlomifish.org/bugs/mozilla/remove-accesskeys/test-js.html
2. Press Alt+F (or whatever is the access method for accesskey="f")
3. Press Alt+B.

Actual Results:  
Alt+F went to the File menu. Alt+B went to the input box instead of the
Bookmarks menu.

Expected Results:  
Alt+B should have went to the bookmarks menu.
Comment 1 Andrew Schultz 2005-04-18 06:40:31 PDT
confirmed with linux trunk 2005041705

inputElement.accessKey is "" after the DOM call, but the accesskey still works.
Comment 2 Boris Zbarsky [:bz] 2005-05-16 22:07:54 PDT
Frames don't watch the AttributeChanged notification for accesskey.  Content
nodes do it right... See also bug 278623

Note You need to log in before you can comment on or make changes to this bug.