Skip to content

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

Open
@rahimabdi

Description

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

Metadata

Assignees

Type

No type

Projects

  • Status

    To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions