Closed Bug 477876 Opened 15 years ago Closed 15 years ago

expose checkable="true" object attribute

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b4

People

(Reporter: davidb, Assigned: davidb)

References

(Blocks 1 open bug)

Details

(Keywords: access, verified1.9.1)

Attachments

(1 file, 4 obsolete files)

Whenever we have a defined value for aria-checked it is recommended we expose checkable="true" as an object attribute.
Assignee: nobody → david.bolter
Status: NEW → ASSIGNED
Attached patch patch1 (obsolete) — Splinter Review
This is probably the cleanest fix. Thoughts?
Attachment #362750 - Flags: review?(marco.zehe)
Attachment #362750 - Flags: review?(marco.zehe) → review+
Comment on attachment 362750 [details] [diff] [review]
patch1

r=me. Thanks!
Attachment #362750 - Flags: review?(surkov.alexander)
Comment on attachment 362750 [details] [diff] [review]
patch1


>+  // Expose checkable object attribute for checkable roles, and aria-checked
>+  PRUint32 state = 0;
>+  GetState(&state, nsnull);
>+  if ((state & nsIAccessibleStates::STATE_CHECKABLE) ||
>+      nsAccUtils::HasDefinedARIAToken(content, nsAccessibilityAtoms::aria_checked))

It sounds it is excess check, (state & nsIAccessibleStates::STATE_CHECKABLE) should be enough, it it's not then I guess it's a bug.

>+    attributes->SetStringProperty(NS_LITERAL_CSTRING("checkable"), NS_LITERAL_STRING("true"),
>+                                  oldValueUnused);

while you are here I would prefer to have checkeable atom and use nsAccUtils::SetAccAttr() method.

>+      testAttrs("checked", {"checkable" : "true"}, true); 

regarding tests I would like to have tests for checkable roles from HTML and ARIA markup.
Attachment #362750 - Flags: review?(surkov.alexander)
Attached patch patch2 (obsolete) — Splinter Review
Thanks Surkov. How's this one?
Attachment #362750 - Attachment is obsolete: true
Attachment #362901 - Flags: review?(surkov.alexander)
Comment on attachment 362901 [details] [diff] [review]
patch2


>     "radio",
>     nsIAccessibleRole::ROLE_RADIOBUTTON,
>     eNoValue,
>     eSelectAction,
>-    kNoReqStates,
>+    nsIAccessibleStates::STATE_CHECKABLE,

>+  if ((state & nsIAccessibleStates::STATE_CHECKABLE) ||
>+      nsAccUtils::HasDefinedARIAToken(content, nsAccessibilityAtoms::aria_pressed))

Will we expose STATE_CHECKABLE for checked="undefined". I guess we will.

