dom-accessibility-api
Advanced tools
Comparing version 0.5.5 to 0.5.6
# dom-accessibility-api changelog | ||
## 0.5.6 | ||
### Patch Changes | ||
- [#666](https://github.com/eps1lon/dom-accessibility-api/pull/666) [`26ee73d`](https://github.com/eps1lon/dom-accessibility-api/commit/26ee73de9ad6fce27cde0d5ec53a2bc4a12bd879) Thanks [@eps1lon](https://github.com/eps1lon)! - Consider `<label />` when computing the accessible name of `<output />` | ||
Given | ||
```html | ||
<label for="outputid">Output Label</label> <output id="outputid"></output> | ||
``` | ||
Previously the accessible name of the `<output />` would ignore the `<label />`. | ||
However, an [`<output />` is labelable](https://html.spec.whatwg.org/#the-output-element) and therefore the accessible name is now computed using `<label />` elements if they exists. | ||
In this example the accessible name is `"Output Label"`. | ||
## 0.5.5 | ||
@@ -4,0 +20,0 @@ |
@@ -228,4 +228,5 @@ "use strict"; | ||
return (0, _array.default)(labelsProperty); | ||
} | ||
} // polyfill | ||
if (!isLabelableElement(element)) { | ||
@@ -419,18 +420,15 @@ return null; | ||
if ((0, _util.isHTMLInputElement)(node) || (0, _util.isHTMLSelectElement)(node) || (0, _util.isHTMLTextAreaElement)(node)) { | ||
var input = node; | ||
var labels = getLabels(input); | ||
var labels = getLabels(node); | ||
if (labels !== null && labels.length !== 0) { | ||
consultedNodes.add(input); | ||
return (0, _array.default)(labels).map(function (element) { | ||
return computeTextAlternative(element, { | ||
isEmbeddedInLabel: true, | ||
isReferenced: false, | ||
recursion: true | ||
}); | ||
}).filter(function (label) { | ||
return label.length > 0; | ||
}).join(" "); | ||
} | ||
if (labels !== null && labels.length !== 0) { | ||
consultedNodes.add(node); | ||
return (0, _array.default)(labels).map(function (element) { | ||
return computeTextAlternative(element, { | ||
isEmbeddedInLabel: true, | ||
isReferenced: false, | ||
recursion: true | ||
}); | ||
}).filter(function (label) { | ||
return label.length > 0; | ||
}).join(" "); | ||
} // https://w3c.github.io/html-aam/#input-type-image-accessible-name-computation | ||
@@ -437,0 +435,0 @@ // TODO: wpt test consider label elements but html-aam does not mention them |
{ | ||
"name": "dom-accessibility-api", | ||
"description": "Implements https://w3c.github.io/accname/", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"main": "dist/index.js", | ||
@@ -47,3 +47,3 @@ "module": "dist/index.mjs", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/preset-env": "^7.14.2", | ||
"@babel/preset-env": "^7.14.4", | ||
"@babel/preset-typescript": "^7.13.0", | ||
@@ -54,4 +54,4 @@ "@changesets/changelog-github": "^0.4.0", | ||
"@types/jest": "^26.0.23", | ||
"@typescript-eslint/eslint-plugin": "^4.24.0", | ||
"@typescript-eslint/parser": "^4.24.0", | ||
"@typescript-eslint/eslint-plugin": "^4.25.0", | ||
"@typescript-eslint/parser": "^4.25.0", | ||
"concurrently": "^6.2.0", | ||
@@ -58,0 +58,0 @@ "cross-env": "^7.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244246
1910