From 9dc3c11bd905ae338f5c4f4a1acea8d87de026a8 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:35:33 -0600 Subject: [PATCH 1/3] chore: merge master into develop (#4616) From 6c07102b1d29145b8dc5f1d96229f3d0b8b38068 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:07:07 -0600 Subject: [PATCH 2/3] fix(get-ancestry): don't error when there is no parent (#4617) Seems I removed the conditional check on the children lookup during a refactor. Adding it back in and ensuring there's a test so this doesn't happen again. --- lib/core/utils/get-ancestry.js | 2 +- test/core/utils/get-ancestry.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/utils/get-ancestry.js b/lib/core/utils/get-ancestry.js index f3ed38d272..5652c69ac0 100644 --- a/lib/core/utils/get-ancestry.js +++ b/lib/core/utils/get-ancestry.js @@ -9,7 +9,7 @@ function generateAncestry(node) { if ( nodeName !== 'head' && nodeName !== 'body' && - parentNode.children.length > 1 + parentNode?.children.length > 1 ) { const index = Array.prototype.indexOf.call(parentNode.children, node) + 1; nthChild = `:nth-child(${index})`; diff --git a/test/core/utils/get-ancestry.js b/test/core/utils/get-ancestry.js index 071853fb8d..8f570e907a 100644 --- a/test/core/utils/get-ancestry.js +++ b/test/core/utils/get-ancestry.js @@ -26,6 +26,11 @@ describe('axe.utils.getAncestry', () => { assert.isNotNull(document.querySelector(sel1)); }); + it('should not throw when there is no parent', () => { + const node = document.createElement('section'); + assert.doesNotThrow(() => axe.utils.getAncestry(node)); + }); + it('generates selectors of nested shadow trees', () => { const node = document.createElement('section'); fixture.appendChild(node); From 98ca0cdb70924bf4e90f68c9fa80ce065be956fc Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:46:39 -0600 Subject: [PATCH 3/3] chore(release): 4.10.2 --- CHANGELOG.md | 6 ++++++ bower.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- sri-history.json | 4 ++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29dca789b4..e9ddfdcd52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ 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.10.2](https://github.com/dequelabs/axe-core/compare/v4.10.1...v4.10.2) (2024-10-21) + +### Bug Fixes + +- **get-ancestry:** don't error when there is no parent ([#4617](https://github.com/dequelabs/axe-core/issues/4617)) ([6c07102](https://github.com/dequelabs/axe-core/commit/6c07102b1d29145b8dc5f1d96229f3d0b8b38068)) + ### [4.10.1](https://github.com/dequelabs/axe-core/compare/v4.10.0...v4.10.1) (2024-10-16) ### Bug Fixes diff --git a/bower.json b/bower.json index 90cb051ba4..c5be151dbb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "axe-core", - "version": "4.10.1", + "version": "4.10.2", "deprecated": true, "contributors": [ { diff --git a/package-lock.json b/package-lock.json index d644fc18b1..f5e5af0495 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "axe-core", - "version": "4.10.1", + "version": "4.10.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "axe-core", - "version": "4.10.1", + "version": "4.10.2", "license": "MPL-2.0", "devDependencies": { "@axe-core/webdriverjs": "^4.9.0", diff --git a/package.json b/package.json index dae167d915..8d32c615bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "axe-core", "description": "Accessibility engine for automated Web UI testing", - "version": "4.10.1", + "version": "4.10.2", "license": "MPL-2.0", "engines": { "node": ">=4" diff --git a/sri-history.json b/sri-history.json index cfa53c6d9d..26978ba5ce 100644 --- a/sri-history.json +++ b/sri-history.json @@ -386,5 +386,9 @@ "4.10.1": { "axe.js": "sha256-KQDnBck/AyiC+OE3x0AJ/EQYykYTnH+1z7punr4Xc0c=", "axe.min.js": "sha256-OBXf33U9n+qCj0mI9MLkiVyC1nCzabDnmopjyuv1gZ4=" + }, + "4.10.2": { + "axe.js": "sha256-+gZL/deLqt1La/rK9St/UzNzWa4co71yGT5I07FuZuE=", + "axe.min.js": "sha256-tRHNnewBx29LKtFyO2a22zfUwutO0ZkHbhgp2e57deM=" } }