Why don't we expose STATE_CHECKABLE for defined aria_pressed but we want to expose "checkabe" object attribute?
(In reply to comment #5)
> (From update of attachment 362901 [details] [diff] [review])
> 
> >     "radio",
> >     nsIAccessibleRole::ROLE_RADIOBUTTON,
> >     eNoValue,
> >     eSelectAction,
> >-    kNoReqStates,
> >+    nsIAccessibleStates::STATE_CHECKABLE,
> 
> >+  if ((state & nsIAccessibleStates::STATE_CHECKABLE) ||
> >+      nsAccUtils::HasDefinedARIAToken(content, nsAccessibilityAtoms::aria_pressed))
> 
> Will we expose STATE_CHECKABLE for checked="undefined". I guess we will.

Right.

> 
> Why don't we expose STATE_CHECKABLE for defined aria_pressed but we want to
> expose "checkabe" object attribute?

Hmmm yeah we should probably do that.

Also, I wonder if we should fire a state change event in nsDocAccessible::ARIAAttributeChanged for CHECKABLE where applicable? Overkill?
Attached patch patch3 (obsolete) — Splinter Review
Attachment #362901 - Attachment is obsolete: true
Attachment #362928 - Flags: review?(surkov.alexander)
Attachment #362901 - Flags: review?(surkov.alexander)
Comment on attachment 362928 [details] [diff] [review]
patch3


>+    {&nsAccessibilityAtoms::aria_pressed, kBoolState, nsIAccessibleStates::STATE_PRESSED | nsIAccessibleStates::STATE_CHECKABLE},

why pressed button should be checkable?

>+  // Expose checkable object attribute for checkable roles, aria-checked, aria-pressed

nit: expose checkable object attribute if the accessible has checkable state?

>+  PRUint32 state = 0;
>+  GetState(&state, nsnull);
>+  if ((state & nsIAccessibleStates::STATE_CHECKABLE) ||
>+      nsAccUtils::HasDefinedARIAToken(content, nsAccessibilityAtoms::aria_pressed))

I would vote to not expose checkable state for undefined aria_pressed. It's better to fix GetState method.
(In reply to comment #6)

> 
> Also, I wonder if we should fire a state change event in
> nsDocAccessible::ARIAAttributeChanged for CHECKABLE where applicable? Overkill?

I guess so because STATE_CHECKABLE is mapped to STATE_MARQUEED for MSAA only, neither ATK or IA2 don't have this state and we don't fire state change event for checkable state at all in the meantime.
(In reply to comment #8)
> (From update of attachment 362928 [details] [diff] [review])
> 
> >+    {&nsAccessibilityAtoms::aria_pressed, kBoolState, nsIAccessibleStates::STATE_PRESSED | nsIAccessibleStates::STATE_CHECKABLE},
> 
> why pressed button should be checkable?

It is as specified in the aria impl BPG. The these buttons have two states, pressed, and unpressed. Essentially they are toggles (like checkbox).

> 
> >+  // Expose checkable object attribute for checkable roles, aria-checked, aria-pressed
> 
> nit: expose checkable object attribute if the accessible has checkable state?

Not sure. I'll try to think of something.

> 
> >+  PRUint32 state = 0;
> >+  GetState(&state, nsnull);
> >+  if ((state & nsIAccessibleStates::STATE_CHECKABLE) ||
> >+      nsAccUtils::HasDefinedARIAToken(content, nsAccessibilityAtoms::aria_pressed))
> 
> I would vote to not expose checkable state for undefined aria_pressed. It's
> better to fix GetState method.

Unfortunately the BPG states explicitly: if aria-pressed is not undefined expose object attribute checkable="true"
(In reply to comment #9)
> (In reply to comment #6)
> 
> > 
> > Also, I wonder if we should fire a state change event in
> > nsDocAccessible::ARIAAttributeChanged for CHECKABLE where applicable? Overkill?
> 
> I guess so because STATE_CHECKABLE is mapped to STATE_MARQUEED for MSAA only,
> neither ATK or IA2 don't have this state and we don't fire state change event
> for checkable state at all in the meantime.

Okay let's worry about that when it is impactful.
Attached patch patch4 (obsolete) — Splinter Review
Surkov, I liked your suggestions. Let me know what you think of this one.
Attachment #362928 - Attachment is obsolete: true
Attachment #363110 - Flags: review?(surkov.alexander)
Attachment #362928 - Flags: review?(surkov.alexander)
Attachment #363110 - Flags: review?(surkov.alexander) → review+
Comment on attachment 363110 [details] [diff] [review]
patch4

looks ok, though I liked your test
// bug 477876 testAttrs("checked", {"checkable" : "true"}, true); 

because it tested the case when there is no checkable role

r=me
Comment on attachment 363110 [details] [diff] [review]
patch4


>+  // Expose checkable object attribute if the accessible has checkable state
>+  PRUint32 state = 0;
>+  GetState(&state, nsnull);

nit: you could use nsAccUtils::State(this) - it would be later more easy to deny nsnull as second argument.
Attached patch Patch to pushSplinter Review
Please push this one.
Attachment #363110 - Attachment is obsolete: true
Pushed on David's behalf in changeset:
http://hg.mozilla.org/mozilla-central/rev/e35c958e35e7
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attachment #363117 - Flags: approval1.9.1?
Flags: in-testsuite+
Comment on attachment 363117 [details] [diff] [review]
Patch to push

a191=beltzner
Attachment #363117 - Flags: approval1.9.1? → approval1.9.1+
Pushed to mozilla-1.9.1 on David's behalf in changeset:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/5a57b1f11482
Keywords: fixed1.9.1
Target Milestone: --- → mozilla1.9.1b4
Verified fixed in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090422 Shiretoko/3.5b4pre (.NET CLR 3.5.30729)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: