Closed Bug 289006 Opened 19 years ago Closed 13 years ago

Support required and invalid states (leaving open for ATK support)

Categories

(Firefox :: Disability Access, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: aaronlev, Assigned: Louie.Zhao)

Details

Both DHTML accessibility and XForms have a concept of required and invalid
states. ATK has an invalid state, but MSAA does not. Neither have a required state.

**> Bill, can you add a required state to ATK?

In MSAA we are currently planning to 'shoehorn' the states into 2 states that
are rarely/never used today:
STATE_ALERT_LOW = required
STATE_ALERT_HIGH= invalid
This has nothing to do with MSAA's ROLE_ALERT or EVENT_ALERT.
At some point we may create an IAccessible2 interface which supports extended
states, rather than using these alert states.
Hi Aaron:  REQUIRED state sounds like a good idea.  I'll raise an ATK RFE.
(In reply to comment #1)
> Hi Aaron:  REQUIRED state sounds like a good idea.  I'll raise an ATK RFE.

Bill, no rush, but if you can get me a constant for required soon then I can
support it in the first checkin this week.  Otherwise we'll do it in a separate
round, but that will require extra reviews, etc.
ATK_STATE_REQUIRED is now available in atk version 1.10.0, cvs HEAD. (I haven't
released 1.10.0 tarball yet).
(In reply to comment #3)
> ATK_STATE_REQUIRED is now available in atk version 1.10.0, cvs HEAD. (I haven't
> released 1.10.0 tarball yet).

Thanks Bill, is it a #define?
Do you know if I should be able to write:
#ifdef ATK_STATE_REQUIRED
    if (aState & nsIAccessible::STATE_REQUIRED)
        atk_state_set_add_state (state_set, ATK_STATE_REQUIRED);
#endif

Or is there a version-based #define I should use?
It's not a #define, its in an enum.  So you'll have to check for a specific ATK
version at build time and use some compilation guards, I think.

However, since it's just a C enum value, if you build a version based on ATK
1.10.0, it will evaluate to something >= ATK_STATE_LAST_DEFINED, so it should be
safe at runtime; these enums were designed to be extensible that way.
> You'll have to check for a specific ATK version at build time and use some 
> compilation guards, I think.
Okay, do you know the exact #ifdef I should drop in?
Hmm, neither George Kraft nor I could find anything in /usr/include/atk-1.0/atk
to indicate which version of ATK is being used. Doesn't seem like we can have a
precompiler directive unless you add something. Can you add something we can use
or let us know what other options you can think of?
Code freeze is tonight, so I just checked in support for DHTML states required
and invalid in bug 288989. I didn't have an answer on the preprocessor directive
and I just went with this for now:

#ifdef MAI_HAS_ATK_STATE_REQUIRED
    if (aState & nsIAccessible::STATE_REQUIRED)
        atk_state_set_add_state (state_set, ATK_STATE_REQUIRED);
#endif

Obviously that's not right. Leaving it open and assigning to Louie Zhao to get
the right preprocessor directive in.
Assignee: aaronleventhal → Louie.Zhao
Summary: Support required and invalid states → Support required and invalid states (leaving open for ATK support)
the MAI_HAS_ATK_STATE_REQUIRED #define should be keyed to autoconf checks, using
pkgconfig.  If atk version (from pkgconfig) >= 1.9.2, them
MAI_HAS_ATK_STATE_REQUIRED should be set to something non-false.
I'll release atk 1.9.2 today, meanwhile if you build atk from cvs, the version
will be 1.9.2.
correction: I see that I revved to 1.10.0 when I added this constant, so the
version test should be '>= 1.10.0'
QA Contact: bugzilla → disability.access
We expose these states through xpcom, and map them to states on windows and atk, so close as worksforme
right, worksforme
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.