@qualweb/util 0.7.3 → 0.7.4
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/dist/__webpack/util.bundle.js +1 -1
- package/dist/accessibilityUtils/roles.d.ts +1 -0
- package/dist/accessibilityUtils/roles.d.ts.map +1 -1
- package/dist/accessibilityUtils/roles.js +7 -4
- package/dist/domUtils/isElementVisible.d.ts.map +1 -1
- package/dist/domUtils/isElementVisible.js +7 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/accessibilityUtils/roles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,kBAAkB,EAAE,MAAM,EAAE,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/accessibilityUtils/roles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,kBAAkB,EAAE,MAAM,EAAE,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAkuFnB,CAAC"}
|
|
@@ -211,7 +211,7 @@ exports.roles = {
|
|
|
211
211
|
caption: {
|
|
212
212
|
baseConcept: '',
|
|
213
213
|
attribute: '',
|
|
214
|
-
requiredContextRole: ['figure', 'grid', 'table', '
|
|
214
|
+
requiredContextRole: ['figure', 'grid', 'table', 'treegrid'],
|
|
215
215
|
requiredAria: '',
|
|
216
216
|
supportedAria: [
|
|
217
217
|
'aria-atomic',
|
|
@@ -806,7 +806,8 @@ exports.roles = {
|
|
|
806
806
|
'aria-rowcount'
|
|
807
807
|
],
|
|
808
808
|
implicitValueRoles: [['', '']],
|
|
809
|
-
requiredOwnedElements: ['row', 'rowgroup',
|
|
809
|
+
requiredOwnedElements: ['row', 'rowgroup'],
|
|
810
|
+
allowedOwnedElements: ['caption']
|
|
810
811
|
},
|
|
811
812
|
gridcell: {
|
|
812
813
|
baseConcept: ['td'],
|
|
@@ -2389,7 +2390,8 @@ exports.roles = {
|
|
|
2389
2390
|
'aria-roledescription'
|
|
2390
2391
|
],
|
|
2391
2392
|
implicitValueRoles: [['', '']],
|
|
2392
|
-
requiredOwnedElements: ['row', 'rowgroup']
|
|
2393
|
+
requiredOwnedElements: ['row', 'rowgroup'],
|
|
2394
|
+
allowedOwnedElements: ['caption']
|
|
2393
2395
|
},
|
|
2394
2396
|
tablist: {
|
|
2395
2397
|
baseConcept: '',
|
|
@@ -2693,7 +2695,8 @@ exports.roles = {
|
|
|
2693
2695
|
'aria-rowcount'
|
|
2694
2696
|
],
|
|
2695
2697
|
implicitValueRoles: [['', '']],
|
|
2696
|
-
requiredOwnedElements: ['row', 'rowgroup']
|
|
2698
|
+
requiredOwnedElements: ['row', 'rowgroup'],
|
|
2699
|
+
allowedOwnedElements: ['caption']
|
|
2697
2700
|
},
|
|
2698
2701
|
treeitem: {
|
|
2699
2702
|
baseConcept: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElementVisible.d.ts","sourceRoot":"","sources":["../../src/domUtils/isElementVisible.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"isElementVisible.d.ts","sourceRoot":"","sources":["../../src/domUtils/isElementVisible.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAWrD,iBAAS,gBAAgB,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAYrD;AAYD,eAAe,gBAAgB,CAAC"}
|
|
@@ -5,29 +5,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const elementHasOnePixel_1 = __importDefault(require("./elementHasOnePixel"));
|
|
7
7
|
const elementHasContent_1 = __importDefault(require("./elementHasContent"));
|
|
8
|
+
function isFullyTransparent(element) {
|
|
9
|
+
const opacityProperty = element.getElementStyleProperty('opacity', '');
|
|
10
|
+
return opacityProperty ? parseFloat(opacityProperty) === 0 : false;
|
|
11
|
+
}
|
|
8
12
|
function isElementVisible(element) {
|
|
9
13
|
const offScreen = element.isOffScreen();
|
|
10
14
|
const cssHidden = window.DomUtils.isElementHiddenByCSS(element);
|
|
11
15
|
const hasContent = (0, elementHasContent_1.default)(element, true);
|
|
12
16
|
const hasOnePixelHeight = (0, elementHasOnePixel_1.default)(element);
|
|
13
|
-
const
|
|
14
|
-
let opacity;
|
|
15
|
-
if (opacityProperty) {
|
|
16
|
-
opacity = parseInt(opacityProperty);
|
|
17
|
-
}
|
|
17
|
+
const transparent = isFullyTransparent(element);
|
|
18
18
|
let opaqueParent = false;
|
|
19
19
|
if (element.getElementParent()) {
|
|
20
20
|
opaqueParent = isParentOpaque(element.getElementParent());
|
|
21
21
|
}
|
|
22
|
-
return !(offScreen || hasOnePixelHeight || cssHidden || !hasContent ||
|
|
22
|
+
return !(offScreen || hasOnePixelHeight || cssHidden || !hasContent || transparent || opaqueParent);
|
|
23
23
|
}
|
|
24
24
|
function isParentOpaque(element) {
|
|
25
|
-
|
|
26
|
-
let opacity;
|
|
27
|
-
if (opacityProperty) {
|
|
28
|
-
opacity = parseInt(opacityProperty);
|
|
29
|
-
}
|
|
30
|
-
if (opacity && opacity === 0) {
|
|
25
|
+
if (isFullyTransparent(element)) {
|
|
31
26
|
return true;
|
|
32
27
|
}
|
|
33
28
|
if (element.getElementParent()) {
|