Skip to content

Commit

Permalink
Update /accname/name/comp_tooltip.html (#42093)
Browse files Browse the repository at this point in the history
* Update /accname/name/comp_tooltip.html

* Add role=group to div test

* Add test to check <img> with empty alt

* Update testnames of tests with placeholders
  • Loading branch information
howard-e authored and SkyBlack1225 committed Nov 13, 2023
1 parent a33efd9 commit 0ca5565
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions accname/name/comp_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,39 @@
</head>
<body>

<p>Tests the <a href="https://w3c.github.io/accname/#comp_tooltip">#comp_tooltip</a> portions of the AccName <em>Name Computation</em> algorithm.</p>
<p>Tests the <a href="https://w3c.github.io/accname/#comp_tooltip">#comp_tooltip</a> portions of the AccName <em>Name Computation</em> algorithm.</p>

<a href="#" title="label" data-expectedlabel="label" data-testname="link label from tooltip" class="ex"><img src="#" alt=""></a>
<a href="#" title="label" data-expectedlabel="label" data-testname="link with img with tooltip label" class="ex"><img src="#" alt=""></a>
<a href="#" title="label" data-expectedlabel="label" data-testname="link with text with tooltip label" class="ex">content</a>
<div title="label" role="group" data-expectedlabel="label" data-testname="div with text with tooltip label" class="ex">content</div>
<img src="foo.jpg" title="label" data-expectedlabel="label" data-testname="img with tooltip label without alt" class="ex">
<img src="foo.jpg" title="label" data-expectedlabel="label" alt="" data-testname="img with tooltip label with empty alt" class="ex">
<img src="foo.jpg" title="label" data-expectedlabel="broken" alt="broken" data-testname="img with tooltip label with alt" class="ex">
<img src="foo.jpg" data-expectedlabel="broken" alt="broken" data-testname="img with tooltip label without title" class="ex">

<!-- Todo: test all remaining cases of https://w3c.github.io/accname/#comp_tooltip -->
<textarea title="enter text" data-expectedlabel="enter text" placeholder="textarea" data-testname="textarea with placeholder and tooltip label" class="ex"></textarea>
<input type="text" title="label" data-expectedlabel="label" placeholder="text" data-testname="text input with placeholder and tooltip label" class="ex">
<input type="email" title="label" data-expectedlabel="label" placeholder="email" data-testname="email input with placeholder and tooltip label" class="ex">
<input type="password" title="label" data-expectedlabel="label" placeholder="password" data-testname="password input with placeholder and tooltip label" class="ex">
<input type="checkbox" title="label" data-expectedlabel="label" data-testname="checkbox input with tooltip label" class="ex">
<input type="radio" title="label" data-expectedlabel="label" data-testname="radio input with tooltip label" class="ex">
<button title="label" data-expectedlabel="label" data-testname="button with tooltip label" class="ex">button</button>
<abbr title="Web Platform Tests" data-expectedlabel="Web Platform Tests" data-testname="abbr with tooltip label" class="ex">WPT</abbr>
<kbd title="Control + Option" data-expectedlabel="Control + Option" data-testname="kbd with tooltip label" class="ex">CTRL + OPT</kbd>

<select title="label" data-expectedlabel="label" data-testname="select with tooltip label" class="ex">
<option value="" disabled selected>select options</option>
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>

<details>
<summary title="label" data-expectedlabel="label" data-testname="summary with tooltip label" class="ex">summary</summary>
details
</details>

<iframe title="label" data-expectedlabel="label" data-testname="iframe with tooltip label" width="20px" height="20px" class="ex"></iframe>

<script>
AriaUtils.verifyLabelsBySelector(".ex");
Expand Down

0 comments on commit 0ca5565

Please sign in to comment.