Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a11y: test empty string fallback for CSS content property #44971

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions accname/name/comp_name_from_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
content: " after "; /* [sic] leading and trailing space */
content: " after " / " alt-after "; /* Override the previous line for engines that support the Alternative Text syntax. */
}
.fallback-before-empty::before {
content: "before" / "";
}
.fallback-before-image-empty::before {
content: "before " url(/images/blue.png) / "";
}
.fallback-before-mixed::before {
content: " before "; /* [sic] leading and trailing space */
content: " before " / " start " attr(data-alt-text-before) " end "; /* Override the previous line for engines that support the Alternative Text syntax. */
Expand Down Expand Up @@ -145,6 +151,10 @@ <h3 data-alt-text-before="alt-before" data-alt-text-after="alt-after" data-expec
<a href="#" data-alt-text-before="alt-before" data-alt-text-after="alt-after" data-expectedlabel="start alt-before end label start alt-after end" data-testname="link name from fallback content mixing attr() and strings with ::before and ::after" class="ex fallback-before-mixed fallback-after-mixed">label</a><br>
<br>

<h1>Empty alternative text for CSS content in pseudo-elements when applied to primitive appearance form controls</h1>
<p><input data-expectedlabel="" data-testname="primitive radio input with ::before containing empty alternative text" class="ex fallback-before-empty" type=radio style=appearance:none>
<p><input data-expectedlabel="" data-testname="primitive radio input with ::before containing empty alternative text for an image" class="ex fallback-before-image-empty" type=radio style=appearance:none>

<h1>simple w/ for each child</h1>
<button data-expectedlabel="one two three" data-testname="button name from content for each child" class="ex"><span>one</span> <span>two</span> <span>three</span></button><br>
<h3 data-expectedlabel="one two three" data-testname="heading name from content for each child" class="ex"><span>one</span> <span>two</span> <span>three</span></h3>
Expand Down