Skip to content

Commit e74d46a

Browse files
authored
Do not compute accessible role and name for non-Element nodes in the accessibility locator (#702)
* fix: check for Elements in accessibility and innerText locators * review comments * revert inner text changes
1 parent f3f93f5 commit e74d46a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

index.bs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,21 +3442,25 @@ To <dfn>collect nodes using accessibility attributes</dfn> with given |context n
34423442

34433443
1. Let |match| be true.
34443444

3445-
1. If |selector| [=map/contains=] "<code>role</code>":
3445+
1. If |context node| implements {{Element}}:
34463446

3447-
1. Let |role| be the [=computed role=] of |context node|.
3447+
1. If |selector| [=map/contains=] "<code>role</code>":
34483448

3449-
1. If |selector|["<code>role</code>"] [=is|is not=] |role|:
3449+
1. Let |role| be the [=computed role=] of |context node|.
34503450

3451-
1. Set |match| to false.
3451+
1. If |selector|["<code>role</code>"] [=is|is not=] |role|:
34523452

3453-
1. If |selector| [=map/contains=] "<code>name</code>":
3453+
1. Set |match| to false.
34543454

3455-
1. Let |name| be the [=accessible name=] of |context node|.
3455+
1. If |selector| [=map/contains=] "<code>name</code>":
34563456

3457-
1. If |selector|["<code>name</code>"] [=is|is not=] |name|:
3457+
1. Let |name| be the [=accessible name=] of |context node|.
34583458

3459-
1. Set |match| to false.
3459+
1. If |selector|["<code>name</code>"] [=is|is not=] |name|:
3460+
3461+
1. Set |match| to false.
3462+
3463+
1. Otherwise, set |match| to false.
34603464

34613465
1. If |match| is true:
34623466

0 commit comments

Comments
 (0)