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

feat: add IA2 and ATK mappings for text edit maxlength #522

Closed
wants to merge 3 commits into from

Conversation

smhigley
Copy link

@smhigley smhigley commented Dec 4, 2023

Part of the initial work for w3c/aria#1119

Splitting out each API into a separate PR for ease of review and discussion. I've combined IA2 and ATK here since they generally seem to have the same approach re: Object Attributes, and existing object attributes look like they have the same keys across both APIs


Preview | Diff

@smhigley smhigley requested a review from aleventhal December 4, 2023 23:30
@smhigley smhigley requested a review from joanmarie December 4, 2023 23:34
@smhigley smhigley changed the title feat: add IA2 mappings for text edit maxlength feat: add IA2 and ATK mappings for text edit maxlength Dec 4, 2023
@joanmarie
Copy link
Contributor

Is there going to be a corresponding ARIA property now or in the future? If so, will it be aria-max-edit-chars?

In general, when ARIA properties are exposed as object attributes, the rule tends to be aria-foo is exposed as foo. So if the answer to my second question is "yes", then this change looks good to me. But if the ARIA property will have a different name, please figure out what that is first and update this mapping accordingly.

Thanks for checking!

@smhigley
Copy link
Author

@joanmarie I believe the planned aria attr would be aria-maxlength, should the object attribute just be maxlength then?

max-edit-chars was one of the ones @aleventhal suggested, but that was just a quick chat and not a super in-depth dive. Also if you want this to be a draft until the ARIA attribute is in PR, or go directly to Core AAM, let me know. I just didn't want to hold up browser & screen reader work till the ARIA attribute is added.

@joanmarie
Copy link
Contributor

@joanmarie I believe the planned aria attr would be aria-maxlength, should the object attribute just be maxlength then?

I think so, yes -- unless @aleventhal has a compelling reason why it should be exposed to screen readers as max-edit-chars. As the Orca maintainer, I cannot think of one. But I don't know if there are concerns on the Windows side of things.

I also think this will make it possible for you to get at least one ARIA implementation "for free" (i.e. Gecko). I just loaded the following in Firefox:

data:text/html,<div role="textbox" aria-maxlength="50" aria-doesnotexist="oh really?">foo</div>

Then I used the Accerciser accessibility inspector in Linux to query the properties of the AtspiObject that corresponds to the div:

  • acc.getRole() returns <enum ATSPI_ROLE_ENTRY of type Atspi.Role>
  • acc.queryText().getText(0,-1) returns 'foo'
  • acc.getAttributes() returns ['display:block', 'maxlength:50', 'tag:div', 'doesnotexist:oh really?', 'xml-roles:textbox']

Gecko doesn't sanity-check or rename ARIA attributes to object attributes for ATK or IA2 -- other than stripping off the "aria" prefix -- unless there's a strong reason to do so. 🎉 😁

I just didn't want to hold up browser & screen reader work till the ARIA attribute is added.

Understood. And I don't want to hold up spec work. Perhaps check with @jcsteh at Mozilla regarding his preference and thoughts about max-edit-chars being the attribute to be exposed for HTML?

@jcsteh
Copy link

jcsteh commented Dec 13, 2023

I'd prefer the object attribute to be named according to the ARIA attribute. For example, if it's aria-maxlength, I think the object attribute should be maxlength. Beyond that, I don't have a strong preference what the ARIA attribute is called.

@smhigley
Copy link
Author

@joanmarie / @jcsteh updated to maxlength!

Copy link
Contributor

@joanmarie joanmarie left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! I'll add this to my Orca TODO list.

@jcsteh
Copy link

jcsteh commented Dec 14, 2023

I assume that when we get aria-maxlength, this mapping will be updated so that it simply refers to the ARIA mapping and core-aam will absorb the platform specific guidance here?

@scottaohara
Copy link
Member

@jcsteh yes, that would be the end goal. if an aria attribute is created, then the mappings go into core aam, and html aam is updated to point to that.

@pkra pkra mentioned this pull request May 28, 2024
21 tasks
scottaohara added a commit to w3c/aria that referenced this pull request Jul 11, 2024
@scottaohara
Copy link
Member

closing as this PR has been superseded by w3c/aria#2273

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

Successfully merging this pull request may close these issues.

4 participants