Skip to content

Commit bd03476

Browse files
authored
updates to IDL section per discussion in #1598 (#1633)
1 parent d01bdcd commit bd03476

File tree

1 file changed

+35
-41
lines changed

1 file changed

+35
-41
lines changed

index.html

+35-41
Original file line numberDiff line numberDiff line change
@@ -10201,11 +10201,11 @@ <h3>Value</h3>
1020110201
<p>Value type of the <a>state</a> or <a>property</a>. The value may be one of the following types:</p>
1020210202
<dl>
1020310203
<dt id="valuetype_true-false">true/false</dt>
10204-
<dd>Enumerated value representing either <code>true</code> or <code>false</code>. The default value for this value type is <code>false</code> unless otherwise specified.</dd>
10204+
<dd>Value representing either <code>true</code> or <code>false</code>. The default value for this value type is <code>false</code> unless otherwise specified.</dd>
1020510205
<dt id="valuetype_tristate">tristate</dt>
10206-
<dd>Enumerated value representing <code>true</code>, <code>false</code>, <code>mixed</code>, or <code>undefined</code> values. The default value for this value type is <code>undefined</code> unless otherwise specified.</dd>
10206+
<dd>Value representing <code>true</code>, <code>false</code>, <code>mixed</code>, or <code>undefined</code> values. The default value for this value type is <code>undefined</code> unless otherwise specified.</dd>
1020710207
<dt id="valuetype_true-false-undefined">true/false/undefined</dt>
10208-
<dd>Enumerated value representing <code>true</code>, <code>false</code>, or <code>undefined</code> (not applicable). The default value for this value type is <code>undefined</code> unless otherwise specified. For example, an element with <sref>aria-expanded</sref> set to <code>false</code> is not currently expanded; an element with <sref>aria-expanded</sref> set to <code>undefined</code> is not expandable.</dd>
10208+
<dd>Value representing <code>true</code>, <code>false</code>, or <code>undefined</code> (not applicable). The default value for this value type is <code>undefined</code> unless otherwise specified. For example, an element with <sref>aria-expanded</sref> set to <code>false</code> is not currently expanded; an element with <sref>aria-expanded</sref> set to <code>undefined</code> is not expandable.</dd>
1020910209
<dt id="valuetype_idref">ID reference</dt>
1021010210
<dd>Reference to the ID of another <a>element</a> in the same document</dd>
1021110211
<dt id="valuetype_idref_list">ID reference list</dt>
@@ -10217,56 +10217,50 @@ <h3>Value</h3>
1021710217
<dt id="valuetype_string">string</dt>
1021810218
<dd>Unconstrained value type.</dd>
1021910219
<dt id="valuetype_token">token</dt>
10220-
<dd>One of a limited set of allowed enumerated values. The default value is defined in each attribute's Values table, as specified in the <a href="#enumerated-attribute-values">Enumerated Attribute Values</a> section.</dd>
10220+
<dd>One of a limited set of allowed values. The default value is defined in each attribute's Values table, as specified in the <a href="#enumerated-attribute-values">Attribute Values</a> section.</dd>
1022110221
<dt id="valuetype_token_list"><dfn>token list</dfn></dt>
1022210222
<dd>A list of one or more tokens.</dd>
1022310223
</dl>
1022410224
<p>These are generic types for states and properties, but do not define specific representation. See <a href="#state_property_processing">State and Property Attribute Processing</a> for details on how these values are expressed and handled in host languages.</p>
1022510225
</section>
1022610226
</section>
10227-
<section id="enumerated-attribute-values">
10228-
<h2>Enumerated Attribute Values</h2>
10229-
<p>When the ARIA attribute definition includes a table enumerating the attribute's allowed <span>values</span>,
10230-
that attribute is a nullable <a data-cite="html/common-microsyntaxes.html#enumerated-attribute">enumerated attribute</a>.
10231-
Each value in the table is a keyword for the attribute, mapping to a state of the same name. </p>
10227+
<section>
10228+
<h2>ARIA Attributes</h2>
10229+
<section id="enumerated-attribute-values">
10230+
<h3>Multi-value Attribute Values</h3>
10231+
<p>When the ARIA attribute definition includes a table listing the attribute's allowed <span>values</span>,
10232+
that attribute is a multi-value nullable attribute.
10233+
Each value in the table is a keyword for the attribute, mapping to a state of the same name. </p>
10234+
</section>
1023210235
<section id="idl-reflection-attribute-values">
1023310236
<h3>IDL reflection of ARIA attributes</h3>
1023410237
<p>All ARIA attributes reflect in IDL as [=nullable type|nullable=] {{DOMString}} attributes.
10235-
This includes the boolean-like enumerated <a href="#valuetype_true-false">true/false</a> type, and all other ARIA enumerated attributes.</p>
10238+
This includes the boolean-like <a href="#valuetype_true-false">true/false</a> type, and all other ARIA attributes.</p>
1023610239
<p>Default values from the ARIA values tables MUST NOT reflect to IDL as the
1023710240
<a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> or the
1023810241
<a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> for the attribute.
1023910242
On getting, a missing ARIA attribute will return <code>null</code>. ARIA attributes are not validated on get.
1024010243
If an ARIA value is invalid, on getting, it will return its set value as a literal string, and will not return an invalid value default.</p>
1024110244
</section>
1024210245
<section id="os-aapi-attribute-mapping">
10243-
<h3>Operating System Accessibility API mapping of ARIA enumerated attributes</h3>
10244-
<p>Unlike IDL reflection, operating system accessibility API mappings of ARIA enumerated attributes do have defaults.
10245-
The default values from the ARIA values tables are exposed to the operating system accessibility API as described in
10246+
<h3>Operating System Accessibility API mapping of multi-value ARIA attributes</h3>
10247+
<p>Unlike IDL reflection, operating system accessibility API mappings of ARIA attributes can have defaults.
10248+
Any default values from the ARIA values tables are exposed to the operating system accessibility API as described in
1024610249
[[[#supportedState]]], and in [[[CORE-AAM]]].</p>
1024710250
</section>
1024810251
<section id="enumerated-attribute-values-html">
10249-
<h3>ARIA Enumerated Attributes in HTML</h3>
10250-
<p>As noted in [[[#typemapping]]], attributes are included in host languages, and the syntax for representation of enumerated value types is governed by the host language.</p>
10251-
<p>When the host language is HTML, ARIA enumerated attributes MUST follow the <a data-cite="html/common-dom-interfaces.html#reflecting-content-attributes-in-idl-attributes">HTML rules</a> for reflecting [=nullable type|nullable=] {{DOMString}} IDL attributes current as of September 3, 2021.</p>
10252-
<div class="note informative" data-cite="HTML">
10253-
<p>Below is a copy of the HTML specification text for [=nullable type|nullable=] {{DOMString}} IDL attributes as of September 3, 2021.
10254-
The HTML spec is a living document, and this section may have changed since. Refer to the link above for the most current version.</p>
10255-
10256-
<blockquote>
10257-
a reflecting IDL attribute is a nullable {{DOMString}}
10258-
attribute whose content attribute is an <a data-cite="html/common-microsyntaxes.html#enumerated-attribute">enumerated attribute</a>, then, on getting, if
10259-
the corresponding content attribute is in its <i>missing value default</i> state then the IDL
10260-
attribute must return null, otherwise, the IDL attribute must return the keyword value associated
10261-
with the state the attribute is in. If there are multiple keyword values for the state, then
10262-
return the conforming one. If there are multiple conforming keyword values, then one will be
10263-
designated the <a data-cite="html/common-dom-interfaces.html#canonical-keyword">canonical keyword</a>; choose that one. On setting, if the new value is
10264-
null, the content attribute must be removed, and otherwise, the content attribute must be set to
10265-
the specified new value.
10266-
</blockquote>
10267-
</div>
10252+
<h3>ARIA nullable DOMString Attributes</h3>
10253+
<p>As noted in [[[#typemapping]]], attributes are included in host languages, and the syntax for representation of WAI-ARIA types is governed by the host language.</p>
10254+
<p>The following algorithm should be used for ARIA nullable {{DOMString}} attributes in HTML:</p>
10255+
<p>On getting, if the corresponding content attribute is not present, then the IDL attribute must return null,
10256+
otherwise, the IDL attribute must get the value in a transparent, case-preserving manner.
10257+
On setting, if the new value is null, the content attribute must be removed, and otherwise,
10258+
the content attribute must be set to the specified new value in a transparent, case-preserving manner.</p>
10259+
<p class="note">
10260+
Note: As of ARIA 1.2, all ARIA attributes exposed via IDL are defined as nullable {{DOMStrings}}. This matches the current implementation of all major rendering engines. This specification change should result in no implementation changes; it will merely represent the current reality of web engines.
10261+
However, in a future draft, the ARIA Working Group intends to change several ARIA attributes to non-nullable DOMStrings, and seek implementations. The proposed change will bring ARIA into alignment with the HTML’s usage of <a data-cite="html/common-microsyntaxes.html#enumerated-attribute">enumerated attributes</a>.</p>
1026810262
<section class="informative" id="enumeration-example">
10269-
<h4>Example Enumerated Attribute Usage</h4>
10263+
<h4>Example Attribute Usage</h4>
1027010264
<aside class="example">
1027110265

1027210266
<!-- ReSpec needs these examples to be unindented. -->
@@ -10286,7 +10280,7 @@ <h4>Example Enumerated Attribute Usage</h4>
1028610280

1028710281
<!-- ReSpec needs these examples to be unindented. -->
1028810282
<pre>// aria-busy example
10289-
// true/false ~ enumerated boolean-like nullable string; returns null unless set
10283+
// true/false ~ boolean-like nullable string; returns null unless set
1029010284

1029110285
el.ariaBusy; // null
1029210286

@@ -10298,16 +10292,16 @@ <h4>Example Enumerated Attribute Usage</h4>
1029810292
el.removeAttribute("aria-busy");
1029910293
el.ariaBusy; // null
1030010294

10301-
// Assignment of invalid "busy" value results in invalid value default: string "false".
10295+
// Assignment of invalid "busy" value. Not validated on set or get and the literal string value "busy" is returned.
1030210296
el.setAttribute("aria-busy", "busy");
10303-
el.ariaBusy; // "false"</pre>
10297+
el.ariaBusy; // "busy"</pre>
1030410298

1030510299
</aside>
1030610300
<aside class="example">
1030710301

1030810302
<!-- ReSpec needs these examples to be unindented. -->
1030910303
<pre>// aria-pressed example
10310-
// Tristate ~ enumerated true/false/mixed/undefined string; null if unspecified
10304+
// Tristate ~ true/false/mixed/undefined string; null if unspecified
1031110305

1031210306
// no value has been defined
1031310307
button.ariaPressed; // null
@@ -10318,7 +10312,7 @@ <h4>Example Enumerated Attribute Usage</h4>
1031810312
button.ariaPressed = "false"; // DOM property assignment.
1031910313
button.ariaPressed; // "false"
1032010314

10321-
// Assignment of invalid "foo" value. Not validated on get and the literal string value "foo" is returned.
10315+
// Assignment of invalid "foo" value. Not validated on set or get and the literal string value "foo" is returned.
1032210316
button.ariaPressed = "foo";
1032310317
button.ariaPressed; // "foo" (Note: button is no longer a toggle button.)
1032410318

@@ -11137,7 +11131,7 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2>
1113711131
<sdef>aria-current</sdef>
1113811132
<div class="state-description">
1113911133
<p><a>Indicates</a> the <a>element</a> that represents the current item within a container or set of related elements.</p>
11140-
<p>The <sref>aria-current</sref> <a>attribute</a> is an enumerated type. Any value not included in the list of allowed values SHOULD be treated by <a>assistive technologies</a> as if the value <code>true</code> had been provided. If the attribute is not present or its value is an empty string or <code>undefined</code>, the default value of <code>false</code> applies and the <sref>aria-current</sref> <a>state</a> MUST NOT be exposed by user agents or assistive technologies.</p>
11134+
<p>The <sref>aria-current</sref> <a>attribute</a> is a token type. Any value not included in the list of allowed values SHOULD be treated by <a>assistive technologies</a> as if the value <code>true</code> had been provided. If the attribute is not present or its value is an empty string or <code>undefined</code>, the default value of <code>false</code> applies and the <sref>aria-current</sref> <a>state</a> MUST NOT be exposed by user agents or assistive technologies.</p>
1114111135
<p>The <sref>aria-current</sref> attribute is used when an element within a set of related elements is visually styled to indicate it is the current item in the set. For example:</p>
1114211136
<ul>
1114311137
<li>A <code>page</code> token used to indicate a link within a set of pagination links, where the link is visually styled to represent the currently-displayed page.</li>
@@ -11706,7 +11700,7 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2>
1170611700
<p><a>Indicates</a> the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an <a>element</a>.</p>
1170711701
<p>A popup element usually appears as a block of content that is on top of other content. Authors MUST ensure that the role of the element that serves as the container for the popup content is <rref>menu</rref>, <rref>listbox</rref>, <rref>tree</rref>, <rref>grid</rref>, or <rref>dialog</rref>, and that the value of <code>aria-haspopup</code> matches the role of the popup container.</p>
1170811702
<p>For the popup element to be keyboard accessible, authors SHOULD ensure that the element that can trigger the popup is focusable, that there is a keyboard mechanism for opening the popup, and that the popup element manages focus of all its descendants as described in <a href="#managingfocus">Managing Focus</a>.</p>
11709-
<p>The <code>aria-haspopup</code> property is an enumerated type. <a>User agents</a> MUST treat any value of <code>aria-haspopup</code> that is not included in the list of allowed values, including an empty string, as if the value <code>false</code> had been provided. To provide backward compatibility with ARIA 1.0 content, user agents MUST treat an <code>aria-haspopup</code> value of <code>true</code> as equivalent to a value of <code>menu</code>.</p>
11703+
<p>The <code>aria-haspopup</code> property is a token type. <a>User agents</a> MUST treat any value of <code>aria-haspopup</code> that is not included in the list of allowed values, including an empty string, as if the value <code>false</code> had been provided. To provide backward compatibility with ARIA 1.0 content, user agents MUST treat an <code>aria-haspopup</code> value of <code>true</code> as equivalent to a value of <code>menu</code>.</p>
1171011704
<p><a>Assistive technologies</a> SHOULD NOT expose the <code>aria-haspopup</code> property if it has a value of <code>false</code>.</p>
1171111705
<p class="note">A <rref>tooltip</rref> is not considered to be a popup in this context.</p>
1171211706
<p class="note"><code>aria-haspopup</code> is most relevant to use when there is a visual indicator in the element that triggers the popup.
@@ -11851,7 +11845,7 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2>
1185111845
<p><a>Indicates</a> the entered value does not conform to the format expected by the application. See related <pref>aria-errormessage</pref>.</p>
1185211846
<p>If the value is computed to be invalid or out-of-range, the application author SHOULD set this <a>attribute</a> to <code>true</code>. <a>User agents</a> SHOULD inform the user of the error. Application authors SHOULD provide suggestions for corrections if they are known.</p>
1185311847
<p>When the user attempts to submit data involving a field for which <pref>aria-required</pref> is <code>true</code>, authors MAY use the <sref>aria-invalid</sref> attribute to signal there is an error. However, if the user has not attempted to submit the form, authors SHOULD NOT set the <sref>aria-invalid</sref> attribute on required <a>widgets</a> simply because the user has not yet entered data.</p>
11854-
<p>For future expansion, the <sref>aria-invalid</sref> attribute is an enumerated type. Any value not recognized in the list of allowed <span>values</span> MUST be treated by user agents as if the value <code>true</code> had been provided. If the attribute is not present, or its value is <code>false</code>, or its value is an empty string, the default value of <code>false</code> applies.</p>
11848+
<p>For future expansion, the <sref>aria-invalid</sref> attribute is a token type. Any value not recognized in the list of allowed <span>values</span> MUST be treated by user agents as if the value <code>true</code> had been provided. If the attribute is not present, or its value is <code>false</code>, or its value is an empty string, the default value of <code>false</code> applies.</p>
1185511849
<p class="note">This state is being deprecated as a global state in ARIA 1.2. In future versions it will only be allowed on roles where it is specifically supported.</p>
1185611850
</div>
1185711851
<table class="state-features">

0 commit comments

Comments
 (0)