Closed Bug 206376 Opened 21 years ago Closed 20 years ago

accesskey doesn't work when field type is "file"

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: danielc, Assigned: aaronlev)

References

()

Details

(Keywords: access, helpwanted, html4)

Attachments

(4 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030506
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030506

In forms used for submitting files, if a field is type="file" and that field has
an accesskey set, the browser doesn't jump to that field when hitting ALT-<LETTER>.


Reproducible: Always

Steps to Reproduce:
1. Go to the page shown above.
2. Hit ALT-O.

Actual Results:  
Nothing.

Expected Results:  
The cursor should move to the field labeled "Photo File."
Verified 20030516 PC/WinXP
->Keyboard navigation
Assignee: general → aaronl
Status: UNCONFIRMED → NEW
Component: Browser-General → Keyboard: Navigation
Ever confirmed: true
Keywords: access, html4
QA Contact: general → sairuh
The sample URI has been changed.

The new one is
http://www.bikesummer.org/2003/photos/bugzilla.php

The old one was
http://www.bikesummer.org/2003/photos/add.php

The old one is for public use on the website.  I changed that version to use
<label> elements to define the accesskey.  When using this syntax, the keyboard
navigation works as expected.  None the less, the keyboard navigation should
still work for cases where the accesskey attribute is used inside the
   <input type="file" />
Blocks: atfmeta
Keywords: helpwanted
Attachment #150700 - Flags: review?(aaronleventhal)
Comment on attachment 150700 [details] [diff] [review]
patch for 206376

Conditional r=aaronl if you change
|if (rv == NS_OK)| to either |if (NS_SUCCEEDED(rv))| or just use |if
(fileContent)|
If you use the second option you won't need to get rv in the QI.

Your patch also works with this case:
<label accesskey="c" for="bar">File <u>c</u>ontrol 2:</label> <input
type="file" id="bar">
That might have worked before, but I wanted to note that it's another case --
sometimes the accesskey is on the label.
Attachment #150700 - Flags: review?(aaronleventhal) → review+
Aaron, my test case includes both scenario you mentioned and works fine. so
IMHO, what i need to is to modify the condition clause and that's it, right?
correct me if i miss/misunderstandard anything.
Yes it works. All you need to do is change the condition. You have r= with that.
Attached patch patch v2 (obsolete) — Splinter Review
modification of condition clause according Aaron's suggestion
Attachment #150900 - Flags: superreview?(jst)
Attached patch patch v3 (obsolete) — Splinter Review
sorry for miss "!"
Attachment #150900 - Attachment is obsolete: true
Attached patch final patchSplinter Review
really sorry. need strong coffee
Attachment #150901 - Attachment is obsolete: true
Attachment #150902 - Flags: superreview?(jst)
Neo, I'm sorry but it's better to use

if (NS_FAILED(rv))

instead of 

if (!NS_SUCCEEDED(rv))

When you have time you might want to look at
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsError.h
Comment on attachment 150902 [details] [diff] [review]
final patch

Yeah, use NS_FAILED()...

sr=jst
Attachment #150902 - Flags: superreview?(jst) → superreview+
Aaron and jst, after a browse of nsDebug.h, i have a question that any reason
not use NS_ENSURE_SUCCESS(rv, rv)?

seems it both have warning message and return if failed.
(In reply to comment #12)
> Aaron and jst, after a browse of nsDebug.h, i have a question that any reason
> not use NS_ENSURE_SUCCESS(rv, rv)?
> 
> seems it both have warning message and return if failed.

Use |NS_ENSURE_SUCCESS(rv, rv)| if you want to log an error.
Use |if (NS_FAILED(rv)) { return rv; }|  if you don't
Attached patch patch checked inSplinter Review
condition clause change
Nian, when you check in a fix, mark the bug fixed :)
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attachment #150900 - Flags: superreview?(jst)
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: