Closed
Bug 417760
Opened 17 years ago
Closed 17 years ago
cannot focus() img elements with tabindex="-1"
Categories
(Core :: Disability Access APIs, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: simon.bates, Assigned: aaronlev)
References
(Blocks 1 open bug)
Details
(Whiteboard: Simple patch. Needed for ARIA when img is used for child widgets)
Attachments
(2 files)
1014 bytes,
text/html
|
Details | |
980 bytes,
patch
|
MatsPalmgren_bugz
:
review+
MatsPalmgren_bugz
:
superreview+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
To reproduce:
* open the attached test file focus-img-tabindex-minus-one.html
* click on the button 'focus img tabindex="-1"'
Expected:
* focus to go to the img with tabindex="-1"
Actual:
* focus does not move
Tested with:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008021504 Minefield/3.0b4pre
Reporter | ||
Comment 1•17 years ago
|
||
Assignee | ||
Comment 2•17 years ago
|
||
Attachment #303652 -
Flags: superreview?(mats.palmgren)
Attachment #303652 -
Flags: review?(mats.palmgren)
Comment 3•17 years ago
|
||
Sorry, I thought
-1 means not focusable
0, focusable but not navigable
>0 defines navigation order
Isn't it true?
Assignee | ||
Comment 4•17 years ago
|
||
No, that's not right. See this table:
http://developer.mozilla.org/en/docs/Key-navigable_custom_DHTML_widgets#The_solution:_changes_to_standard_behavior_of_tabindex
Assignee | ||
Updated•17 years ago
|
Blocks: aria
Severity: normal → major
Flags: blocking1.9?
Whiteboard: Simple patch. Seeking r+. Needed for ARIA when img is used for child widgets
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Assignee | ||
Comment 5•17 years ago
|
||
Mats, this is marked blocking. How about some review love?
Comment 6•17 years ago
|
||
Comment on attachment 303652 [details] [diff] [review]
Simple patch -- check if tabindex attr present
This looks good. r+sr=mats
Please add a mochitest as well, calling focus() on a few different elements
and verify it has focus (or not) using 'activeElement' for example.
At least something simple that covers this bug.
That said, there are still a couple of issues in this code, although these
can probably wait to post-1.9:
1. we should return false if !IsInDoc(), not just for image map:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/html/content/src/nsHTMLImageElement.cpp&rev=1.224&root=/cvsroot&mark=442#436
and a better test is probably what nsGenericHTMLElement::IsFocusable does:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/html/content/src/nsGenericHTMLElement.cpp&rev=1.756&root=/cvsroot&mark=3119-3127,3133#3116
2. this block should be removed?:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/html/content/src/nsHTMLImageElement.cpp&rev=1.224&root=/cvsroot&mark=461-464#436
<input type="image"> is not handled by this method, if that
was the assumption
We should refactor these methods (post-1.9) such that a subclass
IsFocusable() can re-use common code from a superclass...
Please file a followup bug?
Attachment #303652 -
Flags: superreview?(mats.palmgren)
Attachment #303652 -
Flags: superreview+
Attachment #303652 -
Flags: review?(mats.palmgren)
Attachment #303652 -
Flags: review+
Updated•17 years ago
|
Whiteboard: Simple patch. Seeking r+. Needed for ARIA when img is used for child widgets → Simple patch. Needed for ARIA when img is used for child widgets
Updated•17 years ago
|
Flags: in-testsuite?
Assignee | ||
Updated•17 years ago
|
Attachment #303652 -
Flags: approval1.9?
Comment 7•17 years ago
|
||
Comment on attachment 303652 [details] [diff] [review]
Simple patch -- check if tabindex attr present
You are blocking - approval not needed. Land away
Attachment #303652 -
Flags: approval1.9? → approval1.9+
Comment 8•17 years ago
|
||
checked in
/cvsroot/mozilla/content/html/content/src/nsHTMLImageElement.cpp,v <-- nsHTMLImageElement.cpp
new revision: 1.225; previous revision: 1.224
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 9•17 years ago
|
||
So... the review included a request for a test. I assume that's being worked on, still?
Comment 10•17 years ago
|
||
Marco, since Aaron is away several days then could you care about mochitest for this?
Comment 11•17 years ago
|
||
(In reply to comment #9)
> So... the review included a request for a test. I assume that's being worked
> on, still?
I've created follow-up bug 424304 for this Mochitest. I'll work on it there.
Comment 12•17 years ago
|
||
Filed bug 425087 to followup on the remaining issues from comment 6.
Comment 13•17 years ago
|
||
verified fixed using the testcase and Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9pre) Gecko/2008042705 Minefield/3.0pre ID:2008042705
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•