From aefa9746acab627825e02a003654a4c1837d166b Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:50:17 -0700 Subject: [PATCH 1/6] fix(html-has-lang,frame-test): don't process nested htmls --- lib/rules/frame-tested.json | 2 +- lib/rules/html-has-lang.json | 2 +- test/integration/full/frame-tested/frame-tested-pass.html | 7 +++++++ test/integration/full/html-lang-valid/html-lang-valid.html | 7 +++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/rules/frame-tested.json b/lib/rules/frame-tested.json index c844258d0f..4b3d705cb3 100644 --- a/lib/rules/frame-tested.json +++ b/lib/rules/frame-tested.json @@ -1,7 +1,7 @@ { "id": "frame-tested", "impact": "critical", - "selector": "html, frame, iframe", + "selector": "html:not(html *), frame, iframe", "tags": ["cat.structure", "best-practice", "review-item"], "metadata": { "description": "Ensure +
+ diff --git a/test/integration/full/html-lang-valid/html-lang-valid.html b/test/integration/full/html-lang-valid/html-lang-valid.html index fd19053747..2833e2afed 100644 --- a/test/integration/full/html-lang-valid/html-lang-valid.html +++ b/test/integration/full/html-lang-valid/html-lang-valid.html @@ -22,9 +22,16 @@ +
+ From cc5ab4d62f946cd94690b8d08b2147e62ec16bd8 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:56:01 -0700 Subject: [PATCH 2/6] update all selectors that use html --- lib/rules/bypass.json | 2 +- lib/rules/css-orientation-lock.json | 2 +- lib/rules/document-title.json | 2 +- lib/rules/frame-focusable-content.json | 2 +- lib/rules/html-lang-valid.json | 2 +- lib/rules/html-xml-lang-mismatch.json | 2 +- lib/rules/landmark-one-main.json | 2 +- lib/rules/page-has-heading-one.json | 2 +- test/integration/full/bypass/header1.html | 7 +++++++ test/integration/full/css-orientation-lock/passes.html | 7 +++++++ test/integration/full/frame-tested/frame-tested-pass.html | 2 +- test/integration/full/html-lang-valid/html-lang-valid.html | 2 +- .../full/landmark-one-main/landmark-one-main-pass1.html | 7 +++++++ .../page-has-heading-one/page-has-heading-one-pass1.html | 7 +++++++ 14 files changed, 38 insertions(+), 10 deletions(-) diff --git a/lib/rules/bypass.json b/lib/rules/bypass.json index 66eeed206a..286ae3e692 100644 --- a/lib/rules/bypass.json +++ b/lib/rules/bypass.json @@ -1,7 +1,7 @@ { "id": "bypass", "impact": "serious", - "selector": "html", + "selector": "html:not(html *)", "pageLevel": true, "matches": "bypass-matches", "reviewOnFail": true, diff --git a/lib/rules/css-orientation-lock.json b/lib/rules/css-orientation-lock.json index ed7f7e6cb6..3061e29e01 100644 --- a/lib/rules/css-orientation-lock.json +++ b/lib/rules/css-orientation-lock.json @@ -1,7 +1,7 @@ { "id": "css-orientation-lock", "impact": "serious", - "selector": "html", + "selector": "html:not(html *)", "tags": [ "cat.structure", "wcag134", diff --git a/lib/rules/document-title.json b/lib/rules/document-title.json index d540894cbd..27f888adbd 100644 --- a/lib/rules/document-title.json +++ b/lib/rules/document-title.json @@ -1,7 +1,7 @@ { "id": "document-title", "impact": "serious", - "selector": "html", + "selector": "html:not(html *)", "matches": "is-initiator-matches", "tags": [ "cat.text-alternatives", diff --git a/lib/rules/frame-focusable-content.json b/lib/rules/frame-focusable-content.json index adff77b98a..f646e9a141 100644 --- a/lib/rules/frame-focusable-content.json +++ b/lib/rules/frame-focusable-content.json @@ -1,7 +1,7 @@ { "id": "frame-focusable-content", "impact": "serious", - "selector": "html", + "selector": "html:not(html *)", "matches": "frame-focusable-content-matches", "tags": [ "cat.keyboard", diff --git a/lib/rules/html-lang-valid.json b/lib/rules/html-lang-valid.json index 3245ef4c62..01d40116a3 100644 --- a/lib/rules/html-lang-valid.json +++ b/lib/rules/html-lang-valid.json @@ -1,7 +1,7 @@ { "id": "html-lang-valid", "impact": "serious", - "selector": "html[lang]:not([lang=\"\"]), html[xml\\:lang]:not([xml\\:lang=\"\"])", + "selector": "html[lang]:not([lang=\"\"]):not(html *), html[xml\\:lang]:not([xml\\:lang=\"\"]):not(html *)", "tags": [ "cat.language", "wcag2a", diff --git a/lib/rules/html-xml-lang-mismatch.json b/lib/rules/html-xml-lang-mismatch.json index 6003e1247b..b656ad2a0d 100644 --- a/lib/rules/html-xml-lang-mismatch.json +++ b/lib/rules/html-xml-lang-mismatch.json @@ -1,7 +1,7 @@ { "id": "html-xml-lang-mismatch", "impact": "moderate", - "selector": "html[lang][xml\\:lang]", + "selector": "html[lang][xml\\:lang]:not(html *)", "matches": "xml-lang-mismatch-matches", "tags": [ "cat.language", diff --git a/lib/rules/landmark-one-main.json b/lib/rules/landmark-one-main.json index feecb55332..34584d5b3d 100644 --- a/lib/rules/landmark-one-main.json +++ b/lib/rules/landmark-one-main.json @@ -1,7 +1,7 @@ { "id": "landmark-one-main", "impact": "moderate", - "selector": "html", + "selector": "html:not(html *)", "tags": ["cat.semantics", "best-practice"], "metadata": { "description": "Ensure the document has a main landmark", diff --git a/lib/rules/page-has-heading-one.json b/lib/rules/page-has-heading-one.json index 7cc81f75b1..9bd906c09a 100644 --- a/lib/rules/page-has-heading-one.json +++ b/lib/rules/page-has-heading-one.json @@ -1,7 +1,7 @@ { "id": "page-has-heading-one", "impact": "moderate", - "selector": "html", + "selector": "html:not(html *)", "tags": ["cat.semantics", "best-practice"], "metadata": { "description": "Ensure that the page, or at least one of its frames contains a level-one heading", diff --git a/test/integration/full/bypass/header1.html b/test/integration/full/bypass/header1.html index ab3b9b91ab..018a5bf2db 100644 --- a/test/integration/full/bypass/header1.html +++ b/test/integration/full/bypass/header1.html @@ -27,5 +27,12 @@

This header will make the test pass.

+
+ diff --git a/test/integration/full/css-orientation-lock/passes.html b/test/integration/full/css-orientation-lock/passes.html index aa006af276..cde9f1d9a6 100644 --- a/test/integration/full/css-orientation-lock/passes.html +++ b/test/integration/full/css-orientation-lock/passes.html @@ -26,5 +26,12 @@ +
+ diff --git a/test/integration/full/frame-tested/frame-tested-pass.html b/test/integration/full/frame-tested/frame-tested-pass.html index 8c9d86eb90..2600233100 100644 --- a/test/integration/full/frame-tested/frame-tested-pass.html +++ b/test/integration/full/frame-tested/frame-tested-pass.html @@ -21,11 +21,11 @@ -
+
+
+
+ diff --git a/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html b/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html index 8ded48e7ad..b61de066d8 100644 --- a/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html +++ b/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html @@ -25,5 +25,12 @@ +
+ From b5ca2bdd780598a35d4792ee44ce485820c6c7b9 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:57:30 -0700 Subject: [PATCH 3/6] forgot one --- .../integration/full/html-has-lang/html-has-lang-pass.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/full/html-has-lang/html-has-lang-pass.html b/test/integration/full/html-has-lang/html-has-lang-pass.html index ef6ad8a5b0..a09082d58e 100644 --- a/test/integration/full/html-has-lang/html-has-lang-pass.html +++ b/test/integration/full/html-has-lang/html-has-lang-pass.html @@ -30,5 +30,12 @@ +
+ From 83a284035c86332b1addc426be3a8a9f1a5c0412 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:58:20 -0700 Subject: [PATCH 4/6] another --- .../full/document-title/document-title-pass.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/full/document-title/document-title-pass.html b/test/integration/full/document-title/document-title-pass.html index a18d8ded73..d85f42e194 100644 --- a/test/integration/full/document-title/document-title-pass.html +++ b/test/integration/full/document-title/document-title-pass.html @@ -25,5 +25,12 @@ +
+ From 8f996bc692020af095beaa783d36b37b343471ba Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:26:30 -0700 Subject: [PATCH 5/6] fix selector in test --- test/integration/full/bypass/header1.html | 6 +++--- test/integration/full/bypass/header2.html | 7 +++++++ test/integration/full/bypass/pass-tests.js | 2 +- .../full/document-title/document-title-pass.html | 6 +++--- test/integration/full/frame-tested/frame-tested-pass.html | 6 +++--- .../integration/full/html-has-lang/html-has-lang-pass.html | 6 +++--- test/integration/full/html-lang-valid/html-lang-valid.html | 6 +++--- .../full/landmark-one-main/landmark-one-main-pass1.html | 6 +++--- .../page-has-heading-one/page-has-heading-one-pass1.html | 6 +++--- 9 files changed, 29 insertions(+), 22 deletions(-) diff --git a/test/integration/full/bypass/header1.html b/test/integration/full/bypass/header1.html index 018a5bf2db..cd71042803 100644 --- a/test/integration/full/bypass/header1.html +++ b/test/integration/full/bypass/header1.html @@ -24,9 +24,6 @@

This header will make the test pass.

stuff
- - -
+ + + diff --git a/test/integration/full/bypass/header2.html b/test/integration/full/bypass/header2.html index c7a7c3b249..ea9bbc3209 100644 --- a/test/integration/full/bypass/header2.html +++ b/test/integration/full/bypass/header2.html @@ -24,6 +24,13 @@

This header will make the test pass.

stuff
+
+ diff --git a/test/integration/full/bypass/pass-tests.js b/test/integration/full/bypass/pass-tests.js index 7b56d6a4d9..a01b7a1896 100644 --- a/test/integration/full/bypass/pass-tests.js +++ b/test/integration/full/bypass/pass-tests.js @@ -26,7 +26,7 @@ describe('bypass aria header test ' + window.location.pathname, function () { }); it('should find html', function () { - assert.deepEqual(results.passes[0].nodes[0].target, ['html']); + assert.deepEqual(results.passes[0].nodes[0].target, ['html[lang="en"]']); }); }); }); diff --git a/test/integration/full/document-title/document-title-pass.html b/test/integration/full/document-title/document-title-pass.html index d85f42e194..538019a679 100644 --- a/test/integration/full/document-title/document-title-pass.html +++ b/test/integration/full/document-title/document-title-pass.html @@ -22,9 +22,6 @@
- - -
+ + + diff --git a/test/integration/full/frame-tested/frame-tested-pass.html b/test/integration/full/frame-tested/frame-tested-pass.html index 2600233100..0574199d27 100644 --- a/test/integration/full/frame-tested/frame-tested-pass.html +++ b/test/integration/full/frame-tested/frame-tested-pass.html @@ -22,9 +22,6 @@
- - -
+ + + diff --git a/test/integration/full/html-has-lang/html-has-lang-pass.html b/test/integration/full/html-has-lang/html-has-lang-pass.html index a09082d58e..73c02c2827 100644 --- a/test/integration/full/html-has-lang/html-has-lang-pass.html +++ b/test/integration/full/html-has-lang/html-has-lang-pass.html @@ -27,9 +27,6 @@ -->
- - -
+ + + diff --git a/test/integration/full/html-lang-valid/html-lang-valid.html b/test/integration/full/html-lang-valid/html-lang-valid.html index d67f745594..19a6e71908 100644 --- a/test/integration/full/html-lang-valid/html-lang-valid.html +++ b/test/integration/full/html-lang-valid/html-lang-valid.html @@ -23,9 +23,6 @@
- - -
+ + + diff --git a/test/integration/full/landmark-one-main/landmark-one-main-pass1.html b/test/integration/full/landmark-one-main/landmark-one-main-pass1.html index 9e01e3c549..5416dc2761 100644 --- a/test/integration/full/landmark-one-main/landmark-one-main-pass1.html +++ b/test/integration/full/landmark-one-main/landmark-one-main-pass1.html @@ -22,9 +22,6 @@

No main content

- - -
+ + + diff --git a/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html b/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html index b61de066d8..aa51dbe768 100644 --- a/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html +++ b/test/integration/full/page-has-heading-one/page-has-heading-one-pass1.html @@ -22,9 +22,6 @@

No h1 content

- - -
+ + + From 768d7b0e19659af8a5961e4c006d8c1c8caff5ac Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:37:14 -0700 Subject: [PATCH 6/6] fix --- test/integration/full/bypass/header2.html | 7 ------- test/integration/full/bypass/pass-tests.js | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/test/integration/full/bypass/header2.html b/test/integration/full/bypass/header2.html index ea9bbc3209..c7a7c3b249 100644 --- a/test/integration/full/bypass/header2.html +++ b/test/integration/full/bypass/header2.html @@ -24,13 +24,6 @@

This header will make the test pass.

stuff
-
- diff --git a/test/integration/full/bypass/pass-tests.js b/test/integration/full/bypass/pass-tests.js index a01b7a1896..eff2289cbc 100644 --- a/test/integration/full/bypass/pass-tests.js +++ b/test/integration/full/bypass/pass-tests.js @@ -26,7 +26,7 @@ describe('bypass aria header test ' + window.location.pathname, function () { }); it('should find html', function () { - assert.deepEqual(results.passes[0].nodes[0].target, ['html[lang="en"]']); + assert.isTrue(results.passes[0].nodes[0].target[0].startsWith('html')); }); }); });