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

Aligning HTML spec with ARIA's style of DOMString? reflection #2414

Open
rahimabdi opened this issue Jan 24, 2025 · 1 comment
Open

Aligning HTML spec with ARIA's style of DOMString? reflection #2414

rahimabdi opened this issue Jan 24, 2025 · 1 comment
Assignees

Comments

@rahimabdi
Copy link
Contributor

rahimabdi commented Jan 24, 2025

Describe your concern

Many non-enumerated ARIA attributes currently string-reflect as DOMString? (nullable DOMString) such as aria-label. This is desirable to explicitly distinguish when an attribute is missing which returns null for both the content attribute and IDL attribute. To see the IDL attribute type for all ARIA content attributes, please see section 10.1 ARIA Mixin interface.

However, per HTML reflection, DOMString? requires that the content attribute be enumerated. From HTML 2.6.1 Reflecting content attributes in IDL attributes, below is the processing model for the DOMString? getter:

  1. Let element be the result of running this's get the element.

  2. Let contentAttributeValue be the result of running this's get the content attribute.

  3. Let attributeDefinition be the attribute definition of element's content attribute whose namespace is null and local name is the reflected content attribute name.

  4. Assert: attributeDefinition indicates it is an enumerated attribute.

Many ARIA IDL attributes that reflect as DOMString? do not conform with HTML DOMString? reflection due to the assertion failure in step 4 (i.e., attribute is enumerated).

After discussion with @cookiecrook @annevk, one path forward that @annevk is OK with is loosening HTML's reflection model to allow ARIA's IDL use case of string reflection for DOMString? and essentially removing the enumerated attribute assertion check. The primary benefits of this change is closer alignment with the behavior of HTML attributes and HTML's reflection model. If there are no objections from the ARIA WG, I will submit a PR to update the HTML spec's DOMString? reflection model as part of this existing HTML issue: whatwg/html#10037.

Link to the version of the specification or documentation you were looking at at.

Link to documentation: https://w3c.github.io/aria/

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?
Yes

@rahimabdi
Copy link
Contributor Author

This was discussed in the Jan 30 2025 ARIA WG meeting today and there was consensus to move forward with the HTML spec update.

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

No branches or pull requests

1 participant