-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1796016 [wpt PR 36541] - Add basic accname tests for shadow DOM, …
…a=testonly Automatic update from web-platform-tests Add basic accname tests for shadow DOM (#36541) Add basic AccName computedlabel tests for shadow DOM, including slots. Change Author: nolanlawson Reviewed by: cookiecrook Addressed AccName #20 w3c/accname#20 et al -- wpt-commits: 2f89f88e9c36d2c296937788948c841dc5730957 wpt-pr: 36541
- Loading branch information
1 parent
dfce9c8
commit 1d396d9
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
testing/web-platform/tests/accname/name/shadowdom/basic.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="/wai-aria/scripts/aria-utils.js"></script> | ||
|
||
<label id="label1"> | ||
<div id="host1"></div> | ||
</label> | ||
<button id="labelled1" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label1" | ||
data-expectedlabel="foo" | ||
data-testname="aria-labelledby reference to element with text content inside shadow DOM"></button> | ||
|
||
<label id="label2"> | ||
<div id="host2"></div> | ||
</label> | ||
<button id="labelled2" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label2" | ||
data-expectedlabel="bar" | ||
data-testname="aria-labelledby reference to element with aria-label inside shadow DOM"></button> | ||
<script> | ||
|
||
document.getElementById('host1').attachShadow({ mode: 'open' }).innerHTML = 'foo'; | ||
document.getElementById('host2').attachShadow({ mode: 'open' }).innerHTML = '<div aria-label="bar"></div>'; | ||
|
||
AriaUtils.verifyLabelsBySelector('.labelled'); | ||
|
||
</script> |
58 changes: 58 additions & 0 deletions
58
testing/web-platform/tests/accname/name/shadowdom/slot.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="/wai-aria/scripts/aria-utils.js"></script> | ||
|
||
<label id="label1"> | ||
<div id="host1">slotted</div> | ||
</label> | ||
<button id="labelled1" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label1" | ||
data-expectedlabel="foo slotted bar" | ||
data-testname="aria-labelledby reference to element with slotted text content"></button> | ||
|
||
<label id="label2"> | ||
<div id="host2"></div> | ||
</label> | ||
<button id="labelled2" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label2" | ||
data-expectedlabel="foo default bar" | ||
data-testname="aria-labelledby reference to element with default slotted text content"></button> | ||
|
||
<label id="label3"> | ||
<div id="host3">slotted</div> | ||
</label> | ||
<button id="labelled3" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label3" | ||
data-expectedlabel="foo slotted bar" | ||
data-testname="aria-labelledby reference to element with slotted text content and aria-label on slot"></button> | ||
|
||
<label id="label4"> | ||
<div id="host4"></div> | ||
</label> | ||
<button id="labelled4" | ||
class="labelled" | ||
type="button" | ||
aria-labelledby="label4" | ||
data-expectedlabel="foo default bar" | ||
data-testname="aria-labelledby reference to element with default slotted text content and aria-label on slot"></button> | ||
|
||
<script> | ||
|
||
document.getElementById('host1').attachShadow({ mode: 'open' }).innerHTML = 'foo <slot></slot> bar'; | ||
document.getElementById('host2').attachShadow({ mode: 'open' }).innerHTML = 'foo <slot>default</slot> bar'; | ||
document.getElementById('host3').attachShadow({ mode: 'open' }).innerHTML = 'foo <slot aria-label="label"></slot> bar'; | ||
document.getElementById('host4').attachShadow({ mode: 'open' }).innerHTML = 'foo <slot aria-label="label">default</slot> bar'; | ||
|
||
AriaUtils.verifyLabelsBySelector('.labelled'); | ||
|
||
</script> |