Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Interop] Allow later name sources to supersede empty alt attribute
The Host Language Label step [1] of the accname computation algorithm is unclear on whether the empty string should be used if that's what the native markup provides. I've filed an issue to clarify this at [2]. Meanwhile, other engines will allow a source later in the name computation steps to provide a name even if an empty `alt` attribute was set; see results for the "img with tooltip label with empty alt" case in accname/name/comp_tooltip.html [3]. So, switch Blink's behavior to match the other engines. However, we still ensure that `name_source` is still set to `kAttributeExplicitlyEmpty` returning from`AXNodeObject::TextAlternative` if `alt` was set to the empty string and a name was not provided from another source. This is necessary to preserve the behavior where setting `alt=""` causes the image to be treated as presentational and ignored. If a valid name is provided from another source, however, the other name overrides that behavior. [1] https://w3c.github.io/accname/#comp_host_language_label [2] w3c/accname#234 [3] https://wpt.fyi/results/accname/name/comp_tooltip.html?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2024-accessibility Bug: 325612090 Change-Id: I38e510ce27319afad406a9c128a47288c2c087ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5382253 Commit-Queue: Aaron Leventhal <[email protected]> Reviewed-by: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1282227}
- Loading branch information