-
Notifications
You must be signed in to change notification settings - Fork 138
Description
Describe the change
The HTML spec recently formalized new WebIDL extended attributes for various types of reflection, such as [ReflectPositive], [ReflectDefault], etc.: whatwg/html#11450. These represent additional ways to define attributes in WebIDL and how the JavaScript property for a content attribute should reflect the value of that content attribute. As a simple example of reflection:
<input type="foo"> // el.type returns "text" which is the invalid value default for the type enumerated attribute See related ARIA IDL updated PR work around conversion of a large set of ARIA attributes to be enumerated, which means they are limited to known values and support two special states: missing value default (i.e., the content attribute is missing) and invalid value default (the content attribute has an unknown value). This HTML spec update now allows referring formally to the [Reflect] WebIDL attribute, which means that the IDL attribute/JS property reflects its content attribute. Chromium/WebKit/Ladybird are already using this [Reflect] WebIDL attribute syntax but it's great to see it officially become part of HTML spec.
There is another draft HTML PR around how reflected enumerated attributes should be standardized that also looks promising, and it formalizes the concepts of [InvalidValueDefault], [MissingValueDefault] and [EmptyValueDefault] (when the attribute is present but without a value, such as boolean-style declaration): whatwg/html#11455.
The ARIA spec's IDL section can reference this new reflection guidance, in addition to future ARIA attributes that should reflect according to the most appropriate IDL type (e.g., numeric types would reflect via [ReflectNonNegative], an enumerated type would reflect as [ReflectEnum], etc.).
Link to the version of the specification or documentation you were looking 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)?
N/A