Closed Bug 241055 Opened 22 years ago Closed 21 years ago

nsHTMLTextFieldAccessible need "ATK_STATE_EDITABLE" state and "Activate" action.

Categories

(Core :: Disability Access APIs, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Louie.Zhao, Assigned: Louie.Zhao)

References

Details

(Whiteboard: sunport17)

Attachments

(2 files, 3 obsolete files)

This bug is to refine ATK information exported from "nsHTMLTextFieldAccessible". 1. If inputbox in HTML is not readonly, it should export "ATK_STATE_EDITABLE" state. 2. In gail implementation, inputbox in HTML has "Activate" action. We should support in mozilla.
Attached patch add editable state (obsolete) — Splinter Review
Attachment #146563 - Flags: review?(pkw)
Attachment #146564 - Flags: review?(pkw)
Comment on attachment 146563 [details] [diff] [review] add editable state >Index: accessible/public/nsIAccessible.idl ... > const unsigned long STATE_TRANSIENT = 0x40000000; // Tells accessibility aid "Don't add event listener - this object doesn't generate any". For example, could be used with higher level containers. > const unsigned long STATE_VERTICAL = 0x80000000; // Especially used for sliders and scrollbars >+ const unsigned long STATE_EDITABLE = 0x00080000; // used for HTML input (type = text,password) element Can you please move STATE_EDITABLE up to the top of the extended state constants, so they are in order of increasing value like in other places in this file. Also, any reason on why you chose 0x00080000 instead of 0x00100000? >Index: accessible/src/html/nsHTMLFormControlAccessible.cpp >=================================================================== >RCS file: /cvsroot/mozilla/accessible/src/html/nsHTMLFormControlAccessible.cpp,v >retrieving revision 1.42 >diff -u -r1.42 nsHTMLFormControlAccessible.cpp >--- accessible/src/html/nsHTMLFormControlAccessible.cpp 31 Jul 2003 08:09:24 -0000 1.42 >+++ accessible/src/html/nsHTMLFormControlAccessible.cpp 19 Apr 2004 10:51:32 -0000 >@@ -375,6 +375,8 @@ > elt->HasAttribute(NS_LITERAL_STRING("readonly"), &isReadOnly); > if (isReadOnly) > *_retval |= STATE_READONLY; >+ else >+ *_retval |= STATE_EDITABLE; > > // Get current selection and find out if current node is in it > nsCOMPtr<nsIPresShell> shell(GetPresShell()); I don't think the way we are currently dealing with states is correct. STATE_EDITABLE is an extended state (listed in the second section), so it should be set in an implementation of GetAccExtState. However, this will not work in the current ATK code because of the following (from nsAccessibleWrap.cpp): PRUint32 accState = 0; nsresult rv = accWrap->GetState(&accState); NS_ENSURE_SUCCESS(rv, state_set); if (accState == 0) { nsresult rv = accWrap->GetExtState(&accState); //NS_ENSURE_SUCCESS(rv, state_set); if (accState == 0) return state_set; } nsAccessibleWrap::TranslateStates(accState, state_set); Both the state and the extended state could pass valuable information, however we are only checking the extended state if the state is not set. I have spoken to Aaron some more today about the whole state/extended state problems. I think the cleanest solution would be to rename the extended state constants in the idl file with an EXT_ prefix to prevent confusion between the two.
Attachment #146563 - Flags: review?(pkw) → review-
Attached patch add editable state 2 (obsolete) — Splinter Review
> Can you please move STATE_EDITABLE up to the top of the extended state > constants, so they are in order of increasing value like in other places in > this file. Done. > Also, any reason on why you chose 0x00080000 instead of 0x00100000? If two "STATE"s have the same value, mozilla will be confused while using them simultaneously. MSAA States consume almost all of bitfield. So Extended states can only pick up the bitfields which have not been used. "0x00080000" is a good candidate. "0x00100000" is STATE_FOCUSABLE, which has been used widely. > I don't think the way we are currently dealing with states is correct. > STATE_EDITABLE is an extended state (listed in the second section), so it > should be set in an implementation of GetAccExtState. However, this will not > work in the current ATK code > I have spoken to Aaron some more today about the whole state/extended state > problems. I think the cleanest solution would be to rename the extended state > constants in the idl file with an EXT_ prefix to prevent confusion between the > two. Actually, "GetAccExtState" isn't implemented by any object at present, that is to say, "state/extended state" mechanism has never been used. It's really a problem because MSAA only use "GetState". If we put extended state in "GetState", MSAA may not work properly. Philip, can you file another bug to fix this issue ? Thanks.
Attachment #146563 - Attachment is obsolete: true
Attached patch add editable state 2 (obsolete) — Splinter Review
Updated patch. Since STATE_EDITABLE is "extend state", which shouldn't be used in "accessible/src/html". Otherwise, MASS may not work properly because MASS may confuse STATE_EDITABLE with other MASS states. This patch move STATE_EDITABLE to "accessible/src/atk".
Attachment #146658 - Attachment is obsolete: true
Attachment #146663 - Flags: review?(pkw)
Attachment #146564 - Flags: review?(pkw) → review+
The problem I see with setting the state to include an extended state flag is that ATK may work properly, but the MSAA implementation will think the object has a state which it does not. Since nsIAccessible::STATE_EDITABLE and nsIAccessible::STATE_SELFVOICING have the same value, the ATK code will work properly when encountering this state (by setting ATK_STATE_EDITABLE), but the MSAA code will set the improper state STATE_SELFVOICING for this object. The reason we have not encountered this problem so far is that we are not setting any of the extended states currently.
Attachment #146564 - Flags: superreview?(Henry.Jia)
All the extended states are only used in ATK code. MSAA implementation has never used them and isn't supposed to use "extended state". There will be problem when both MSAA and ATK want to use 2 states who have the same value at the same time. Fortunately, this won't happen because MSAA only use "MSAA State flags" and ATK replaces unused "MSAA State flags" with extended state. If using more states (for both MSAA and ATK) makes confliction in the future, we can file bug to deal with it.
Status: NEW → ASSIGNED
I want to move us in the direction of clean API's. Let's not mix extended states and regular states. That's not the way regular and extended states were meant to be used. They should always be separate in separate fields until the final mapping to MSAA and ATK states. Let's use some type safety techniques to ensure states don't get mixed together.
Comment on attachment 146564 [details] [diff] [review] add activate action sr=Henry
Attachment #146564 - Flags: superreview?(Henry.Jia) → superreview+
Thanks for r and sr. "add activate action" PATCH has been checked in.
Attachment #146663 - Flags: review?(pkwarren)
Whiteboard: sunport17
Blocks: 263575
No longer blocks: 239867
Depends on: 278951
filed bug 278951 to deal with "extended state flags" issue.
Attachment #146663 - Attachment is obsolete: true
Comment on attachment 176575 [details] [diff] [review] add editable state The changes are minor from the patch you already have r= and sr= for, so just check it in with r=pkw,aaronlev and sr=henry.
Attachment #176575 - Flags: review+
Comment on attachment 176575 [details] [diff] [review] add editable state Actually this patch is fixing a different problem than the first page.
Attachment #176575 - Flags: superreview?(mike.shaver)
Attachment #176575 - Flags: superreview?(mike.shaver) → superreview?(Henry.Jia)
Attachment #176575 - Flags: superreview?(Henry.Jia) → superreview+
The patch for "add edtiable state" has been checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: