xi / aria-api Goto Github PK
View Code? Open in Web Editor NEWAccess ARIA information from JavaScript
License: MIT License
Access ARIA information from JavaScript
License: MIT License
If you consider the following HTML:
<img src="..." title="title">
<img src="..." alt="" title="title">
<img src="..." alt="alt" title="title">
then the getName()
results for these images should be 'title'
, ''
, and 'alt'
respectively. However the returned results are 'title'
, 'title'
, and 'alt'
.
This is explicitly defined by this specification: https://www.w3.org/TR/html-aam-1.0/#img-element-accessible-name-computation
Hi, thanks for the work on this code. I want to use the getName API for something else that I am building, so i was testing some of the cases and realised that 5.2 was not working.
my tests were
describe('5.2 button input should behave like buttons', () => {
test('it uses value', () => {
document.body.innerHTML = `
<input id="el" type="button" value="the world! dog!"/>
`;
const foundInput = findControl('the world! dog!');
expect(foundInput).toEqual(document.getElementById('el'));
});
test('deafults submit if no content', () => {
document.body.innerHTML = `
<input id="el" type="submit"></input>
`;
const foundInput = findControl('submit');
expect(foundInput).toEqual(document.getElementById('el'));
});
test('deafults reset if no content', () => {
document.body.innerHTML = `
<input id="el" type="reset"></input>
`;
const foundInput = findControl('reset');
expect(foundInput).toEqual(document.getElementById('el'));
});
});
would love to get your thoughts if this should be handled by the tool or if it shouldn't be?
At the moment, implicit aria-level
for headings is simply calculated by using the number from the tag name. This ignores the HTML5 document outline algorithm.
The outline algorithm has never been implemented. But three days ago a new proposal has given new hope to the idea:
https://github.com/whatwg/html/issues/83#issuecomment-359871505
It seems like this is the final attempt. Either the outline algorithm will be removed from the spec (in which case nothing needs to be changed about aria-api) or it will be replaced by a new version that will be easier to implement.
I'm looking to build a tool to evaluate gaps w.r.t 2.5.3: Label in Name in a html page.
I need to get the Visual label matches the Accessible Name, to validate the 2.5.3: Label in Name success criterion.
While I can use the getName(element) to get the element's Accessible Name, I'm looking if there is an api to get the (visual) label for my comparison ?
getName()
on an input
element will return the placeholder
content, which does not appear to be behaviour specified by Accessible Name and Description Computation 1.1 or draft 1.2 as far as I can tell (although it is what Chrome does).
aria-api should be ignoring the contents of <noscript>
elements. These elements turn their contents into text nodes, even though their contents is in fact HTML. So the accessibility name/description end up being a load of gibberish HTML for any element that contains a noscript element.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.