- commit
- 2a515eec8a00fc2d145547708b019cb1fbc52e62
- parent
- 530a3449a707a7806f9b2b09a032c1d931a51ce7
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2018-02-03 15:08
add role column
Diffstat
| M | index.html | 1 | + |
| M | lib/axs.js | 2 | ++ |
| M | src/babel.js | 9 | +++++++++ |
3 files changed, 12 insertions, 0 deletions
diff --git a/index.html b/index.html
@@ -24,6 +24,7 @@ 24 24 <th>Implementation</th> 25 25 <th>Name</th> 26 26 <th>Description</th> -1 27 <th>Role</th> 27 28 </tr> 28 29 </thead> 29 30 <tbody id="ba-results">
diff --git a/lib/axs.js b/lib/axs.js
@@ -5,11 +5,13 @@ global.goog = {
5 5 global.axs = {
6 6 browserUtils: {},
7 7 color: {},
-1 8 constants: {},
8 9 dom: {},
9 10 utils: {},
10 11 properties: {},
11 12 };
12 13
-1 14 require('accessibility-developer-tools/src/js/Constants');
13 15 require('accessibility-developer-tools/src/js/AccessibilityUtils');
14 16 require('accessibility-developer-tools/src/js/BrowserUtils');
15 17 require('accessibility-developer-tools/src/js/Color');
diff --git a/src/babel.js b/src/babel.js
@@ -20,6 +20,7 @@ var implementations = {
20 20 return {
21 21 name: ex(ariaApi.getName, [el]),
22 22 desc: ex(ariaApi.getDescription, [el]),
-1 23 role: ex(ariaApi.getRole, [el.children[0]]),
23 24 };
24 25 },
25 26 'accdc': accdc.calcNames,
@@ -27,12 +28,19 @@ var implementations = {
27 28 return {
28 29 name: ex(axe.commons.text.accessibleText, [el]),
29 30 desc: '-',
-1 31 role: el.children[0].getAttribute('role') || ex(axe.commons.aria.implicitRole, [el.children[0]]),
30 32 };
31 33 },
32 34 'axs': function(el) {
33 35 return {
34 36 name: ex(axs.properties.findTextAlternatives, [el, {}]),
35 37 desc: '-',
-1 38 role: ex(function() {
-1 39 var roles = axs.utils.getRoles(el.children[0], true);
-1 40 if (roles) {
-1 41 return roles.roles.map(x => x.name).join(' ');
-1 42 }
-1 43 })
36 44 };
37 45 },
38 46 };
@@ -66,6 +74,7 @@ var run = function(html) {
66 74 tr.appendChild(createTd(key));
67 75 tr.appendChild(createTd(result.name));
68 76 tr.appendChild(createTd(result.desc));
-1 77 tr.appendChild(createTd(result.role));
69 78
70 79 results.appendChild(tr);
71 80 });