axe-core 4.11.0-canary.013461c → 4.11.0-canary.1e10103

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/axe.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! axe v4.11.0-canary.013461c
2
- * Copyright (c) 2015 - 2025 Deque Systems, Inc.
1
+ /*! axe v4.11.0
2
+ * Copyright (c) 2015 - 2026 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
5
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -22,7 +22,7 @@
22
22
  }, _typeof(o);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.11.0-canary.013461c';
25
+ axe.version = '4.11.0';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -16403,7 +16403,10 @@
16403
16403
  prototypeArrayFrom = Array.from;
16404
16404
  Array.from = import_from2['default'];
16405
16405
  }
16406
- var _color2 = new _Color(colorString).to('srgb');
16406
+ var _color2 = new _Color(colorString).toGamut({
16407
+ space: 'srgb',
16408
+ method: 'clip'
16409
+ }).to('srgb');
16407
16410
  if (prototypeArrayFrom) {
16408
16411
  Array.from = prototypeArrayFrom;
16409
16412
  prototypeArrayFrom = null;
@@ -16413,6 +16416,7 @@
16413
16416
  this.b = _color2.b;
16414
16417
  this.alpha = +_color2.alpha;
16415
16418
  } catch (_unused2) {
16419
+ incomplete_data_default.set('colorParse', colorString);
16416
16420
  throw new Error('Unable to parse color "'.concat(colorString, '"'));
16417
16421
  }
16418
16422
  return this;
@@ -16439,9 +16443,9 @@
16439
16443
  key: 'getRelativeLuminance',
16440
16444
  value: function getRelativeLuminance() {
16441
16445
  var rSRGB = this.r, gSRGB = this.g, bSRGB = this.b;
16442
- var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
16443
- var g2 = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
16444
- var b2 = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
16446
+ var r = rSRGB <= .04045 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
16447
+ var g2 = gSRGB <= .04045 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
16448
+ var b2 = bSRGB <= .04045 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
16445
16449
  return .2126 * r + .7152 * g2 + .0722 * b2;
16446
16450
  }
16447
16451
  }, {
@@ -20052,7 +20056,7 @@
20052
20056
  return selectAllRecursive(selectorArr, doc);
20053
20057
  }
20054
20058
  function selectAllRecursive(_ref78, doc) {
20055
- var _ref79 = _toArray(_ref78), selectorStr = _ref79[0], restSelector = _ref79.slice(1);
20059
+ var _ref79 = _toArray(_ref78), selectorStr = _ref79[0], restSelector = _arrayLikeToArray(_ref79).slice(1);
20056
20060
  var elms = doc.querySelectorAll(selectorStr);
20057
20061
  if (restSelector.length === 0) {
20058
20062
  return Array.from(elms);
@@ -24181,9 +24185,17 @@
24181
24185
  bgElms.push(bgElm);
24182
24186
  return null;
24183
24187
  }
24184
- var bgColor = get_own_background_color_default(bgElmStyle);
24185
- if (bgColor.alpha === 0) {
24186
- continue;
24188
+ var bgColor = void 0;
24189
+ try {
24190
+ bgColor = get_own_background_color_default(bgElmStyle);
24191
+ if (bgColor.alpha === 0) {
24192
+ continue;
24193
+ }
24194
+ } catch (error) {
24195
+ if (error && incomplete_data_default.get('colorParse')) {
24196
+ return null;
24197
+ }
24198
+ throw error;
24187
24199
  }
24188
24200
  if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) {
24189
24201
  bgElms.push(bgElm);
@@ -24274,16 +24286,23 @@
24274
24286
  });
24275
24287
  } ];
24276
24288
  var fgColors = [];
24277
- for (var _i24 = 0, _colorStack = colorStack; _i24 < _colorStack.length; _i24++) {
24278
- var colorFn = _colorStack[_i24];
24279
- var _color4 = colorFn();
24280
- if (!_color4) {
24281
- continue;
24289
+ try {
24290
+ for (var _i24 = 0, _colorStack = colorStack; _i24 < _colorStack.length; _i24++) {
24291
+ var colorFn = _colorStack[_i24];
24292
+ var _color4 = colorFn();
24293
+ if (!_color4) {
24294
+ continue;
24295
+ }
24296
+ fgColors = fgColors.concat(_color4);
24297
+ if (_color4.alpha === 1) {
24298
+ break;
24299
+ }
24282
24300
  }
24283
- fgColors = fgColors.concat(_color4);
24284
- if (_color4.alpha === 1) {
24285
- break;
24301
+ } catch (error) {
24302
+ if (error && incomplete_data_default.get('colorParse')) {
24303
+ return null;
24286
24304
  }
24305
+ throw error;
24287
24306
  }
24288
24307
  var fgColor = fgColors.reduce(function(source, backdrop) {
24289
24308
  return _flattenColors(source, backdrop);
@@ -26216,11 +26235,21 @@
26216
26235
  }
26217
26236
  var truncatedResult = Math.floor(contrast2 * 100) / 100;
26218
26237
  var missing;
26238
+ var colorParse;
26219
26239
  if (bgColor === null) {
26220
- missing = incomplete_data_default.get('bgColor');
26240
+ if (incomplete_data_default.get('colorParse')) {
26241
+ missing = 'colorParse';
26242
+ colorParse = incomplete_data_default.get('colorParse');
26243
+ } else {
26244
+ missing = incomplete_data_default.get('bgColor');
26245
+ }
26221
26246
  } else if (!isValid) {
26222
26247
  missing = contrastContributor;
26223
26248
  }
26249
+ if (fgColor === null && incomplete_data_default.get('colorParse')) {
26250
+ missing = 'colorParse';
26251
+ colorParse = incomplete_data_default.get('colorParse');
26252
+ }
26224
26253
  var equalRatio = truncatedResult === 1;
26225
26254
  var shortTextContent = visibleText.length === 1;
26226
26255
  if (equalRatio) {
@@ -26236,7 +26265,8 @@
26236
26265
  fontWeight: bold ? 'bold' : 'normal',
26237
26266
  messageKey: missing,
26238
26267
  expectedContrastRatio: expected + ':1',
26239
- shadowColor: shadowColor ? shadowColor.toHexString() : void 0
26268
+ shadowColor: shadowColor ? shadowColor.toHexString() : void 0,
26269
+ colorParse: colorParse
26240
26270
  });
26241
26271
  if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) {
26242
26272
  missing = null;
@@ -30186,7 +30216,8 @@
30186
30216
  equalRatio: 'Element has a 1:1 contrast ratio with the background',
30187
30217
  shortTextContent: 'Element content is too short to determine if it is actual text content',
30188
30218
  nonBmp: 'Element content contains only non-text characters',
30189
- pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
30219
+ pseudoContent: 'Element\'s background color could not be determined due to a pseudo element',
30220
+ colorParse: 'Could not parse color string ${data.colorParse}'
30190
30221
  }
30191
30222
  }
30192
30223
  },
@@ -30216,7 +30247,8 @@
30216
30247
  equalRatio: 'Element has a 1:1 contrast ratio with the background',
30217
30248
  shortTextContent: 'Element content is too short to determine if it is actual text content',
30218
30249
  nonBmp: 'Element content contains only non-text characters',
30219
- pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
30250
+ pseudoContent: 'Element\'s background color could not be determined due to a pseudo element',
30251
+ colorParse: 'Could not parse color string ${data.colorParse}'
30220
30252
  }
30221
30253
  }
30222
30254
  },
@@ -31109,7 +31141,7 @@
31109
31141
  selector: 'body',
31110
31142
  excludeHidden: false,
31111
31143
  matches: 'is-initiator-matches',
31112
- tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'wcag412', 'EN-301-549', 'EN-9.1.3.1', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
31144
+ tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'wcag412', 'EN-301-549', 'EN-9.1.3.1', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-10.8.1' ],
31113
31145
  all: [],
31114
31146
  any: [ 'aria-hidden-body' ],
31115
31147
  none: []
@@ -31119,7 +31151,7 @@
31119
31151
  selector: '[aria-hidden="true"]',
31120
31152
  matches: 'aria-hidden-focus-matches',
31121
31153
  excludeHidden: false,
31122
- tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
31154
+ tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-10.8.1' ],
31123
31155
  actIds: [ '6cfa84' ],
31124
31156
  all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
31125
31157
  any: [],
@@ -32359,7 +32391,7 @@
32359
32391
  id: 'valid-lang',
32360
32392
  impact: 'serious',
32361
32393
  selector: '[lang]:not(html), [xml\\:lang]:not(html)',
32362
- tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'TTv5', 'TT11.b', 'EN-301-549', 'EN-9.3.1.2', 'ACT', 'RGAAv4', 'RGAA-8.7.1' ],
32394
+ tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'TTv5', 'TT11.b', 'EN-301-549', 'EN-9.3.1.2', 'ACT', 'RGAAv4', 'RGAA-8.8.1' ],
32363
32395
  actIds: [ 'de46e4' ],
32364
32396
  all: [],
32365
32397
  any: [],