Commit e11af4e2 authored by Daniil Sakhapov's avatar Daniil Sakhapov Committed by aborovova@mozilla.com
Browse files

Bug 1967287 [wpt PR 52640] - Counter values in alt text invalidation,

Automatic update from web-platform-tests
Counter values in alt text invalidation

Bug: 417488055
Change-Id: I0dd755a37b1780dd4473be545d217f0272fc3eae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6555772


Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1462712}

--

wpt-commits: df1e48b497cc5dd19ba825ff273c5462b7962c87
wpt-pr: 52640

Differential Revision: https://phabricator.services.mozilla.com/D250940
parent 08ec562d
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
<!doctype html>
<title>Name Comp: Name From Alt Counter in Content Invalidation</title>
<meta charset="utf-8">
<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>
<style type="text/css">
.alt-counter::before {
  counter-set: cnt 5051;
  content: "" / counter(cnt);
}
</style>

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

<p>This series of tests exercises the button, heading, and link elements, because each have different characteristics worthy of testing in each of the name computation algorithm scenarios:</p>
<ul>
  <li>button is a leaf node with sub-level elements presentational.</li>
  <li>heading is block level, and can contain sub-level interactives like links.</li>
  <li>link (a[href]) is an interactive inline element that can include non-presentational descendants.</li>
</ul>

<h1>alt counter with ::before</h1>
<button data-expectedlabel="228 label" data-testname="button with alt counter on ::before" class="ex alt-counter">label</button><br>
<h3 data-expectedlabel="228 label" data-testname="heading with alt counter on ::before" class="ex alt-counter">label</h3>
<a href="#" data-expectedlabel="228 label" data-testname="link with alt counter on ::before" class="ex alt-counter">label</a><br>
<br>

<script>
document.documentElement.offsetTop;
let sheet = document.styleSheets[0];
sheet.cssRules[0].style.counterSet = "cnt 228";
document.documentElement.offsetTop;
AriaUtils.verifyLabelsBySelector(".ex");
</script>