Closed Bug 287390 Opened 15 years ago Closed 15 years ago

Name & default action do not work on <input type="image">

Categories

(Firefox :: Disability Access, defect)

x86
All
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

(Keywords: access)

Attachments

(1 file)

Steps:
Load a page with an image button <input type="image"> and an accessibility
testing tool. Try to activate the default action on the image button.

The problem is that we're creating an nsHTML4ButtonAccessible instead of an
nsHTMLButtonAccessible
The accessible name is also incorrect.
Summary: Accesible default action does not work on <input type="image"> → Name & default action do not work on <input type="image">
Attachment #178402 - Flags: review?(pkwarren) → review+
Attachment #178402 - Flags: superreview?(jst)
Comment on attachment 178402 [details] [diff] [review]
1) Create correct kind of accessible for each kind of button, 2) Better name getting algorithm for buttons 3) Better recognize anonymous frames

- In nsAccessible::AppendNameFromAccessibleFor():

- In AppendFlatStringFromContentNode():

   if (aContent->Tag() == nsAccessibilityAtoms::img) {
...
+  if (aContent->Tag() == nsAccessibilityAtoms::input) {
...
+  if (aContent->Tag() == nsAccessibilityAtoms::object &&
!aContent->GetChildCount()) {
...

aContent->Tag() is a virtual call, you'd be better off caching the atom you get
from that call in a raw nsIAtom* local. You'd save on both speed and size.

- In nsHTMLButtonAccessible::GetName():

+    shell->GetAnonymousContentFor(content, getter_AddRefs(anonymousElements));
+    if (anonymousElements) {
+      nsCOMPtr<nsIDOMNode> domNode(do_QueryElementAt(anonymousElements, 0));

do_QueryElementAt() is null safe, so no need for the first if-check there.

sr=jst
Attachment #178402 - Flags: superreview?(jst) → superreview+
Checking in layout/forms/nsImageControlFrame.cpp;
/cvsroot/mozilla/layout/forms/nsImageControlFrame.cpp,v  <-- 
nsImageControlFrame.cpp
new revision: 3.103; previous revision: 3.102
done
Checking in accessible/src/base/nsAccessibilityAtomList.h;
/cvsroot/mozilla/accessible/src/base/nsAccessibilityAtomList.h,v  <-- 
nsAccessibilityAtomList.h
new revision: 1.17; previous revision: 1.16
done
Checking in accessible/src/base/nsAccessible.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessible.cpp,v  <--  nsAccessible.cpp
new revision: 1.137; previous revision: 1.136
done
Checking in accessible/src/base/nsAccessible.h;
/cvsroot/mozilla/accessible/src/base/nsAccessible.h,v  <--  nsAccessible.h
new revision: 1.57; previous revision: 1.56
done
Checking in accessible/src/base/nsAccessibleTreeWalker.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessibleTreeWalker.cpp,v  <-- 
nsAccessibleTreeWalker.cpp
new revision: 1.14; previous revision: 1.13
done
Checking in accessible/src/html/nsHTMLFormControlAccessible.cpp;
/cvsroot/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp,v  <-- 
nsHTMLFormControlAccessible.cpp
new revision: 1.59; previous revision: 1.58
done
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.