Skip to content

Commit

Permalink
Update pattern for role none/generic match. (#42203)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookiecrook authored Oct 10, 2023
1 parent fe042a5 commit 7177c46
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion html-aam/fragile/area-role.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

<map name="areamap">
<area shape="rect" coords="0,0,15,15" href="#" alt="x" data-testname="el-area" data-expectedrole="link" class="ex">
<area shape="rect" coords="15,15,31,31" alt="x" data-testname="el-area-no-href" data-expectedrole="generic" class="ex">
<area shape="rect" coords="15,15,31,31" alt="x" data-testname="el-area-no-href" class="ex-generic">
</map>
<img usemap="#areamap" src="#" style="width: 32px; height: 32px;" alt="x">

<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>

</body>
Expand Down
5 changes: 3 additions & 2 deletions html-aam/roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ <h6 data-testname="el-h6" data-expectedrole="heading" class="ex">x</h6>
<img src="#" alt="x" data-testname="el-img" data-expectedrole="image" class="ex">

<!-- Implementations might also be valid if ignored rather than returning 'none' for the following images. -->
<img src="#" alt data-testname="el-img-alt-no-value" data-expectedrole="none" class="ex">
<img src="#" alt="" data-testname="el-img-empty-alt" data-expectedrole="none" class="ex">
<img src="#" alt data-testname="el-img-alt-no-value" class="ex-generic">
<img src="#" alt="" data-testname="el-img-empty-alt" class="ex-generic">

<input type="button" value="x" data-testname="el-input-button" data-expectedrole="button" class="ex">
<input type="checkbox" data-testname="el-input-checkbox" data-expectedrole="checkbox" class="ex">
Expand Down Expand Up @@ -199,6 +199,7 @@ <h6 data-testname="el-h6" data-expectedrole="heading" class="ex">x</h6>

<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>

</body>
Expand Down
7 changes: 4 additions & 3 deletions wai-aria/role/grid-roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
</div>
</div>

<div role="gridcell" data-testname="orphaned gridcell outside the context of row" data-expectedrole="none" class="ex">x</div>
<div role="rowheader" data-testname="orphaned rowheader outside the context of row" data-expectedrole="none" class="ex">x</div>
<div role="columnheader" data-testname="orphaned columnheader outside the context of row" data-expectedrole="none" class="ex">x</div>
<div role="gridcell" data-testname="orphaned gridcell outside the context of row" class="ex-generic">x</div>
<div role="rowheader" data-testname="orphaned rowheader outside the context of row" class="ex-generic">x</div>
<div role="columnheader" data-testname="orphaned columnheader outside the context of row" class="ex-generic">x</div>

<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>

</body>
Expand Down
7 changes: 4 additions & 3 deletions wai-aria/role/role_none_conflict_resolution.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ <h1 role="none" data-testname="heading role none with global attr aria-label" da

<!-- none with label(global) on paragraph -->
<p role="none" data-testname="p role none with global attr aria-label (prohibited role)" data-expectedrole="paragraph" aria-label="x" class="ex">x</p>
<p role="none" data-testname="p role none without global attr aria-label (prohibited role)" data-expectedrole="none" class="ex">x</p>
<p role="none" data-testname="p role none without global attr aria-label (prohibited role)" class="ex-generic">x</p>

<!-- none with focusable header -->
<h1 role="none" data-testname="focusable heading role none with tabindex=0" data-expectedrole="heading" tabindex="0" class="ex">x</h1>
<h1 role="none" data-testname="focusable heading role none with tabindex=-1" data-expectedrole="heading" tabindex="-1" class="ex">x</h1>
<h1 role="none" data-testname="non-focusable heading role none" data-expectedrole="none" class="ex">x</h1>
<h1 role="none" data-testname="non-focusable heading role none" class="ex-generic">x</h1>

<!-- none with non-global-->
<h1 role="none" data-testname="none with non-global" data-expectedrole="none" class="ex" aria-level="2"> Sample Content </h1>
<h1 role="none" data-testname="none with non-global" class="ex-generic" aria-level="2"> Sample Content </h1>


<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>

</body>
Expand Down
5 changes: 3 additions & 2 deletions wai-aria/role/synonym-roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<!-- spec resolution https://github.com/w3c/core-aam/issues/166 -->

<div role="none" id="none" data-expectedrole="none" data-testname="none role == computedrole none" class="ex">x</div><!-- preferred -->
<div role="presentation" id="presentation" data-expectedrole="none" data-testname="synonym presentation role == computedrole none" class="ex">x</div><!-- synonym -->
<div role="none" id="none" data-testname="none role == computedrole none" class="ex-generic">x</div><!-- preferred -->
<div role="presentation" id="presentation" data-testname="synonym presentation role == computedrole none" class="ex-generic">x</div><!-- synonym -->

<div role="image" id="image" data-expectedrole="image" data-testname="image role == computedrole image" class="ex">x</div><!-- preferred -->
<div role="img" id="img" data-expectedrole="image" data-testname="synonym img role == computedrole image" class="ex">x</div><!-- synonym -->
Expand All @@ -28,6 +28,7 @@

<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>
</body>
</html>

0 comments on commit 7177c46

Please sign in to comment.