dom-accessibility-api
Advanced tools
Comparing version 0.5.12 to 0.5.13
# dom-accessibility-api changelog | ||
## 0.5.13 | ||
### Patch Changes | ||
- [#811](https://github.com/eps1lon/dom-accessibility-api/pull/811) [`5b0f48e`](https://github.com/eps1lon/dom-accessibility-api/commit/5b0f48e0668f77458396723751db498ba74d5686) Thanks [@eps1lon](https://github.com/eps1lon)! - Prefer button subtree over `title` attribute. | ||
```diff | ||
const name = computeAccessibleName(<button title="from-title">from-content</button>); | ||
-'from-title' === name | ||
+'from-content' === name | ||
``` | ||
`<button title="from-title">from-content</button>` would previously compute the accessible name "from-title". | ||
This is correct in ACCNAME 1.2 but is changed in the latest editors draft. | ||
The latest editors draft specifically refers to HTML-AAM which says that the subtree should take precedent over the `title` attribute. | ||
`computeAccessibleName` now calculates "from-content" as the accessible name. | ||
## 0.5.12 | ||
@@ -4,0 +21,0 @@ |
@@ -312,3 +312,3 @@ "use strict"; | ||
return accumulatedText; | ||
return accumulatedText.trim(); | ||
} | ||
@@ -457,2 +457,16 @@ | ||
if ((0, _util.hasAnyConcreteRoles)(node, ["button"])) { | ||
// https://www.w3.org/TR/html-aam-1.0/#button-element | ||
var nameFromSubTree = computeMiscTextAlternative(node, { | ||
isEmbeddedInLabel: false, | ||
isReferenced: false | ||
}); | ||
if (nameFromSubTree !== "") { | ||
return nameFromSubTree; | ||
} | ||
return useAttribute(node, "title"); | ||
} | ||
return useAttribute(node, "title"); | ||
@@ -459,0 +473,0 @@ } |
{ | ||
"name": "dom-accessibility-api", | ||
"description": "Implements https://w3c.github.io/accname/", | ||
"version": "0.5.12", | ||
"version": "0.5.13", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "module": "dist/index.mjs", |
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
267846
2125