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

AccName forces whitespace joiners between all inline element scenarios #205

Open
cookiecrook opened this issue Oct 5, 2023 · 6 comments

Comments

@cookiecrook
Copy link
Contributor

cookiecrook commented Oct 5, 2023

I added the following test case in this WPT PR.

The Rendered content is camel-cased ThisIsBroken but AccName requires it be exposed to Accessibility as T hisI sBro ken

<button data-expectedlabel="T hisI sBro ken" data-testname="button name from content for each child (no space, inline)" class="ex">
  <span>T</span><span>hisI</span><span>sBro</span><span>ken</span>
</button>

The test case is admittedly contrived, but is the ARIA Working Group sure it wants to force whitespace-joiners in all element scenarios, even when the author has removed inter-element whitespace between inline elements? If the web dev needs to style a substring of a word, there is no way for them to remove the extra spaces forced on accessibility users by the algorithm.

FWIW, the AccName algorithm requires the OPPOSITE for pseudo-elements, where joining without space is mandatory, but also seems somewhat arbitrary IMO. I vaguely recall the group said,

~"Well, at least joining without space gives authors a way to choose space, by adding extra whitespace to the CSS content value…"

...and I understand that, but then why is it only for pseudo elements?

[Update: Intention is to align with the pseudo-element behavior, but no changes have landed in the AccName spec yet. See comments below.]

@cookiecrook cookiecrook changed the title Requesting confirmation AccName forces whitespace joiners between all inline element scenarios Oct 5, 2023
@accdc
Copy link
Contributor

accdc commented Oct 5, 2023

I'm confused, I thought years ago we specified that inline elements would be treated as they are rendered visually with no whitespace.

This matches my test using your code example at:
https://whatsock.github.io/w3c-alternative-text-computation/Editable%20Live%20Input%20AccName%20Test.html

When was camel-cased specified to be broken out with whitespace in the algorithm?

@cookiecrook
Copy link
Contributor Author

ARIA WG discussed this morning...

Though there has been discussion of changing the AccName spec to not force this extra whitespace for inline elements, no change has landed in the spec so far. AccName still requires this extra space. (See a variety of discussions and proposals in the whitespace project)

WebKit is in line with the spec (forcing the extra space behavior as described in OP), but Gecko and Chromium appear to have updated to remove the extra space (for inline element), anticipating the spec change in favor of a better user experience despite being against the spec. Though WebKit is the only one to get the inline-block test right.

I'm going to commit the WPT PR with the tests, after updating the first to be inline with the new intention, rather than the spec. And I'll file the bug for WebKit to align with the others, despite the spec being out of date.

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Oct 5, 2023

FYI @twilco

cookiecrook added a commit to cookiecrook/wpt that referenced this issue Oct 5, 2023
@cookiecrook
Copy link
Contributor Author

@aleventhal
Copy link
Contributor

Agree that we need to ensure AccName is aligned with common sense expectation that inline elements don't require the insertion of additional whitespace.

aarongable pushed a commit to chromium/chromium that referenced this issue Oct 10, 2023
While not formalized in the AccName spec yet, there are discussions about adding white-space around inline-block elements.

- w3c/accname#205
- w3c/accname#15
- w3c/accname#3

This change will make Chromium add whitespace around inline-block, inline-grid, inline-table, and inline-flex elements when computing Name from Content. This will let us pass the WPT tests that are in progress of being written: web-platform-tests/wpt#42354

Notes:

- The WPT tests only mention inline-block, and there is no mention of the other inline-* properties yet. I think it's OK that this patch adds whitespace around other inline-* display properties (probably moreso than inline-block) because those properties define special formatting rules for their children, but let me know if you disagree and I can special-case this logic for inline-block.

- It seems that <math> elements have an AtomicInline display type, similar to the other inline-* display types. This means that we start outputting whitespace around <math> elements when computing name from content as well. This feels fine, but as before, let me know if you disagree and I can hardcode what cases are OK. (As an aside, something seems broken with Name from Content when children are MathML? It's preexisting, and should probably be fixed in another CL)

Change-Id: I2a4fc3cf137de5167d160860c1bda5151b38277d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4921470
Commit-Queue: Aaron Leventhal <[email protected]>
Reviewed-by: Aaron Leventhal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1207629}
@cookiecrook
Copy link
Contributor Author

I'm reopening because I think this was closed accidentally without a necessary AccName change. (There was a WPT change though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

3 participants