web-platform-tests/interop-accessibility

Remove accname/name/comp_text_node.html tests that assume &nbsp trimming

dandclark opened this issue · 10 comments

Test List

The following tests in accname/name/comp_text_node.html:

  • span[role=button] with text node, with leading/trailing non-breaking space
  • div[role=heading] with text node, with leading/trailing non-breaking space
  • button with text node, with leading/trailing non-breaking space
  • heading with text node, with leading/trailing non-breaking space
  • link with text node, with leading/trailing non-breaking space

Rationale

The tests all validate that   at the beginning and end of a node's computed name is trimmed, e.g.:

<span role="button" tabindex="0" class="ex" data-expectedlabel="button&nbsp;label" data-testname="span[role=button] with text node, with leading/trailing non-breaking space">&nbsp;button&nbsp;label&nbsp;</span>
Chromium and Safari fail the tests because they do not trim the &nbsp;s.

The accname computation steps do not say anything about trimming whitespace from the computed result. I found an older issue seeking clarification about this that is not yet resolved: w3c/accname#95. The WPT utils used for these tests do some of their own whitespace normalizing (added here) but that explicitly does not include non-breaking spaces.

Given that the behavior validated by the tests is not stated in the spec, and web-platform-tests/interop#95 does not seem close to a resolution, I'm proposing that these tests be removed from Interop2024.

cc @cookiecrook

@zcorpan @jcsteh do you have any input on this one?

Who can move this to https://github.com/web-platform-tests/interop-accessibility ? IIRC the test predates a spec clarification that it should be ASCII whitespace.

nt1m commented

Sounds like both the spec & test will be updated here, from what I'm hearing.

Correct. That is the consensus from the ARIA WG call.

@jnurthen asks if there are similar tests for trimming value of html alt attr...

For img alt, HTML differentiates the empty string from any other value -- only the empty string is special.

https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element%3Athe-img-element-11

I plan to work on this imminently.

FWIW, I don't believe a counterpart spec change is needed... Both the published version and the editor's draft reference ASCII whitespace (which does not include non-breaking space) in this step of the AccName algorithm.

https://www.w3.org/TR/accname-1.2/#comp_label
https://w3c.github.io/accname/#comp_label