Status

()

Core
Disability Access APIs
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
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?

Comment 1

11 years ago
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
(Assignee)

Comment 2

11 years ago
(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).

Comment 3

11 years ago
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.
(Assignee)

Comment 4

11 years ago
(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?
(Assignee)

Comment 5

11 years ago
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?
(Assignee)

Comment 6

11 years ago
Actually I don't like concept of extra states because it makes think that these states are additional, secondary, accessory but it's wrong.

Comment 7

11 years ago
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.
(Assignee)

Comment 8

11 years ago
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
(Assignee)

Comment 9

11 years ago
Created attachment 258938 [details] [diff] [review]
patch
Attachment #258938 - Flags: review?(aaronleventhal)
(Assignee)

Comment 10

11 years ago
I suppose I should use nsAccessible::GetFinalState instead of nsAccessible::GetState(). Right?

Comment 11

11 years ago
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+
(Assignee)

Comment 12

11 years ago
checked in with Aaron's comment.
(Assignee)

Comment 13

11 years ago
Should be marked as fixed I guess.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.