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