Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html-aam/accname-computation-by-element/input-image.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Accname computation tests for element: <input type="image"></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
<script src="/html-aam/scripts/html-aam-accname-utils.js"></script>
</head>
<body>
<script>
const testConfig = {
elements: {
'input[type="image"]': { attrs: ['img src']}
},
nameSources: [
'from 2 aria-labelledby refs',
'from 1 aria-labelledby ref',
'from aria-label',
'from 2 labels',
'from 1 label',
'from encapsulating label',
'from alt',
'from empty alt',
'from title',
// 'from browser default',
// 'to be empty'
]
}
/*
PR #44965 TODO: Are browser default names testable?
As of April 2024, default names for <input type="image"> are:
- Chrome: [broken image icon] "Submit"
- Safari: "Submit"
- Firefox: "Submit Query"
*/
/*
PR #44965 TODO: Are null/empty browser names testable?
The remaining accname steps are:
6. If none of the above yield a usable text string there is no
accessible name.
*/
HtmlAamAccnameUtils.buildNameComputationTests(testConfig);
AriaUtils.verifyLabelsBySelector(".ex-label");
</script>
</body>
</html>