aria ROLE values are case sensitive
Categories
(Core :: Disability Access APIs, defect, P5)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox88 | --- | fixed |
People
(Reporter: faulkner.steve, Assigned: marcos, Mentored)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
| Reporter | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
Comment 3•7 years ago
|
||
See bug 1547409. Moving webcompat whiteboard tags to project flags.
Updated•6 years ago
|
Just noting that Chrome and Safari treat the assigning the roles as case insensitive, so this/remains is a potential web combat issue.
I think https://searchfox.org/mozilla-central/source/accessible/base/ARIAMap.cpp#1383 is what needs to change... the comparator is case sensitive there. Either the constructor should lcase mRole or maybe there is some Compare() function that can do the case comparison. I couldn't work out what namespace Compare() is being called from (and neither could searchfox), so I could figure out what a quick fix might be.
Does anyone know? If someone can guide me I can try to fix this.
Comment 6•5 years ago
|
||
Yuck. I think we're using this non-namespaced Compare function. I don't even understand why that exists.
I would just change that line to this (I haven't tested though):
return mRole.Compare(aEntry.ARIARoleString(), /* aIgnoreCase */ true);
Note that while this bug is (currently) just about ARIA roles, there are quite a few other places where ARIA attribute values are expected to be lower case; true, false, etc. That should mostly be a matter of changing instances of eCaseMatters to eIgnoreCase, but there may be some which shouldn't be changed, so each will need to be examined.
(In reply to James Teh [:Jamie] from comment #6)
return mRole.Compare(aEntry.ARIARoleString(), /* aIgnoreCase */ true);
Hehe, I actually tried that yesterday. For whatever reason, the nsDependentSubstring class doesn't have a .Compare() method. That's where I got stuck... Gecko strings are always a bit of a challenge.
Note that while this bug is (currently) just about ARIA roles, there are quite a few other places where ARIA attribute values are expected to be lower case; true, false, etc. That should mostly be a matter of changing instances of
eCaseMatterstoeIgnoreCase, but there may be some which shouldn't be changed, so each will need to be examined.
Yeah, absolutely.
Comment 8•5 years ago
|
||
Blah. Maybe this?
#include "nsUnicharUtils.h"
...
return Compare(mRole, aEntry.ARIARoleString(), nsCaseInsensitiveStringComparator);
Nice one, Jamie! Worked a treat! I'll hunt around for tests and draft up a patch.
Comment 10•5 years ago
|
||
accessible/tests/mochitest/role/aria.html is probably a reasonable place for role tests.
Updated•5 years ago
|
| Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
| Assignee | ||
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
| bugherder | ||
Description
•