Closed Bug 280920 Opened 20 years ago Closed 20 years ago

Make DHTML menus accessible, if role attribute used

Categories

(Core :: Disability Access APIs, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

()

Details

(Keywords: access)

Attachments

(1 file, 3 obsolete files)

As part of the ongoing DHTML accessibility work, we need special changes to
accomodate DHTML menus.
Attachment #173294 - Flags: review?(pkwarren)
Attachment #173276 - Attachment is obsolete: true
Attachment #173276 - Flags: superreview?(jst)
Attachment #173276 - Flags: review?(pkwarren)
Thanks pkw for noticing the leaks and the forgotten null check.
Comment on attachment 173294 [details] [diff] [review]
1) Fix leaks and forgotten null check 2) Add comments describing menu event computation, 3) Add loop to deal with deeply nested menupopup objects, in menubar check

>Index: accessible/src/base/nsRootAccessible.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/accessible/src/base/nsRootAccessible.cpp,v
>retrieving revision 1.105
>diff -p -u -5 -r1.105 nsRootAccessible.cpp
>--- accessible/src/base/nsRootAccessible.cpp	1 Feb 2005 08:50:47 -0000	1.105
>+++ accessible/src/base/nsRootAccessible.cpp	3 Feb 2005 18:02:38 -0000
...
>+      while (containerRole == ROLE_MENUPOPUP) {
>+        nsIAccessible *current = mMenuAccessible;
>+        current->GetParent(getter_AddRefs(mMenuAccessible));
>+        if (!mMenuAccessible) {
>+          break;
>+        }
>+        mMenuAccessible->GetRole(&containerRole);        
>+      }
>+      // Will fire EVENT_MENUEND as well if parent of menu is menubar
>+      if (containerRole == ROLE_MENUBAR) {
>+        mMenuAccessible = nsnull;
>+      }

This logic seems reversed. You are only firing EVENT_MENUEND below if
mMenuAccessible is non-null.

>+    while (0 == (state & STATE_MULTISELECTABLE)) {
>+      nsIAccessible *current = container;
>+      current->GetParent(getter_AddRefs(container));
>+      container->GetFinalRole(&containerRole);
>+      if (!container || containerRole == ROLE_PANE) {

This seems wrong. You are getting the parent, calling a function on it, and
then checking if the parent is null.
Attachment #173294 - Flags: review?(pkwarren) → review-
Attached patch Address pkw's comments (obsolete) — Splinter Review
Attachment #173294 - Attachment is obsolete: true
Attachment #173296 - Flags: review?(pkwarren)
Comment on attachment 173296 [details] [diff] [review]
Address pkw's comments

This looks like the patch for another bug.
Attached patch Correct patchSplinter Review
Attachment #173296 - Attachment is obsolete: true
Attachment #173298 - Flags: review?(pkwarren)
Attachment #173296 - Flags: review?(pkwarren)
Attachment #173298 - Flags: review?(pkwarren) → review+
Attachment #173298 - Flags: superreview?(jst)
Comment on attachment 173298 [details] [diff] [review]
Correct patch

sr=jst
Attachment #173298 - Flags: superreview?(jst) → superreview+
Checking in accessible/src/base/nsAccessibilityAtomList.h;
/cvsroot/mozilla/accessible/src/base/nsAccessibilityAtomList.h,v  <-- 
nsAccessibilityAtomList.h
new revision: 1.12; previous revision: 1.11
done
Checking in accessible/src/base/nsAccessible.h;
/cvsroot/mozilla/accessible/src/base/nsAccessible.h,v  <--  nsAccessible.h
new revision: 1.55; previous revision: 1.54
done
Checking in accessible/src/base/nsAccessible.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessible.cpp,v  <--  nsAccessible.cpp
new revision: 1.127; previous revision: 1.126
done
Checking in accessible/src/base/nsRootAccessible.cpp;
/cvsroot/mozilla/accessible/src/base/nsRootAccessible.cpp,v  <-- 
nsRootAccessible.cpp
new revision: 1.106; previous revision: 1.105
done
Checking in accessible/src/base/nsRootAccessible.h;
/cvsroot/mozilla/accessible/src/base/nsRootAccessible.h,v  <--  nsRootAccessible.h
new revision: 1.44; previous revision: 1.43
done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
(From attachment 173298 [details] [diff] [review]) accessible/src/base/nsRootAccessible.cpp:

+  // Fire focus if it changes, but always fire focus events for menu items
+  PRBool fireFocus = gLastFocusedNode != aNode || (role == ROLE_MENUITEM);

Correct me if I'm wrong, but it appears to me that apart from initialization,
fireFocus is never used.
> Correct me if I'm wrong, but it appears to me that apart from initialization,
> fireFocus is never used.
Hmm, nice catch -- I'll fix that.

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

Attachment

General

Created:
Updated:
Size: