testaro 16.3.1 → 16.4.1
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 +1 -1
- package/testaro/focOp.js +9 -5
package/package.json
CHANGED
package/testaro/focOp.js
CHANGED
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
focOp
|
|
3
3
|
Related to Tenon rule 190.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
misclassifying the cursor property values of the computed styles of elements. Launch the
|
|
7
|
-
webkit browser to run this test.
|
|
8
|
-
|
|
9
|
-
This test reports descrepancies between Tab-focusability and operability. The standard
|
|
5
|
+
This test reports discrepancies between Tab-focusability and operability. The standard
|
|
10
6
|
practice is to make focusable elements operable and vice versa. If focusable elements are not
|
|
11
7
|
operable, users are likely to be surprised that nothing happens when they try to operate such
|
|
12
8
|
elements. If operable elements are not focusable, users depending on keyboard navigation are
|
|
@@ -72,11 +68,19 @@ exports.reporter = async (page, withItems) => {
|
|
|
72
68
|
for (const loc of locsAll) {
|
|
73
69
|
// Get data on it.
|
|
74
70
|
const focOpData = await loc.evaluate(element => {
|
|
71
|
+
// Tab index.
|
|
75
72
|
const {tabIndex} = element;
|
|
73
|
+
// Cursor.
|
|
76
74
|
let hasPointer = false;
|
|
77
75
|
if (element.tagName !== 'LABEL') {
|
|
78
76
|
const styleDec = window.getComputedStyle(element);
|
|
79
77
|
hasPointer = styleDec.cursor === 'pointer';
|
|
78
|
+
// If the cursor is a pointer:
|
|
79
|
+
if (hasPointer) {
|
|
80
|
+
// Disregard this if the only reason is inheritance.
|
|
81
|
+
element.parentElement.style.cursor = 'default';
|
|
82
|
+
hasPointer = styleDec.cursor === 'pointer';
|
|
83
|
+
}
|
|
80
84
|
}
|
|
81
85
|
const {tagName} = element;
|
|
82
86
|
return {
|