Closed Bug 337128 Opened 18 years ago Closed 18 years ago

Support universal DHTML accessibility properties

Categories

(Core :: Disability Access APIs, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

(Keywords: access)

Attachments

(2 files, 1 obsolete file)

The W3C WAI PFWG is looking to make some accessibility properties universal -- the can influence accessibility on any element. This is a reversal of our previous policy, which was to only check for them if there was also a role attribute. These properties don't influence anything other than how we expose an element to accessibility APIs, so we only deal with them in mozilla/accessible.
"http://www.w3.org/2005/07/aaa" "disabled"
"http://www.w3.org/2005/07/aaa" "required"
"http://www.w3.org/2005/07/aaa" "invalid"

I don't yet know how of these many universal properties we'll end up with.

The reality is that these attributes rarely occur. I'm thinking over what the most sensible code to check for their presence would be, given that they're rare and we could end up with 3-10 of them.

1) I could first check the element to see if there are any namespaced attributes at all -- if so I could go check for each namespace attribute pair via nsIContent::GetAttr. It would be great if there was a quick check for that.
2) I could first check the element to see if there are any namespaced attributes in this namespace -- if so I could go check for each namespace attribute pair via nsIContent::GetAttr
3) I could continue just using nsIContent::GetAttr() for each attribute on the element

What is the most sensible code to check for these attributes would be, given performance tradeoffs. I'm not sure if it's worth walking the attributes one at a time or not.
Is any of these attributes required in order for the other to have meaning? I.e. can you check for the existence of one of them and bail if it's not there?

If not, I think it's pretty much a toss-up between stepping through all attributes using GetAttrNameAt or calling HasAttr three times. Neither is super perfomant though, so it might be an idea to give feedback on that to the WAI WG. Though it might not matter that much since perfomance might be good enough anyway.
(In reply to comment #1)
> Is any of these attributes required in order for the other to have meaning?
> I.e. can you check for the existence of one of them and bail if it's not there?

It used to be that none of the property attributes were relevant unless there is a role attribute. The WAI wants to change that and have a few 'universal' attributes that are not dependent on any other attribute or element type. I don't know how many we'd end up with.
Would it be useful anywhere else in the code if we had a
PRBool nsIContent::HasNamespacedAttr() method?
As of today I don't see anyone else needing it. If CSS selectors were to support the syntax [ns|*=bar] then that could use it, but that is currently not the case.
Attachment #222070 - Attachment is obsolete: true
BTW, these 2 patches created absolutely zero performance impact.
Blocks: fox2access
I fixed this with bug 342979.
Status: NEW → RESOLVED
Closed: 18 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: