Closed
Bug 341462
Opened 19 years ago
Closed 19 years ago
Firefox fires "focus" event when mouse moves over menu while it is not focused
Categories
(Firefox :: Disability Access, defect)
Firefox
Disability Access
Tracking
()
RESOLVED
FIXED
People
(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)
References
Details
(Keywords: access)
Attachments
(1 file, 2 obsolete files)
13.93 KB,
patch
|
aaronlev
:
review+
|
Details | Diff | Splinter Review |
When Firefox is inactive (i.e. the window caption is grey), moving mouse over Firefox menu still emits "focus" event.
1) Open at-poke, click "Log events", mark "focus" checkbox.
2) Open firefox and gnome-terminal
3) Click gnome-terminal
4) Move mouse over firefox menu
This bug is not only on Linux but also on Window.
And even the firefox window is active, if the menuitem is not highlighted, we should not fire accessible focus event for "dommenuitemactive" event.
This is the behavior that common apps do on both Linux and Windows.
I think we should change these codes in nsXULMenuitemAccessible::GetState(PRUint32 *_retval)
PRBool isFocused = PR_FALSE;
element->HasAttribute(NS_LITERAL_STRING("_moz-menuactive"), &isFocused);
if (isFocused)
*_retval |= STATE_FOCUSED;
OS: Linux → All
Summary: [atk] Firefox fires "focus" event when mouse moves over menu while app is inactive → Firefox fires "focus" event when mouse moves over menu while it is not focused
GetFinalState, GetFinalRole is tricky for xulmenupopup and xulmenuitem
from theme's menu.css, we highlight menubar when it's open
TODO: Fix for msaa
Fire focus event for dommenubaractive (we didn't deal with this event for atk yet)
This bug is more complicate than I thought.
This patch,
1) Solved FireCurrentFocusEvent issue
2) Made dommenuitemactive, dommenubaractive, dommenubarinactive work correctly on both Linux and Windows
3) Got STATE_COLLAPSED value for menuitem, also fixed stupid code there.
4) I have to add 1 line in nsMenuFrame::OpenMenu, because SelectMenu is called before OpenMenu.
Verified on Linux and Windows.
Assignee: nobody → ginn.chen
Attachment #225860 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #231073 -
Flags: review?(aaronleventhal)
Comment 4•19 years ago
|
||
Why do we define it with an _ in front and then do this?
typedef struct _MaiUtilListenerInfo MaiUtilListenerInfo;
Comment 5•19 years ago
|
||
(In reply to comment #4)
> Why do we define it with an _ in front and then do this?
> typedef struct _MaiUtilListenerInfo MaiUtilListenerInfo;
I meant this comment for a different bug.
Comment 6•19 years ago
|
||
// Currently we don't implement atkselection interface for menuxxx
// So we can't emit selection_changed events for them
It's unclear if you're saying we should impl atkselection. If we are the comment should say XXX and we should file a bug for that.
Comment 7•19 years ago
|
||
QI's arereturn null for null. Instead of this:
+ if (domEventTarget) {
+ nsCOMPtr<nsIDOMNode> realFocusedNode(do_QueryInterface(domEventTarget));
+ mCaretAccessible->AttachNewSelectionListener(realFocusedNode);
+
We do this:
+ nsCOMPtr<nsIDOMNode> realFocusedNode(do_QueryInterface(domEventTarget));
+ if (realFocusedNode) {
+ mCaretAccessible->AttachNewSelectionListener(realFocusedNode);
+
Comment 8•19 years ago
|
||
Instead of:
+ if (!isOpen)
+ *_retval |= STATE_COLLAPSED;
+ }
Do:
+ *_retval |= isOpen ? STATE_EXPANDED : STATE_COLLAPSED;
Comment 9•19 years ago
|
||
Comment on attachment 231073 [details] [diff] [review]
patch v2
Unfortunately, when I build with this patch, I no longer get focus events on objects with submenus (testing with MSAA on Windows).
For example, if you arrow down through the View menu you get focus events only for the leaf menu items (no submenu attached).
Attachment #231073 -
Flags: review?(aaronleventhal) → review-
Assignee | ||
Comment 10•19 years ago
|
||
(In reply to comment #9)
> For example, if you arrow down through the View menu you get focus events only
> for the leaf menu items (no submenu attached).
Thanks for catching this.
Gnome application always opens submenu, when keyborard navigates to the menuitem. So they don't have this problem.
But Firefox only does it for the toplevel.
We need to add some code to deal with it.
Assignee | ||
Comment 11•19 years ago
|
||
Attachment #231073 -
Attachment is obsolete: true
Attachment #232676 -
Flags: review?(aaronleventhal)
Assignee | ||
Comment 12•19 years ago
|
||
(In reply to comment #6)
> It's unclear if you're saying we should impl atkselection. If we are the
> comment should say XXX and we should file a bug for that.
>
I didn't see benefit of impl atkselction for menu.
We can just remove these lines.
Updated•19 years ago
|
Attachment #232676 -
Flags: review?(aaronleventhal) → review+
Comment 13•19 years ago
|
||
Checked in for Ginn.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 14•18 years ago
|
||
*** Bug 240736 has been marked as a duplicate of this bug. ***
Comment 15•18 years ago
|
||
This fix broke the focus events for menu items when just Alt or F10 is used to focus the menubar. I have filed bug 376640 for that.
You need to log in
before you can comment on or make changes to this bug.
Description
•