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

Add name from content tests for CSS text-transform:full-size-kana #47535

Merged

Conversation

adampage
Copy link
Member

@adampage adampage commented Aug 9, 2024

@adampage
Copy link
Member Author

adampage commented Aug 9, 2024

Hi @cookiecrook, I saw that there was already a distinct name_from_content.tentative.html file in the repo, so I globbed on to it. Would it be better to isolate these tests in a new file?

I created 2 subtests for this PR. The first subtest is a straightforward h3 heading that checks its name from contents.

The second subtest is a <ruby> construction. This seemed appropriate at first since full-size-kana was evidently conceived for ruby annotations in the first place? However, all 3 of the elements used there have no ARIA role and therefore do not support name from content, so I suppose this subtest is just straight-up invalid. 😅 Do you think this case is worth testing, and is there some other technique I could use?

@adampage adampage changed the title Name from content full size kana Add name from content tests for CSS text-transform:full-size-kana Aug 9, 2024
@adampage
Copy link
Member Author

adampage commented Aug 9, 2024

Copy link
Contributor

@cookiecrook cookiecrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editorial clarity suggestions. thanks.

Comment on lines 40 to 41
<h1>heading which visually transforms <span lang="ja">びょういん</span> (hospital) to <span lang="ja">びよういん</span> (beauty parlor) using CSS <code>text-transform:full-size-kana</code></h1>
<h3 lang="ja" data-expectedlabel="びょういん" data-testname="heading name from content with text-transform:full-size-kana" class="ex" style="text-transform:full-size-kana;">びょういん</h3>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the second example is more clear why this would happen. Ruby text can be small, so presenting it larger makes it more readable, even though a reader needs to mentally re-convert the text to understand the appropriate meaning.

However, in this first example, why would this ever be used in a heading? Should this subtest also be embedded in an <rt> element for clarity?

Also, these tests are missing sufficient sentence context, so there is no unambiguous "right" answer. Are you able to add enough that any future editors or reviewers of these tests know that the meaning should be "hospital" (not "beauty parlor") and "dragon" (not "reason").

@adampage
Copy link
Member Author

Thanks, @cookiecrook. I’ve added sentence context for both subtests:

  1. びょういんのかんじゃサービス (Hospital patient services)
    in which the transformation of びょういん (hospital) to びよういん (beauty parlor) is unambiguously wrong.

  2. 竜の背に乗る (Ride the dragon‘s back)
    in which the furigana for 竜 is transformed from りゅう (dragon) to りゆう (reason), also plainly wrong.

I also updated the second subtest to enclose the <ruby> in a button, and then tested the accname of that button.

I’m still waiting for all the results to come through, but it’s notable in Safari that the accname of the button ignores the <rp> elements but does roll up the <rt> elements in addition to the kanji they’re annotating. This results in a confusing label of 竜りゆうの背せに乗のる that is both duplicative (it loosely translates to “Ride ride the dragon reason’s back back” 😅) and also allows full-size-kana to transform the AT-exposed text.

@cookiecrook
Copy link
Contributor

cookiecrook commented Aug 12, 2024

Hi @cookiecrook, I saw that there was already a distinct name_from_content.tentative.html file in the repo, so I globbed on to it.

Yes, I would do it the way you did it.

The second subtest is a <ruby> construction. […] 😅 Do you think this case is worth testing, and is there some other technique I could use?

I also initially thought that would be a good test, but a) it's not a name-able element as you've discovered, and b) ruby is ambiguous wrt to labels, so perhaps these subtests should use something simple like a link or a button.

(Note: there are ongoing fixes for the duplicative ruby speech, despite the ambiguity in the spec. Best to avoid those in compartmentalized automation tests in the meantime.)

<h3 lang="ja" data-expectedlabel="びょういんのかんじゃサービス" data-testname="heading name from content with text-transform:full-size-kana" class="ex" style="text-transform:full-size-kana;">びょういんのかんじゃサービス</h3>

<!-- “竜の背に乗る” means “Ride the dragon’s back” -->
<!-- text-transform:full-size-kana incorrectly changes 竜’s <rt> furigana: -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"incorrectly" may be confusing... As it's the correct behavior for rendered text, but should not be transformed in the test exposed to the Accessibility APIs… Note: I expect implementors may have questions about how to achieve this, so it's good this is in a tentative file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here’s another cut at that. I also went ahead and commented out the second subtest.

@adampage adampage requested a review from cookiecrook August 13, 2024 16:58
@cookiecrook cookiecrook merged commit 84ec565 into web-platform-tests:master Aug 13, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add accessibility text-transform test for full-size-kana
4 participants