Closed Bug 473164 Opened 16 years ago Closed 15 years ago

Need more cleaning of object attributes list

Categories

(Firefox :: Disability Access, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: davidb, Assigned: davidb)

References

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Spin-off from bug 452388#c72.

This bug is about the code in nsAccessible::GetAttributes where we expose all straggler ARIA properties as object attributes.

Token based aria attributes with value "undefined" should not be exposed in this list and we might have other similar special casing down the road. We'll need to deal with these token based attributes one by one unfortunately. Role extensibility, as Aaron points out will impact this later.
Assignee: nobody → david.bolter
Status: NEW → ASSIGNED
I'm going to hold off on this fix as I think it is has a low value to performance ratio.
Severity: normal → minor
Status: ASSIGNED → NEW
Thinking out loud:

It might be nice capture the static properties of aria attributes (such as what value they can take). I wonder if we could make use of a map or hash based on the aria atoms, that would return us an object of default properties.

So we could do something like:

if (ourHash(nsAccessibilityAtoms::aria_foo).token) {
 // treat it like a token based aria attribute
 ...
}

Might be overkill now... but I could see this growing in usage. If you guys agree I'll explore it as part of this fix.
Chatted with surkov over IRC, and have his endorsement. Filed bug 475006 which I might tackle first after some investigation.
Attached patch WIP - for discussion (obsolete) — Splinter Review
Here's the straightforward approach. We could go with this for now and refactor with the bug 475006 work.

Ideally it would be nice if we could easily perf test.
Attachment #358417 - Flags: review?(surkov.alexander)
Comment on attachment 358417 [details] [diff] [review]
WIP - for discussion


>       if (!nsAccUtils::IsARIAPropForObjectAttr(attrAtom))
>         continue; // No need to expose obj attribute -- will be exposed some other way
>       nsAutoString value;
>+      if (nsAccUtils::IsTokenBasedARIAAttribute(content, attrAtom) &&

I don't like the idea to check attributes twice (IsARIAPropForObjectAttr and IsTokenBasedARIAAttribute). It's better to combine IsARIAPropForObjectAttr, IsTokenBasedARIAAttribute, GetAttr into one method or follow general solution you suggested.
Attachment #358417 - Flags: review?(surkov.alexander)
(In reply to comment #5)
I do think they are distinct characteristics and separating the two checks make some sense. I think my vote would be to go with this patch for correctness now, and then proceed with the general approach, or just go straight to the general approach.

Self-nit: I don't need the nsIContent param. Will update if I post another patch here.
Attached patch Removed a param.Splinter Review
Attachment #358417 - Attachment is obsolete: true
OK I've done some research.

As I confirmed with Marco, our current plan is to commit this patch. I'll proceed to the more general refactor on bug 475006 as a more general fix. I imagine I'll want to take more time with that one, while working on other bugs.
Attachment #358438 - Flags: review?(marco.zehe)
Attachment #358438 - Flags: review?(marco.zehe) → review+
Fixed via work on bug 475006
Status: NEW → RESOLVED
Closed: 15 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: