babelacc

compare different implementations of the text alternative computation  https://p.ce9e.org/babelacc/
git clone https://git.ce9e.org/babelacc.git

commit
163d4862ea21152ddc8849c945787860dabe4391
parent
dc0522d1a829dccdefc7fa7c7ed715b10bfe4344
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-11-12 12:20
add implementation links

Diffstat

M src/babel.js 17 ++++++++++++++---

1 files changed, 14 insertions, 3 deletions


diff --git a/src/babel.js b/src/babel.js

@@ -17,6 +17,7 @@ var ex = function(fn, args, _this) {
   17    17 
   18    18 var implementations = [{
   19    19 	name: 'aria-api (0.4.0)',
   -1    20 	url: 'https://github.com/xi/aria-api',
   20    21 	fn: function(el) {
   21    22 		return {
   22    23 			name: ex(ariaApi.getName, [el]),
@@ -26,9 +27,11 @@ var implementations = [{
   26    27 	},
   27    28 }, {
   28    29 	name: 'accdc (2.49)',
   -1    30 	url: 'https://github.com/accdc/w3c-alternative-text-computation',
   29    31 	fn: accdc.calcNames,
   30    32 }, {
   31    33 	name: 'axe (4.0.2)',
   -1    34 	url: 'https://github.com/dequelabs/axe-core',
   32    35 	fn: function(el) {
   33    36 		axe._tree = axe.utils.getFlattenedTree(document.body);
   34    37 		return {
@@ -39,6 +42,7 @@ var implementations = [{
   39    42 	},
   40    43 }, {
   41    44 	name: 'axs (2.12.0)',
   -1    45 	url: 'https://github.com/GoogleChrome/accessibility-developer-tools',
   42    46 	fn: function(el) {
   43    47 		return {
   44    48 			name: ex(axs.properties.findTextAlternatives, [el, {}]),
@@ -53,9 +57,16 @@ var implementations = [{
   53    57 	},
   54    58 }];
   55    59 
   56    -1 var createTd = function(text) {
   -1    60 var createTd = function(text, url) {
   57    61 	var td = document.createElement('td');
   58    -1 	td.textContent = text;
   -1    62 	if (url) {
   -1    63 		var a = document.createElement('a');
   -1    64 		a.href = url;
   -1    65 		a.textContent = text;
   -1    66 		td.append(a);
   -1    67 	} else {
   -1    68 		td.textContent = text;
   -1    69 	}
   59    70 	return td;
   60    71 };
   61    72 
@@ -69,7 +80,7 @@ var run = function(html) {
   69    80 		return Promise.resolve(p).then(function(result) {
   70    81 			var tr = document.createElement('tr');
   71    82 
   72    -1 			tr.appendChild(createTd(impl.name));
   -1    83 			tr.appendChild(createTd(impl.name, impl.url));
   73    84 			tr.appendChild(createTd(result.name));
   74    85 			tr.appendChild(createTd(result.desc));
   75    86 			tr.appendChild(createTd(result.role));