Skip to content

[html-aam PR 395] add validity IDL #2223

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pkra
Copy link
Member

@pkra pkra commented May 24, 2024

Moved from w3c/html-aam#395

WIP for #394

The following tasks have been completed:

  • Modified Web platform tests (link to pull request) - There are not CORE-AAM tests

Implementation commitment:

@pkra pkra changed the base branch from monorepo_history--html-aam to main June 12, 2024 19:21
@pkra
Copy link
Member Author

pkra commented Jun 12, 2024

Now pointing to main.

@pkra pkra changed the title [Monorepo] [html-aam PR 395] add validity IDL [html-aam PR 395] add validity IDL Jun 12, 2024
@scottaohara scottaohara mentioned this pull request Jun 27, 2024
4 tasks
@jnurthen
Copy link
Member

@scottaohara is this ready for merge if we get a reviewer or is it waiting for implementations?

@scottaohara
Copy link
Member

@stevefaulkner you didn't happen to make test files for this, did you?

@spectranaut
Copy link
Contributor

We don't have tests for html-aam in WPT right now.

But this PR was never reviewed, so I added the reviewers from the original PR to this one -- @scottaohara @cookiecrook @cyns can you please take a look?

If reviews are positive, lets open an issue on WebKit and merge.

<td class="uia">Use WAI-ARIA mapping</td>
<td class="atk">Use WAI-ARIA mapping</td>
<td class="ax">Use WAI-ARIA mapping</td>
<td class="comments">If the element has the `validity [IDL]` set and the `aria-invalid` attribute set, User Agents MUST expose only the`validity [IDL]` state.</td>
Copy link
Contributor

@cookiecrook cookiecrook Apr 18, 2025

Choose a reason for hiding this comment

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

I think el.ariaInvalid would stilll need to be exposed… in part because I don't know how to remove it with a HTMLInputElement ILD override, so we could leave it and expose as null. @rahimabdi @annevk what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

It's not entirely clear to me what the requirement here is.

It's also not clear to me why tests couldn't be written for this.

Is the idea that if the form element is considered valid per HTML's requirements, aria-invalid is to be ignored? I think that should happen on the AT layer and attribute reflection shouldn't really be involved in that. (Thus if you set the aria-invalid attribute, the ariaInvalid getter will still reflect that, even if it's valid.)

@rahimabdi
Copy link
Contributor

rahimabdi commented May 7, 2025

The validity IDL override is already implemented in WebKit: https://bugs.webkit.org/show_bug.cgi?id=252549. I've updated the original issue comment as well.

Also noting that, per @cookiecrook's comment, it's not possible for user agents to only expose validity as el.ariaInvalid reflection is separately computed and should remain unaffected. To @annevk's point, the value of aria-invalid could be conveyed using validity as a downstream AT consideration, and it may be more accurate to reference the source of the invalid state which is the :invalid CSS pseudo-class (since the validity IDL attribute reflects CSS :invalid).

I would propose updating the html-aam spec to state something to the effect of:

“Assistive technologies must expose the state of the :invalid CSS pseudo-class (i.e., validity IDL attribute).

Note: The indeterminate IDL html-aam mappings should align in language as well: w3c/html-aam#582.

Tracking related issues:

@annevk
Copy link
Member

annevk commented May 7, 2025

I did not mean to suggest to define it in terms of the :invalid pseudo-class. But rather, to define it in the same terms the :invalid pseudo-class is defined in (and perhaps abstract that set of terms into a shared abstraction). The :invalid pseudo-class, much like the validity IDL attribute, is public API, and is best not relied upon in algorithms.

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

Successfully merging this pull request may close these issues.

8 participants