Closed
Bug 354832
Opened 19 years ago
Closed 19 years ago
Buttons and list options should support nsIAccessibleText
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: aaronlev, Assigned: aaronlev)
References
Details
(Keywords: access)
Attachments
(1 file)
19.71 KB,
patch
|
ginnchen+exoracle
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Any element which shows text on the screen should support nsIAccessibleText.
This includes:
<button>
<input type="button">
<option>
This is important because the locale text attribute might need to be set for those elements.
![]() |
||
Comment 1•19 years ago
|
||
Most of the things on nsIAccessibleText are about getting different info from different ranges of text - is that really useful on a button? I think it would be better to use it only for real text containers. A listbox also doesn't share much behavior with a text container. A listbox or popupmenu is about choosing between a predefined set of options, usually not editing them.
If more accessibles implement almost everything, it's hard for a toolkit to determine what kind of behavior a specific accessible has, by looking at the interfaces it supports.
Is there no better way to solve the original problem (setting the locale text attr)?
Assignee | ||
Comment 2•19 years ago
|
||
We need this for ATK, which says that every leaf which has text must be AccessibleText.
Also, it makes sense becuase a button or a list option (not a list or menu, just the option) can have an embedded object such as an image, in the middle of text. Only nsIAccessibleText can expose that.
![]() |
||
Comment 3•19 years ago
|
||
Does the cross-platform code need to change only to present already-available data (button title, etc) in a different way to ATK?
One of the reasons I care about this, is because my current code makes an assumption that anything that can be QI'd to nsIAccessibleText is a text container. This is quite nice, and makes for simple code.
If this goes away, it'll be even harder to know on runtime what an accessible's identity really is (I'll have to do lots of special-casing with roles, etc).
Assignee | ||
Comment 4•19 years ago
|
||
Yes, the cross platform code has to change so that 1) we can support the text interface methods for those objects, and 2) there currently is no exact way to expose text followed an embedded image with text inside a <button> or <option>.
Assignee | ||
Comment 5•19 years ago
|
||
1) Fix GetOffsetAtPoint() to work with items that the caret cannot be placed in, make it return NS_OK instead of throwing an exception when point isn't at an offset. The -1 offset already means not found.
2) Inherit from nsHyperTextAccessible on classes that can support nsIAccessibleText
3) Cleanup: get rid of unneeded nsFormControlAccessible class (although it requires eAction_Click to be defined for each class that uses it -- which should be the case anyway)
4) Cleanup: better radio button class code reuuse
Attachment #240651 -
Flags: review?(ginn.chen)
Comment on attachment 240651 [details] [diff] [review]
Fix for HTML. Will need followup bug for XUL buttons, menu items and options
r=me
Attachment #240651 -
Flags: review?(ginn.chen) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #240651 -
Flags: superreview?(neil)
![]() |
||
Comment 7•19 years ago
|
||
Comment on attachment 240651 [details] [diff] [review]
Fix for HTML. Will need followup bug for XUL buttons, menu items and options
>@@ -61,10 +61,11 @@ public:
> };
>
> class nsXULCheckboxAccessible : public nsFormControlAccessible
> {
> public:
>+ enum { eAction_Click = 0 };
> nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
> NS_IMETHOD GetRole(PRUint32 *_retval);
> NS_IMETHOD GetNumActions(PRUint8 *_retval);
> NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
> NS_IMETHOD DoAction(PRUint8 index);
>@@ -72,10 +73,11 @@ public:
> };
>
> class nsXULDropmarkerAccessible : public nsFormControlAccessible
> {
> public:
>+ enum { eAction_Click = 0 };
> nsXULDropmarkerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
> NS_IMETHOD GetRole(PRUint32 *_retval);
> NS_IMETHOD GetState(PRUint32 *_retval);
> NS_IMETHOD GetNumActions(PRUint8 *_retval);
> NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
Instead of adding this constant to these classes, can they be defined in some central place and then reused? Are there also constants for other actions that could be grouped there?
Comment 8•19 years ago
|
||
Comment on attachment 240651 [details] [diff] [review]
Fix for HTML. Will need followup bug for XUL buttons, menu items and options
While the rest looks reasonable, you need to get a layout sr to ok your nsIFrame change.
Attachment #240651 -
Flags: superreview?(neil)
Assignee | ||
Updated•19 years ago
|
Attachment #240651 -
Flags: superreview?(roc)
Assignee | ||
Comment 9•19 years ago
|
||
Hakan, the constants need to be local to the classes, because the actions available for each type of object are different. For a button, action #0 might be different than what it should be for something else. Although, it is true that for the moment, most of the time action #0 is like clicking.
We're going to eventually need to go through the actions and add more actions per item.
Attachment #240651 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Updated•19 years ago
|
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•