aria-api

access ARIA information from JavaScript
git clone https://git.ce9e.org/aria-api.git

commit
904bba52e74af266feb3c3c746b6909041f770cb
parent
6284c520f8f9a543a061ce619f538e68450ecafa
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-01-08 07:21
bump version to 0.4.6

Diffstat

M CHANGES.md 9 +++++++++
M dist/aria.js 13 +++++++++++--
M package.json 2 +-

3 files changed, 21 insertions, 3 deletions


diff --git a/CHANGES.md b/CHANGES.md

@@ -1,3 +1,12 @@
   -1     1 0.4.6 (2023-01-08)
   -1     2 ------------------
   -1     3 
   -1     4 -	fix: `img[alt=""]` has role presentation
   -1     5 -	fix handling of whitespace in some places (but still not perfect)
   -1     6 -	only treat direct children of `<details>` as hidden. This is consistent with
   -1     7 	how `display: none` is treated.
   -1     8 
   -1     9 
    1    10 0.4.5 (2022-10-10)
    2    11 ------------------
    3    12 

diff --git a/dist/aria.js b/dist/aria.js

@@ -163,7 +163,7 @@ var getAttribute = function(el, key) {
  163   163 		if (el.matches('noscript')) {
  164   164 			return true;
  165   165 		}
  166    -1 		if (el.matches('details:not([open]) :not(summary)')) {
   -1   166 		if (el.matches('details:not([open]) > :not(summary)')) {
  167   167 			return true;
  168   168 		}
  169   169 		var style = window.getComputedStyle(el);
@@ -528,6 +528,9 @@ exports.roles = {
  528   528 			'selected': 'false',
  529   529 		},
  530   530 	},
   -1   531 	presentation: {
   -1   532 		selectors: ['img[alt=""]'],
   -1   533 	},
  531   534 	progressbar: {
  532   535 		selectors: ['progress'],
  533   536 	},
@@ -932,10 +935,16 @@ var getName = function(el, recursive, visited, directReference) {
  932   935 
  933   936 	// I
  934   937 	// FIXME: presentation not mentioned in the spec
  935    -1 	if (!ret.trim() && !query.matches(el, 'presentation')) {
   -1   938 	if (!ret.trim() && (directReference || !query.matches(el, 'presentation'))) {
  936   939 		ret = el.title || '';
  937   940 	}
  938   941 
   -1   942 	// FIXME: not exactly sure about this, but it reduces the number of failing
   -1   943 	// WPT tests. Whitespace is hard.
   -1   944 	if (!ret.trim()) {
   -1   945 		ret = ' ';
   -1   946 	}
   -1   947 
  939   948 	var before = getPseudoContent(el, ':before');
  940   949 	var after = getPseudoContent(el, ':after');
  941   950 	return before + ret + after;

diff --git a/package.json b/package.json

@@ -1,6 +1,6 @@
    1     1 {
    2     2   "name": "aria-api",
    3    -1   "version": "0.4.5",
   -1     3   "version": "0.4.6",
    4     4   "description": "Access ARIA information from JavaScript",
    5     5   "main": "index.js",
    6     6   "keywords": [