babelacc

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

commit
6cc3fe635d10cde4d8009d960f37ba01bae00b0f
parent
3d82c243482bb12f0eb1f930f74d1afaa352d7f2
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-03-28 18:16
update accdc to 2.22

Diffstat

M babel.js 43 +++++++++++++++++++++----------------------
M fuzz.js 46 ++++++++++++++++++++++++----------------------
M src/babel.js 2 +-

3 files changed, 46 insertions, 45 deletions


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

@@ -20769,7 +20769,7 @@ module.exports = {
20769 20769   });
20770 20770 })(typeof window === 'object' ? window : this);
20771 20771 },{}],13:[function(require,module,exports){
20772    -1 window.getAccNameVersion = "2.20";
   -1 20772 window.getAccNameVersion = "2.22";
20773 20773 
20774 20774 /*!
20775 20775 CalcNames: The AccName Computation Prototype, compute the Name and Description property values for a DOM node
@@ -21428,6 +21428,7 @@ window.getAccName = calcNames = function(
21428 21428 
21429 21429     // Always include name from content when the referenced node matches list1, as well as when child nodes match those within list3
21430 21430     // Note: gridcell was added to list1 to account for focusable gridcells that match the ARIA 1.0 paradigm for interactive grids.
   -1 21431     // So too was row to match 'name from author' and 'name from content' in accordance with the spec.
21431 21432     var list1 = {
21432 21433       roles: [
21433 21434         "button",
@@ -21441,6 +21442,7 @@ window.getAccName = calcNames = function(
21441 21442         "menuitem",
21442 21443         "menuitemcheckbox",
21443 21444         "menuitemradio",
   -1 21445         "row",
21444 21446         "cell",
21445 21447         "gridcell",
21446 21448         "columnheader",
@@ -21461,11 +21463,13 @@ window.getAccName = calcNames = function(
21461 21463         "h6",
21462 21464         "menuitem",
21463 21465         "option",
   -1 21466         "tr",
21464 21467         "td",
21465 21468         "th"
21466 21469       ]
21467 21470     };
21468 21471     // Never include name from content when current node matches list2
   -1 21472     // The rowgroup role was added to prevent 'name from content' in accordance with relevant ARIA 1.1 spec changes.
21469 21473     var list2 = {
21470 21474       roles: [
21471 21475         "application",
@@ -21503,7 +21507,8 @@ window.getAccName = calcNames = function(
21503 21507         "tabpanel",
21504 21508         "tree",
21505 21509         "treegrid",
21506    -1         "separator"
   -1 21510         "separator",
   -1 21511         "rowgroup"
21507 21512       ],
21508 21513       tags: [
21509 21514         "article",
@@ -21525,10 +21530,13 @@ window.getAccName = calcNames = function(
21525 21530         "math",
21526 21531         "menu",
21527 21532         "nav",
21528    -1         "section"
   -1 21533         "section",
   -1 21534         "thead",
   -1 21535         "tbody",
   -1 21536         "tfoot"
21529 21537       ]
21530 21538     };
21531    -1     // As an override of list2, conditionally include name from content if current node is focusable, or if the current node matches list3 while the referenced parent node matches list1.
   -1 21539     // As an override of list2, conditionally include name from content if current node is focusable, or if the current node matches list3 while the referenced parent node (root node) matches list1.
21532 21540     var list3 = {
21533 21541       roles: [
21534 21542         "term",
@@ -21539,23 +21547,9 @@ window.getAccName = calcNames = function(
21539 21547         "note",
21540 21548         "status",
21541 21549         "table",
21542    -1         "rowgroup",
21543    -1         "row",
21544 21550         "contentinfo"
21545 21551       ],
21546    -1       tags: [
21547    -1         "dl",
21548    -1         "ul",
21549    -1         "ol",
21550    -1         "dd",
21551    -1         "details",
21552    -1         "output",
21553    -1         "table",
21554    -1         "thead",
21555    -1         "tbody",
21556    -1         "tfoot",
21557    -1         "tr"
21558    -1       ]
   -1 21552       tags: ["dl", "ul", "ol", "dd", "details", "output", "table"]
21559 21553     };
21560 21554 
21561 21555     var nativeFormFields = ["button", "input", "select", "textarea"];
@@ -21672,7 +21666,7 @@ window.getAccName = calcNames = function(
21672 21666               [values[i].slice(1), "inherit", "initial", "unset"].indexOf(
21673 21667                 styleObject[prop]
21674 21668               ) === -1) ||
21675    -1               styleObject[prop].indexOf(values[i]) !== -1)
   -1 21669               styleObject[prop].indexOf(values[i]) === 0)
21676 21670           ) {
21677 21671             return true;
21678 21672           }
@@ -21681,7 +21675,12 @@ window.getAccName = calcNames = function(
21681 21675       if (
21682 21676         !cssObj &&
21683 21677         node.nodeName &&
21684    -1         blockElements.indexOf(node.nodeName.toLowerCase()) !== -1
   -1 21678         blockElements.indexOf(node.nodeName.toLowerCase()) !== -1 &&
   -1 21679         !(
   -1 21680           styleObject["display"] &&
   -1 21681           styleObject["display"].indexOf("inline") === 0 &&
   -1 21682           node.nodeName.toLowerCase() !== "br"
   -1 21683         )
21685 21684       ) {
21686 21685         return true;
21687 21686       }
@@ -22048,7 +22047,7 @@ var implementations = {
22048 22047 			role: ex(ariaApi.getRole, [el]),
22049 22048 		};
22050 22049 	},
22051    -1 	'accdc (2.20)': accdc.calcNames,
   -1 22050 	'accdc (2.22)': accdc.calcNames,
22052 22051 	'axe (3.2.2)': function(el) {
22053 22052 		return {
22054 22053 			name: ex(function(el) {

diff --git a/fuzz.js b/fuzz.js

@@ -14,13 +14,14 @@ var run = function(corpus, oracle, covPath, onFingerprint, onReport, done) {
   14    14 	var fingerprints = [];
   15    15 	var queue = [];
   16    16 	var count = 0;
   -1    17 	var batchSize = 10;
   17    18 
   18    19 	corpus.forEach(function(item) {
   19    20 		queue.push(item);
   20    21 	});
   21    22 
   22    23 	var step = function() {
   23    -1 		if (queue.length) {
   -1    24 		for (var i = 0; i < batchSize && queue.length; i++) {
   24    25 			var item = queue.shift();
   25    26 			var report = oracle(item);
   26    27 			var fingerprint = getFingerprint(covPath);
@@ -34,7 +35,9 @@ var run = function(corpus, oracle, covPath, onFingerprint, onReport, done) {
   34    35 					onReport(report);
   35    36 				}
   36    37 			}
   -1    38 		}
   37    39 
   -1    40 		if (queue.length) {
   38    41 			setTimeout(step);
   39    42 		} else {
   40    43 			done();
@@ -831,7 +834,7 @@ module.exports = {
  831   834 };
  832   835 
  833   836 },{}],9:[function(require,module,exports){
  834    -1 window.getAccNameVersion = "2.20";
   -1   837 window.getAccNameVersion = "2.22";
  835   838 
  836   839 /*!
  837   840 CalcNames: The AccName Computation Prototype, compute the Name and Description property values for a DOM node
@@ -1490,6 +1493,7 @@ window.getAccName = calcNames = function(
 1490  1493 
 1491  1494     // Always include name from content when the referenced node matches list1, as well as when child nodes match those within list3
 1492  1495     // Note: gridcell was added to list1 to account for focusable gridcells that match the ARIA 1.0 paradigm for interactive grids.
   -1  1496     // So too was row to match 'name from author' and 'name from content' in accordance with the spec.
 1493  1497     var list1 = {
 1494  1498       roles: [
 1495  1499         "button",
@@ -1503,6 +1507,7 @@ window.getAccName = calcNames = function(
 1503  1507         "menuitem",
 1504  1508         "menuitemcheckbox",
 1505  1509         "menuitemradio",
   -1  1510         "row",
 1506  1511         "cell",
 1507  1512         "gridcell",
 1508  1513         "columnheader",
@@ -1523,11 +1528,13 @@ window.getAccName = calcNames = function(
 1523  1528         "h6",
 1524  1529         "menuitem",
 1525  1530         "option",
   -1  1531         "tr",
 1526  1532         "td",
 1527  1533         "th"
 1528  1534       ]
 1529  1535     };
 1530  1536     // Never include name from content when current node matches list2
   -1  1537     // The rowgroup role was added to prevent 'name from content' in accordance with relevant ARIA 1.1 spec changes.
 1531  1538     var list2 = {
 1532  1539       roles: [
 1533  1540         "application",
@@ -1565,7 +1572,8 @@ window.getAccName = calcNames = function(
 1565  1572         "tabpanel",
 1566  1573         "tree",
 1567  1574         "treegrid",
 1568    -1         "separator"
   -1  1575         "separator",
   -1  1576         "rowgroup"
 1569  1577       ],
 1570  1578       tags: [
 1571  1579         "article",
@@ -1587,10 +1595,13 @@ window.getAccName = calcNames = function(
 1587  1595         "math",
 1588  1596         "menu",
 1589  1597         "nav",
 1590    -1         "section"
   -1  1598         "section",
   -1  1599         "thead",
   -1  1600         "tbody",
   -1  1601         "tfoot"
 1591  1602       ]
 1592  1603     };
 1593    -1     // As an override of list2, conditionally include name from content if current node is focusable, or if the current node matches list3 while the referenced parent node matches list1.
   -1  1604     // As an override of list2, conditionally include name from content if current node is focusable, or if the current node matches list3 while the referenced parent node (root node) matches list1.
 1594  1605     var list3 = {
 1595  1606       roles: [
 1596  1607         "term",
@@ -1601,23 +1612,9 @@ window.getAccName = calcNames = function(
 1601  1612         "note",
 1602  1613         "status",
 1603  1614         "table",
 1604    -1         "rowgroup",
 1605    -1         "row",
 1606  1615         "contentinfo"
 1607  1616       ],
 1608    -1       tags: [
 1609    -1         "dl",
 1610    -1         "ul",
 1611    -1         "ol",
 1612    -1         "dd",
 1613    -1         "details",
 1614    -1         "output",
 1615    -1         "table",
 1616    -1         "thead",
 1617    -1         "tbody",
 1618    -1         "tfoot",
 1619    -1         "tr"
 1620    -1       ]
   -1  1617       tags: ["dl", "ul", "ol", "dd", "details", "output", "table"]
 1621  1618     };
 1622  1619 
 1623  1620     var nativeFormFields = ["button", "input", "select", "textarea"];
@@ -1734,7 +1731,7 @@ window.getAccName = calcNames = function(
 1734  1731               [values[i].slice(1), "inherit", "initial", "unset"].indexOf(
 1735  1732                 styleObject[prop]
 1736  1733               ) === -1) ||
 1737    -1               styleObject[prop].indexOf(values[i]) !== -1)
   -1  1734               styleObject[prop].indexOf(values[i]) === 0)
 1738  1735           ) {
 1739  1736             return true;
 1740  1737           }
@@ -1743,7 +1740,12 @@ window.getAccName = calcNames = function(
 1743  1740       if (
 1744  1741         !cssObj &&
 1745  1742         node.nodeName &&
 1746    -1         blockElements.indexOf(node.nodeName.toLowerCase()) !== -1
   -1  1743         blockElements.indexOf(node.nodeName.toLowerCase()) !== -1 &&
   -1  1744         !(
   -1  1745           styleObject["display"] &&
   -1  1746           styleObject["display"].indexOf("inline") === 0 &&
   -1  1747           node.nodeName.toLowerCase() !== "br"
   -1  1748         )
 1747  1749       ) {
 1748  1750         return true;
 1749  1751       }

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

@@ -23,7 +23,7 @@ var implementations = {
   23    23 			role: ex(ariaApi.getRole, [el]),
   24    24 		};
   25    25 	},
   26    -1 	'accdc (2.20)': accdc.calcNames,
   -1    26 	'accdc (2.22)': accdc.calcNames,
   27    27 	'axe (3.2.2)': function(el) {
   28    28 		return {
   29    29 			name: ex(function(el) {