Closed Bug 463645 Opened 16 years ago Closed 15 years ago

container-live object attribute should reflect role as well

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

We expose the computed politeness (aria-live) value for any given node via container-live.

This is calculated here:
http://mxr.mozilla.org/mozilla-central/source/accessible/src/base/nsAccUtils.cpp#278

It should really check the current role as it traverses the tree. The following roles have a default aria-live property value:
timer: "off"
log: "polite"
status: "polite"
marquee: "off"
The current code is: 
278     if (live.IsEmpty() &&
279         ancestor->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_live, live))
280       SetAccAttr(aAttributes, nsAccessibilityAtoms::containerLive, live);

I believe it should be something like:
 if (live.IsEmpty()) {
   if (ancestor->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_live, live))
     SetAccAttr(aAttributes, nsAccessibilityAtoms::containerLive, live);
   else if (ancestor->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
     nsRoleMapEntry *role = GetRoleMapEntry(ancestor);
     if (role && role->defaultLiveProp)
       live = role->defaultLiveProp;
       SetAccAttr(aAttributes, nsAccessibilityAtoms::containerLive, live);
   }
  }
 }
 
Then, each role map entry needs an extra defaultLiveProp field. It would be nsnull in most cases.

We'd need to add a new entry for "log", "timer" and "marquee". I guess they'd need a role of ROLE_NOTHING.

We'd need a better test to see if something is a landmark though. Right now we just look to see if it equals gLandmarkRoleMap.
http://mxr.mozilla.org/mozilla-central/source/accessible/src/base/nsAccessible.cpp#1924
But we need a better test for that anyway because of bug 459395.
Should we expose "live" object attribute on accessible itself?
Surkov, I'd say yes.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #362549 - Flags: review?(david.bolter)
Attachment #362549 - Flags: review?(marco.zehe)
Attachment #362549 - Flags: review?(marco.zehe) → review+
Comment on attachment 362549 [details] [diff] [review]
patch

Great, just a few questions first:

>+    "log",
>+    nsIAccessibleRole::ROLE_NOTHING,

(FYI, Marco talked about exposing a log as a table (see bug 469688), but maybe that only makes sense if there is table html markup? In any case, that work probably doesn't belong on this bug)


>+enum ELiveAttrRule
>+{
>+  eNoLiveAttr,
>+  eOffLiveAttr,
>+  ePoliteLiveAttr
>+};
>+

(I notice the specs still talk about aria-live=assertive)


>   // Value mapping rule: how to compute nsIAccessible value
>   EValueRule valueRule;
> 
>   // Action mapping rule, how to expose nsIAccessible action
>   EActionRule actionRule;
>+
>+  // Default value of aria-live attribute
>+  ELiveAttrRule liveAttrDefValue;

Is this a rule or a value? Your other ERules have variables with "Rule" suffixes. I'm not saying to change it, but maybe you could explain this?

>+    if (mRoleMapEntry->role != nsIAccessibleRole::ROLE_NOTHING) {
>+      // We can now expose ROLE_NOTHING when there is a role map entry or used
>+      // role is nothing, which

What does "used role is nothing" mean here?


>+  // If there is no aria-live attribute then expose default value of 'live'
>+  // object attribute used for ARIA role of this accessible.

Nit: Why is 'live' in quotes here?
(In reply to comment #6)
> (From update of attachment 362549 [details] [diff] [review])

> >+  // If there is no aria-live attribute then expose default value of 'live'
> >+  // object attribute used for ARIA role of this accessible.
> 
> Nit: Why is 'live' in quotes here?

Nevermind this question -- it suddenly made sense to me :)
(In reply to comment #6)

> (FYI, Marco talked about exposing a log as a table (see bug 469688), but maybe
> that only makes sense if there is table html markup? In any case, that work
> probably doesn't belong on this bug)

We will expose it as table if there is html table markup for example. We shouldn't expose it as table originally I think.
 

> (I notice the specs still talk about aria-live=assertive)

Yes, but in the meantime we don't need it (I used cases defined in bug description).


> >+  // Default value of aria-live attribute
> >+  ELiveAttrRule liveAttrDefValue;
> 
> Is this a rule or a value? Your other ERules have variables with "Rule"
> suffixes. I'm not saying to change it, but maybe you could explain this?

Ok, I changed it to rule and changed some comments to make thing a bit clear. Though the question is it rule or value is question of terms I guess. Technically I like to use "rule" here because we do this above.

> 
> >+    if (mRoleMapEntry->role != nsIAccessibleRole::ROLE_NOTHING) {
> >+      // We can now expose ROLE_NOTHING when there is a role map entry or used
> >+      // role is nothing, which
> 
> What does "used role is nothing" mean here?

either role nothing or landmark which has role nothing as well. If we have role nothing here then we should allow to get role from native markup.
Attached patch patch2Splinter Review
Attachment #362549 - Attachment is obsolete: true
Attachment #362834 - Flags: review?(david.bolter)
Attachment #362834 - Flags: review?(david.bolter) → review+
http://hg.mozilla.org/mozilla-central/rev/b13b71bf3ab9
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
I backuped one line (http://hg.mozilla.org/mozilla-central/rev/07c015cadf15)

- if (mRoleMapEntry != &nsARIAMap::gLandmarkRoleMap) {
+  if (mRoleMapEntry->role != nsIAccessibleRole::ROLE_NOTHING) {

button name tests fails because role presentation used on button has nothing role but it's not landmark, we shouldn't allow to calculate name from subtree of presentation button but we do with this line.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
timer: inherited from status, should have ROLE_STATUSBAR (missed in ARIA impl guide)
log: inherited from region, should have ROLE_PANE (missed in ARIA impl guide)
status: ROLE_STATUSBAR (corresponds to ARIA impl guide)
marquee: inherited from section, should have ROLE_PANE (corresponds to ARIA impl guide)

Before this bug timer, log, status and marquee had role nothing and timer, log and marquee allowed to get role from native markup. Iirc the fact accessible with log role gets role from native markup is used in chatzilla so I could regress it.

Can we clarify what ARIA roles
1)  should have own role
2)  should have default role (that can be overridden by role from native markup)
3)  should have no role (role nothing)
4)  should allow to get name from subtree.
Any feedback on comment #13.
Regarding timer, log, status, and marquee, I think they should all have their own role (your #1 above). I'm not sure about #4 but I would probably lean toward not looking at the subtree for naming any of these. I imagine we'll discuss this in the UAI-TF.

Alexander, what do you think?
Depends on: 481114
Sounds right. Ok let's follow to #1. I filed bug 481114.
Remaining work fixed via bug 481114
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Depends on: 512908
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: