testaro 36.1.1 → 36.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "36.1.1",
3
+ "version": "36.1.2",
4
4
  "description": "Run 1000 web accessibility tests from 10 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,11 +28,17 @@
28
28
  */
29
29
 
30
30
  exports.isInlineLink = async loc => await loc.evaluate(element => {
31
+ let listAncestor;
31
32
  // Initialize the link as inline.
32
33
  let result = true;
33
- // If it is in a list item in a list of at least 2 links:
34
- const listAncestor = element.closest('ul, ol');
35
- if (listAncestor) {
34
+ // If its display style property is block:
35
+ const styleDec = window.getComputedStyle(element);
36
+ if (styleDec.display === 'block') {
37
+ // Reclassify the link as non-inline.
38
+ result = false;
39
+ }
40
+ // Otherwise, if it is in a list item in a list of at least 2 links:
41
+ else if (listAncestor = element.closest('ul, ol')) {
36
42
  if (listAncestor.children.length > 1 && Array.from(listAncestor.children).every(child => {
37
43
  const isValidListItem = child.tagName === 'LI';
38
44
  const has1Link = child.querySelectorAll('a').length === 1;