axe-core 4.3.3-canary.2bdd953 → 4.3.3-canary.2f439b3

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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [4.3.3-canary.2bdd953](https://github.com/dequelabs/axe-core/compare/v4.3.3...v4.3.3-canary.2bdd953) (2021-10-07)
5
+ ### [4.3.3-canary.2f439b3](https://github.com/dequelabs/axe-core/compare/v4.3.3...v4.3.3-canary.2f439b3) (2021-10-08)
6
6
 
7
7
 
8
8
  ### Features
@@ -14,15 +14,18 @@ All notable changes to this project will be documented in this file. See [standa
14
14
  ### Bug Fixes
15
15
 
16
16
  * **aria-allowed-attr:** check for invalid `aria-attributes` for `role="row"` ([#3160](https://github.com/dequelabs/axe-core/issues/3160)) ([cfa900d](https://github.com/dequelabs/axe-core/commit/cfa900d57265907b638dad36ba405a5b40dbde9c))
17
+ * **aria-allowed-children,aria-allowed-parent:** allow group role in listbox ([#3195](https://github.com/dequelabs/axe-core/issues/3195)) ([cb01975](https://github.com/dequelabs/axe-core/commit/cb019755d9cb52b997aae340f406ac26d0cf90e5))
17
18
  * **aria-allowed-role:** Update allowed roles based on ARIA spec updates ([#3124](https://github.com/dequelabs/axe-core/issues/3124)) ([00f6efc](https://github.com/dequelabs/axe-core/commit/00f6efcd55eb0a4c56cc3ca1acc7c79e3d22f58d))
19
+ * **aria-allowed-role:** updates the allowed roles for the wbr element to none and presentation ([#3192](https://github.com/dequelabs/axe-core/issues/3192)) ([2f439b3](https://github.com/dequelabs/axe-core/commit/2f439b3fdb7e7fa3228e663c5313af0f08aa4327)), closes [#3177](https://github.com/dequelabs/axe-core/issues/3177)
18
20
  * **color-contrast:** account for 0 width scroll regions with children ([#3172](https://github.com/dequelabs/axe-core/issues/3172)) ([5908f0d](https://github.com/dequelabs/axe-core/commit/5908f0d644c20e7091329bd8bbeb191837d27feb))
19
21
  * **color-contrast:** account for elements that do not fill entire bounding size ([#3186](https://github.com/dequelabs/axe-core/issues/3186)) ([699697b](https://github.com/dequelabs/axe-core/commit/699697bc237b6c69050e4572ba5cfdc5f338f450))
22
+ * **color-contrast:** properly blend multiple alpha colors ([#3193](https://github.com/dequelabs/axe-core/issues/3193)) ([e930a70](https://github.com/dequelabs/axe-core/commit/e930a7081d4308549370f74e9d341badd9661584))
20
23
  * **d.ts:** Add PartialResults type ([#3126](https://github.com/dequelabs/axe-core/issues/3126)) ([544b6d5](https://github.com/dequelabs/axe-core/commit/544b6d579f3eecf8e102a53a911bbce0bd53b74f))
21
24
  * **is-visible:** do not error if window.Node does not exist ([#3168](https://github.com/dequelabs/axe-core/issues/3168)) ([4046087](https://github.com/dequelabs/axe-core/commit/404608773abf7b4d069a64931adf4ac7e942b663))
22
25
  * **nativeSelectValue:** update selected value on change ([#3154](https://github.com/dequelabs/axe-core/issues/3154)) ([1ee88cb](https://github.com/dequelabs/axe-core/commit/1ee88cb4bb557560f10eab136464c321d4dee81e))
23
- * check for hidden elements on `aria-errormessage` ([#3156](https://github.com/dequelabs/axe-core/issues/3156)) ([95d37dd](https://github.com/dequelabs/axe-core/commit/95d37dd794dc8552d731fabf45244b260da53d8f))
24
26
  * **p-as-heading:** `p-as-heading` rule to account for `textContent` length ([#3145](https://github.com/dequelabs/axe-core/issues/3145)) ([400a230](https://github.com/dequelabs/axe-core/commit/400a2308510246d64d37fac3db375201610cd7e7))
25
27
  * **reporter:** Run inside isolated contexts ([#3129](https://github.com/dequelabs/axe-core/issues/3129)) ([afe6675](https://github.com/dequelabs/axe-core/commit/afe6675d2452089602dcc6c9e931987936e9a55a))
28
+ * check for hidden elements on `aria-errormessage` ([#3156](https://github.com/dequelabs/axe-core/issues/3156)) ([95d37dd](https://github.com/dequelabs/axe-core/commit/95d37dd794dc8552d731fabf45244b260da53d8f))
26
29
  * **typescript:** allow passing a NodeList to ElementContext ([#3161](https://github.com/dequelabs/axe-core/issues/3161)) ([ad4b165](https://github.com/dequelabs/axe-core/commit/ad4b165a0e019cd65f70fa5d085d83cea3e7338c))
27
30
 
28
31
  ### [4.3.3](https://github.com/dequelabs/axe-core/compare/v4.3.2...v4.3.3) (2021-08-24)
package/axe.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! axe v4.3.3-canary.2bdd953
1
+ /*! axe v4.3.3-canary.2f439b3
2
2
  * Copyright (c) 2021 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
@@ -27,7 +27,7 @@
27
27
  return _typeof(obj);
28
28
  }
29
29
  var axe = axe || {};
30
- axe.version = '4.3.3-canary.2bdd953';
30
+ axe.version = '4.3.3-canary.2f439b3';
31
31
  if (typeof define === 'function' && define.amd) {
32
32
  define('axe-core', [], function() {
33
33
  return axe;
@@ -8575,7 +8575,7 @@
8575
8575
  },
8576
8576
  listbox: {
8577
8577
  type: 'composite',
8578
- requiredOwned: [ 'option' ],
8578
+ requiredOwned: [ 'group', 'option' ],
8579
8579
  allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
8580
8580
  superclassRole: [ 'select' ],
8581
8581
  accessibleNameRequired: true
@@ -8676,7 +8676,7 @@
8676
8676
  },
8677
8677
  option: {
8678
8678
  type: 'widget',
8679
- requiredContext: [ 'listbox' ],
8679
+ requiredContext: [ 'group', 'listbox' ],
8680
8680
  allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
8681
8681
  superclassRole: [ 'input' ],
8682
8682
  accessibleNameRequired: true,
@@ -9862,7 +9862,7 @@
9862
9862
  },
9863
9863
  wbr: {
9864
9864
  contentTypes: [ 'phrasing', 'flow' ],
9865
- allowedRoles: true
9865
+ allowedRoles: [ 'presentation', 'none' ]
9866
9866
  }
9867
9867
  };
9868
9868
  var html_elms_default = htmlElms;
@@ -10075,8 +10075,8 @@
10075
10075
  } else {
10076
10076
  colors = [ high, 0, low ];
10077
10077
  }
10078
- return colors.map(function(color10) {
10079
- return Math.round((color10 + base) * 255);
10078
+ return colors.map(function(color11) {
10079
+ return Math.round((color11 + base) * 255);
10080
10080
  }).concat(alpha);
10081
10081
  }
10082
10082
  function Color(red, green, blue, alpha) {
@@ -16834,6 +16834,9 @@
16834
16834
  flattenColors: function flattenColors() {
16835
16835
  return flatten_colors_default;
16836
16836
  },
16837
+ flattenShadowColors: function flattenShadowColors() {
16838
+ return flatten_shadow_colors_default;
16839
+ },
16837
16840
  getBackgroundColor: function getBackgroundColor() {
16838
16841
  return get_background_color_default;
16839
16842
  },
@@ -16951,7 +16954,24 @@
16951
16954
  return null;
16952
16955
  }
16953
16956
  var filtered_rect_stack_default = filteredRectStack;
16957
+ var blendFunctions = {
16958
+ normal: function normal(Cb, Cs) {
16959
+ return Cs;
16960
+ }
16961
+ };
16962
+ function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendMode) {
16963
+ return Math.round(\u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendFunctions[blendMode](Cb, Cs) + (1 - \u03b1s) * \u03b1b * Cb);
16964
+ }
16954
16965
  function flattenColors(fgColor, bgColor) {
16966
+ var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';
16967
+ var r = simpleAlphaCompositing(fgColor.red, fgColor.alpha, bgColor.red, bgColor.alpha, blendMode);
16968
+ var g = simpleAlphaCompositing(fgColor.green, fgColor.alpha, bgColor.green, bgColor.alpha, blendMode);
16969
+ var b = simpleAlphaCompositing(fgColor.blue, fgColor.alpha, bgColor.blue, bgColor.alpha, blendMode);
16970
+ var a = Math.max(0, Math.min(fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha), 1));
16971
+ return new color_default(r, g, b, a);
16972
+ }
16973
+ var flatten_colors_default = flattenColors;
16974
+ function flattenColors2(fgColor, bgColor) {
16955
16975
  var alpha = fgColor.alpha;
16956
16976
  var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
16957
16977
  var g = (1 - alpha) * bgColor.green + alpha * fgColor.green;
@@ -16959,7 +16979,7 @@
16959
16979
  var a = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
16960
16980
  return new color_default(r, g, b, a);
16961
16981
  }
16962
- var flatten_colors_default = flattenColors;
16982
+ var flatten_shadow_colors_default = flattenColors2;
16963
16983
  function contentOverlapping(targetElement, bgNode) {
16964
16984
  var targetRect = targetElement.getClientRects()[0];
16965
16985
  var obscuringElements = shadow_elements_from_point_default(targetRect.left, targetRect.top);
@@ -17030,14 +17050,14 @@
17030
17050
  colorStr = colorStr || style.getPropertyValue('color');
17031
17051
  var _pixels = _slicedToArray(pixels, 3), offsetY = _pixels[0], offsetX = _pixels[1], _pixels$ = _pixels[2], blurRadius = _pixels$ === void 0 ? 0 : _pixels$;
17032
17052
  if ((!minRatio || blurRadius >= fontSize * minRatio) && (!maxRatio || blurRadius < fontSize * maxRatio)) {
17033
- var color10 = textShadowColor({
17053
+ var color11 = textShadowColor({
17034
17054
  colorStr: colorStr,
17035
17055
  offsetY: offsetY,
17036
17056
  offsetX: offsetX,
17037
17057
  blurRadius: blurRadius,
17038
17058
  fontSize: fontSize
17039
17059
  });
17040
- shadowColors.push(color10);
17060
+ shadowColors.push(color11);
17041
17061
  }
17042
17062
  });
17043
17063
  return shadowColors;
@@ -17107,6 +17127,9 @@
17107
17127
  var bgColors = get_text_shadow_colors_default(elm, {
17108
17128
  minRatio: shadowOutlineEmMax
17109
17129
  });
17130
+ if (bgColors.length) {
17131
+ bgColors = [ bgColors.reduce(flatten_shadow_colors_default) ];
17132
+ }
17110
17133
  var elmStack = get_background_stack_default(elm);
17111
17134
  (elmStack || []).some(function(bgElm) {
17112
17135
  var bgElmStyle = window.getComputedStyle(bgElm);
@@ -17118,7 +17141,7 @@
17118
17141
  }
17119
17142
  if (bgColor.alpha !== 0) {
17120
17143
  bgElms.push(bgElm);
17121
- bgColors.push(bgColor);
17144
+ bgColors.unshift(bgColor);
17122
17145
  return bgColor.alpha === 1;
17123
17146
  } else {
17124
17147
  return false;
@@ -17127,8 +17150,10 @@
17127
17150
  if (bgColors === null || elmStack === null) {
17128
17151
  return null;
17129
17152
  }
17130
- bgColors.push(new color_default(255, 255, 255, 1));
17131
- var colors = bgColors.reduce(flatten_colors_default);
17153
+ bgColors.unshift(new color_default(255, 255, 255, 1));
17154
+ var colors = bgColors.reduce(function(bgColor, fgColor) {
17155
+ return flatten_colors_default(fgColor, bgColor);
17156
+ });
17132
17157
  return colors;
17133
17158
  }
17134
17159
  var get_background_color_default = getBackgroundColor;
@@ -17181,7 +17206,7 @@
17181
17206
  var textShadowColors = get_text_shadow_colors_default(node, {
17182
17207
  minRatio: 0
17183
17208
  });
17184
- return [ fgColor ].concat(_toConsumableArray(textShadowColors), [ bgColor ]).reduce(flatten_colors_default);
17209
+ return [ fgColor ].concat(_toConsumableArray(textShadowColors), [ bgColor ]).reduce(flatten_shadow_colors_default);
17185
17210
  }
17186
17211
  return flatten_colors_default(fgColor, bgColor);
17187
17212
  }
@@ -17237,7 +17262,7 @@
17237
17262
  if (shadowColors.length === 0) {
17238
17263
  contrast = get_contrast_default(bgColor, fgColor);
17239
17264
  } else if (fgColor && bgColor) {
17240
- shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(flatten_colors_default);
17265
+ shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(flatten_shadow_colors_default);
17241
17266
  var bgContrast = get_contrast_default(bgColor, shadowColor);
17242
17267
  var fgContrast = get_contrast_default(shadowColor, fgColor);
17243
17268
  contrast = Math.max(bgContrast, fgContrast);