-
Notifications
You must be signed in to change notification settings - Fork 365
Closes issue #141 - only audit IDs in IDREFs #221
Conversation
@@ -54,7 +54,7 @@ axs.AuditRules.addRule({ | |||
} | |||
// If we made it this far then no DOM ancestor has a required scope role. | |||
// Now we need to check if anything aria-owns this element. | |||
var owners = axs.utils.getIdReferrers('aria-owns', element); // there can only be ONE explicit owner but that's a different test | |||
var owners = axs.utils.getAriaIdReferrers(element, 'aria-owns'); // there can only be ONE explicit owner but that's a different test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the API:
axs.utils.getIdReferrers
now returns both HTML and ARIA IDREFs- The old "just return ARIA IDREFs" function is renamed to
getAriaIdReferrers
- I had to reverse the arguments because arg
attributeName
is now optionalopt_attributeName
- I'm operating on the practice of always putting optional arguments last. We could leave it the other way and pass itnull
if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it, thanks!
if (!id) | ||
return null; | ||
id = id.replace(/'/g, "\\'"); // make it safe to use in a selector | ||
var selectorTemplates = ['[contextmenu=\'{id}\']', '[itemref~=\'{id}\']', 'button[form=\'{id}\']', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, got distracted halfway through reviewing this! Could you make these one per line? I realise it'll be a lot of lines (20 or so?), but it's pretty hard to read like this (plus it'll make it easier to add any new ones if we realise something's missing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will do.
return null; | ||
id = id.replace(/'/g, "\\'"); // make it safe to use in a selector | ||
var selectorTemplates = [ | ||
'[contextmenu=\'{id}\']', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to comment the source of this list so we can periodically check that it's up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alice sorry I got sidetracked on other work.
Sorry there is no definitive list I can find for this.
@alice I've addressed your feedback and this should hopefully be good to go? |
👍 Go ahead and merge 😄 |
Closes issue #141 - only audit IDs in IDREFs
Implements the decision in #141
@alice PTAL