Skip to content

Commit

Permalink
update the test case #1974
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Nov 5, 2024
1 parent f647a45 commit 2918ef8
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Issue 741</title>
<title>Issue 741</title
<meta charset="UTF-8" />
<template id="my-list">
<template id="my-list" >
<div>
<slot id="slot1" name="heading"></slot>
</div>
<ul id="debugWalk2">
<ul>
<slot id="slot2"></slot>
</ul>
</template>
Expand Down Expand Up @@ -53,9 +53,9 @@
<body>
<main>
<h1>Test page</h1>
<my-list>
<div role="heading" aria-level="4" slot="heading">Something</div>
<my-list-item role="listitem">Sample item</my-list-item>
<my-list >
<div role="heading" aria-level="4" slot="heading" >Something</div>
<my-list-item role="listitem" >Sample item</my-list-item>
</my-list>
</main>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Issue 741</title>
<meta charset="UTF-8" />
<template id="my-list">
<div>
<slot id="slot1" name="heading"></slot>
</div>
<ul>
<slot id="slot2"></slot>
</ul>
</template>

<template id="my-list-item">
<div>
<a href="https://ibm.com/able">
<slot id="slot3"></slot>
</a>
</div>
</template>
<script>
customElements.define(
"my-list",
class extends HTMLElement {
constructor() {
super();
let template = document.getElementById("my-list");
let templateContent = template.content;

const shadowRoot = this.attachShadow({ mode: "open" });
shadowRoot.appendChild(templateContent.cloneNode(true));
}
}
);

customElements.define(
"my-list-item",
class extends HTMLElement {
constructor() {
super();
let template = document.getElementById("my-list-item");
let templateContent = template.content;

const shadowRoot = this.attachShadow({ mode: "open" });
shadowRoot.appendChild(templateContent.cloneNode(true));
}
}
);
</script>
</head>

<body id="mybody">
<main id="mymain">
<h1>Test page</h1>
<my-list id="mylist">
<div role="heading" aria-level="4" slot="heading" id="'mydev">Something</div>
<my-list-item role="listitem" id="mylistItem">Sample item</my-list-item>
</my-list>
</main>
<script>
UnitTest = {
ruleIds: ["aria_parent_required"],
results: [
{
"ruleId": "aria_parent_required",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/my-list[1]/#document-fragment[1]/ul[1]/slot[1]/my-list-item[1]",
"aria": "/document[1]/main[1]/list[1]/listitem[1]"
},
"reasonId": "Pass_0",
"message": "Rule Passed",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
}
]
};
</script>
</body>
</html>

0 comments on commit 2918ef8

Please sign in to comment.