Closed Bug 373531 Opened 17 years ago Closed 17 years ago

implement IA2::state

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I think actually we don't need to introduce extended states. We should have gecko states and map them into platform states like we do for roles. Is it correct?
I'm not sure what you mean. We need to support the IA2 states. I think most of them are available in GetExtState().

Most of these are a simple mapping from states in GetExtState(). You'll need an extended state map.

const long 	IA2_STATE_ACTIVE = 0x1
const long 	IA2_STATE_ARMED = 0x2
const long 	IA2_STATE_DEFUNCT = 0x4
const long 	IA2_STATE_EDITABLE = 0x8
const long 	IA2_STATE_HORIZONTAL = 0x10
const long 	IA2_STATE_ICONIFIED = 0x20
const long 	IA2_STATE_INVALID = 0x40    /// Don't support this, it shouldn't be in there
const long 	IA2_STATE_INVALID_ENTRY = 0x80
const long 	IA2_STATE_MANAGES_DESCENDANTS = 0x100   // We probably won't support this -- I don't think it's in nsIAccessible
const long 	IA2_STATE_MODAL = 0x200
const long 	IA2_STATE_MULTI_LINE = 0x400
const long 	IA2_STATE_OPAQUE = 0x800
const long 	IA2_STATE_REQUIRED = 0x1000
const long 	IA2_STATE_SELECTABLE_TEXT = 0x2000
const long 	IA2_STATE_SINGLE_LINE = 0x4000
const long 	IA2_STATE_STALE = 0x8000
const long 	IA2_STATE_SUPPORTS_AUTOCOMPLETION = 0x10000
const long 	IA2_STATE_TRANSIENT = 0x20000
const long 	IA2_STATE_VERTICAL = 0x40000
(In reply to comment #1)
> I'm not sure what you mean. We need to support the IA2 states. I think most of
> them are available in GetExtState().

It looks we can include extended states into states, i.e. we don't need to have getExtStates() because (correct me if I'm wrong) neither ATK/MSAA/IA2 hasn't idea of extended states (they have not defined constants for extended states).
I think in IA2 extended states means author-defined states, which we don't support yet.

In nsIAccessible extended states means something different. It's just these extra states that ATK and IA2 have but MSAA doesn't have.
(In reply to comment #3)
> I think in IA2 extended states means author-defined states, which we don't
> support yet.
> 
> In nsIAccessible extended states means something different. It's just these
> extra states that ATK and IA2 have but MSAA doesn't have.
> 

I used wrong term ;) I always thought that ext means extended :).
I meant it looks we don't need to have both state and extra states in gecko. We just have to have gecko states and should map them to platform states like we do it for roles. Ok?
Ah, the problem is last value of states is 0x40000000. We cannot add new values in that list if we don't increment the type order. Is there type that is greater than long?
Actually I don't like concept of extra states because it makes think that these states are additional, secondary, accessory but it's wrong.
You are right.

As far as the name "extended" or "extra" it doesn't really matter. We called it extended before IA2 did. It's just that they mean something different. We mean, more states. Historically, when we first started implementing accessibility in Gecko, we only had MSAA support. At this time we did not have this method yet. At that time these states were "additional" in the sense that we were adding them just for Linux.

But GetExtState() is an unfortunate hack. We just don't have an easily accessible 64 bit type in Gecko that works across all compilers. Anyway, I ran into problems doing it.

Here's the bug for combining GetState() and GetExtState() :: bug 344674
I'm not sure there's an easy way to do it in one method other than an array, and I think the bitfield is probably slightly more performant. Anyway, is it worth changing that right now? 

My suggestion is just map the extState field for now, and we can clean this up in bug 344674 later when we have time. But, if you want to do it now I guess that's okay.
The questions:

Atk has the following states that are not used in Gecko. Should be they presented in IA2?

ATK_STATE_HAS_TOOLTIP
ATK_STATE_TRUNCATED

The IA2 states that are not mapped to Gecko states. Do we plan to supprot them?
IA2_STATE_ARMED
A2_STATE_MANAGES_DESCENDAN

IA2 defines two invalid states but gecko has the one. Should we have additional state for Gecko?
IA2_STATE_INVALID
IA2_STATE_INVALID_ENTRY

Gecko has two states that are not mapped to IA2. Should IA2 to have them?
STATE_CHECKABLE
STATE_IMPORTANT
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
Attachment #258938 - Flags: review?(aaronleventhal)
I suppose I should use nsAccessible::GetFinalState instead of nsAccessible::GetState(). Right?
Comment on attachment 258938 [details] [diff] [review]
patch

One change needed. You have INVALID and INVALID_ENTRY switched.

nsIAccessible::INVALID == INVALID_ENTRY for both ATK and IA2.

IA2 is incorrect to assign a value to INVALID, it should be zero like ATK. Since this is a bit field, it simply means there is no state.
Attachment #258938 - Flags: review?(aaronleventhal) → review+
checked in with Aaron's comment.
Should be marked as fixed I guess.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: