Closed Bug 153196 Opened 22 years ago Closed 22 years ago

Active Accessibility: support OBJID_CARET and EVENT_OBJECT_LOCATION change event for caret

Categories

(Core :: Disability Access APIs, defect, P2)

x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED
mozilla1.1beta

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

In nsWindow.cpp, when we receive a WM_GETOBJECT message with lParam == OBJID_CLIENT, we need to give back an IAccessible for the caret, which reports ROLE_CARET and the x,y,width and height of the caret and state of 0 (normal). We also need to become a selection listener and fire an MSAA EVENT_OBJECT_LOCATION_CHANGE whenever the caret moves. By supporting caret in this way, we will be compatible with Microsoft Narrator, which will be free access, although not a true screen reader.
Summary: Active Accessibility: support OBJID_CARET and EVENT_OBJECT_LOCATION change event for caret → Active Accessibility: support OBJID_CARET and EVENT_OBJECT_LOCATION change event for caret
Kyle, this is very similar to what you need to do with selection. How should we work together on this? Do you have a bug open for your selection event work?
Yes, this would definitely be same as our desire. We haven't filed other ATK event support except bug 152780 (for table event)and bug 152786 (the framework).
Blocks: 136315
Status: NEW → ASSIGNED
Keywords: access
Priority: -- → P2
Target Milestone: --- → mozilla1.1beta
I hope this somewhat fits in with what Sun is doing with selections. The caret is really the currently focused selection. We could expand nsCaretAccessible to become more of an nsFocusedSelectionAccessible. Even if we don't change the name, it could support nsIAccessibleSelectable. I don't know if that's useful to you, but at least this shows how the caret events can be fired. Seeking r=
Thanks, Aaron. It's a great job! I'll look at this deeply next monday.
I don't have a clear idea how this will fit into Sun's plans for selection and caret. The caret is really the currently focused selection -- it is a caret only when the selection is "collapsed". Do you have any ideas? Also, I noticed we haven't removed nsIAccessibleSelection yet. I thought we don't need this any more.
We have 3 events for editable text: 1) text_selection_chage - we can catch it from nsIDOMFormListener::Select (or probably nsIDOMFormListener::Change, I forgot). 2) text_input - we can catch it from nsIDOMFormListener::Input. 3) text_caret_move - it's vital to ATK, we hope this fix will implement that for us. It's not very clear to us that how nsIAccessibleText and nsIAccessibleEditableText can get benefit from nsIAccessibleCaret. I'm going to find the answer. nsIAccessibleSelection has been removed yet.
Comment on attachment 88728 [details] [diff] [review] Create nsCaretAccessible which implements nsIAccessibleCaret. There is only 1 caret per window, it corresponds to the currently focused selection. r=kyle I applied the patch and tested. It works perfect! Just one thing I noticed that we have different behavior from IE when moving caret by hold down shift key -- We send caret move event at that time, but IE does not. I don't think it's a matter. Or, we can fix this by checking isCollapsed in nsCaretAccessible::NotifySelectionChanged. You decide.
Attachment #88728 - Flags: review+
Seeking a new r= from Kyle. Also seeking r= from Mike Judge to the changes in nsCaret.cpp
Attachment #88728 - Attachment is obsolete: true
Mike, could I get your r= for the changes to nsCaret.cpp? nsCaret::GetCaretCoordinates was returning the width of the frame for the width of the caret - I believe I have added the correct fix, by using mCaretTwipsWidth instead.
Comment on attachment 88909 [details] [diff] [review] Found some leaks. Fixed it with a few changes to the handling of WM_GETOBJECT in nsWindow.cpp. r=kyle There are some nsXULColorPickerAccessible stuff in this patch. Is that for another bug?
Attachment #88909 - Flags: review+
Blocks: 153852
Yeah, I accidentally left that in. You can ignore the nsXULColorPicker stuff.
I would say keep the #define if it keeps the code nice and readable, and inline won't serve your needs. However, I will defer to what Scott Collins says.
r=mjudge on first part with caret code.
Frank, I would like to check to make sure this patch does not negatively affect IME input. It fixes the width reported. GetCaretCoordinates(), and we're not sure if IME relies on the old incorrect value for something.
Comment on attachment 88909 [details] [diff] [review] Found some leaks. Fixed it with a few changes to the handling of WM_GETOBJECT in nsWindow.cpp. sr=kin@netscape.com
Attachment #88909 - Flags: superreview+
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
-- Marking Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: