Skip to content

Commit

Permalink
ACTION-1606,1493/ISSUE-646: Implicit values for valuemin, max, and now.
Browse files Browse the repository at this point in the history
Added rules for implicit values of aria-valuemin, aria-valuemax, and
aria-valuenow when used with roles that require them, namely scrollbar,
sider, and spinbutton.
  • Loading branch information
klown committed Jun 25, 2015
1 parent adcee80 commit e7883a9
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions aria/aria.html
Expand Up @@ -5827,6 +5827,14 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
<p>A graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area.</p>
<p>A scrollbar represents the current value and range of possible values via the size of the scrollbar and position of the thumb with respect to the visible range of the orientation (horizontal or vertical) it controls. Its orientation represents the orientation of the scrollbar and the scrolling effect on the viewing area controlled by the scrollbar. It is typically possible to add or subtract to the current value by using directional keys such as arrow keys.</p>
<p>Authors MUST set the <pref>aria-controls</pref> attribute on the scrollbar element to reference the scrollable area it controls.</p>
<p>Authors MUST set the <pref>aria-valuemin</pref>, <pref>aria-valuemax</pref>, and <pref>aria-valuenow</pref> attributes. If missing, their implicit values follow the same rules as the <a href="http://www.w3.org/TR/html5/forms.html#range-state-%28type=range%29" title="Range state">HTML range input type</a>:</p>
<ul>
<li>If <code>aria-valuemin</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 0 (zero). </li>
<li>If <code>aria-valuemax</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 100. </li>
<li>If <code>aria-valuenow</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to the value half way between <code>aria-valuemin</code> and <code>aria-valuemax</code>. </li>
<li>If <code>aria-valuenow</code> is present but less than <code>aria-valuemin</code>, it defaults to the value of <code>aria-valuemin</code>. </li>
<li>If <code>aria-valuenow</code> is present but greater than <code>aria-valuemax</code>, it defaults to the value of <code>aria-valuemax</code>. </li>
</ul>
<p class="note">Elements with the role <rref>scrollbar</rref> have an implicit <pref>aria-orientation</pref> value of <code>vertical</code>.</p>
<p class="note">Assistive technologies generally will render the value of <pref>aria-valuenow</pref> as a percent of a tange between the value of <pref>aria-valuemin</pref> and <pref>aria-valuemax</pref>, unless <pref>aria-valuetext</pref> is specified. It is best to set the values for <pref>aria-valuemin</pref>, <pref>aria-valuemax</pref>, and <pref>aria-valuenow</pref> in a manner that is appropriate for this calculation.</p>
</div>
Expand Down Expand Up @@ -5912,7 +5920,12 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
</tr>
<tr>
<th class="implicit-values-head" scope="row">Implicit Value for Role:</th>
<td class="implicit-values">Default for <pref>aria-orientation</pref> is <code class="default">vertical</code>.</td>
<td class="implicit-values">
Default for <pref>aria-orientation</pref> is <code class="default">vertical</code>. <br/>
Default for <pref>aria-valuemin</pref> is <code class="default">0</code>. <br/>
Default for <pref>aria-valuemax</pref> is <code class="default">100</code>. <br/>
Default for <pref>aria-valuenow</pref> is half way between <code class="default">aria-valuemax</code> and <code class="default">aria-valuemin</code>.
</td>
</tr>
</tbody>
</table>
Expand All @@ -5923,6 +5936,14 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
<div class="role-description">
<p>A user input where the user selects a value from within a given range.</p>
<p>A slider represents the current value and range of possible values via the size of the slider and position of the thumb. It is typically possible to add or subtract to the value by using directional keys such as arrow keys.</p>
<p>Authors MUST set the <pref>aria-valuemin</pref>, <pref>aria-valuemax</pref>, and <pref>aria-valuenow</pref> attributes. If missing, their implicit values follow the same rules as the <a href="http://www.w3.org/TR/html5/forms.html#range-state-%28type=range%29" title="Range state">HTML range input type</a>:</p>
<ul>
<li>If <code>aria-valuemin</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 0 (zero). </li>
<li>If <code>aria-valuemax</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 100. </li>
<li>If <code>aria-valuenow</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to the value half way between <code>aria-valuemin</code> and <code>aria-valuemax</code>. </li>
<li>If <code>aria-valuenow</code> is present but less than <code>aria-valuemin</code>, it defaults to the value of <code>aria-valuemin</code>. </li>
<li>If <code>aria-valuenow</code> is present but greater than <code>aria-valuemax</code>, it defaults to the value of <code>aria-valuemax</code>. </li>
</ul>
<p class="note">Elements with the role <rref>slider</rref> have an implicit <pref>aria-orientation</pref> value of <code>horizontal</code>.</p>
</div>
<table class="role-features">
Expand Down Expand Up @@ -6005,7 +6026,12 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
</tr>
<tr>
<th class="implicit-values-head" scope="row">Implicit Value for Role:</th>
<td class="implicit-values">Default for <pref>aria-orientation</pref> is <code class="default">horizontal</code>.</td>
<td class="implicit-values">
Default for <pref>aria-orientation</pref> is <code class="default">horizontal</code>. <br/>
Default for <pref>aria-valuemin</pref> is <code class="default">0</code>. <br/>
Default for <pref>aria-valuemax</pref> is <code class="default">100</code>. <br/>
Default for <pref>aria-valuenow</pref> is half way between <code class="default">aria-valuemax</code> and <code class="default">aria-valuemin</code>.
</td>
</tr>
</tbody>
</table>
Expand All @@ -6017,6 +6043,14 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
<p>A form of <rref>range</rref> that expects the user to select from among discrete choices.</p>
<p>A <code>spinbutton</code> typically allows the user to select from the given range through the use of an up and down button on the keyboard. Visibly, the current value is incremented or decremented until a maximum or minimum value is reached. Authors SHOULD ensure this functionality is accomplished programmatically through the use of <kbd>up</kbd> and <kbd>down</kbd> arrows on the keyboard.</p>
<p>Although a <code>spinbutton</code> is similar in appearance to many presentations of <code>select</code>, it is advisable to use <code>spinbutton</code> when working with known ranges (especially in the case of large ranges) as opposed to distinct options. For example, a <code>spinbutton</code> representing a range from 1 to 1,000,000 would provide much better performance than a <code>select</code> <a>widget</a> representing the same values.</p>
<p>Authors MUST set the <pref>aria-valuemin</pref>, <pref>aria-valuemax</pref>, and <pref>aria-valuenow</pref> attributes. If missing, their implicit values follow the same rules as the <a href="http://www.w3.org/TR/html5/forms.html#range-state-%28type=range%29" title="Range state">HTML range input type</a>:</p>
<ul>
<li>If <code>aria-valuemin</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 0 (zero). </li>
<li>If <code>aria-valuemax</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to 100. </li>
<li>If <code>aria-valuenow</code> is missing or not a <a href="#valuetype_number">number</a>, it defaults to the value half way between <code>aria-valuemin</code> and <code>aria-valuemax</code>. </li>
<li>If <code>aria-valuenow</code> is present but less than <code>aria-valuemin</code>, it defaults to the value of <code>aria-valuemin</code>. </li>
<li>If <code>aria-valuenow</code> is present but greater than <code>aria-valuemax</code>, it defaults to the value of <code>aria-valuemax</code>. </li>
</ul>
</div>
<table class="role-features">
<caption>Characteristics:</caption>
Expand Down Expand Up @@ -6100,6 +6134,14 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
<th class="role-presentational-inherited-head" scope="row">Inherits Presentational:</th>
<td class="role-presentational-inherited"> </td>
</tr>
<tr>
<th class="implicit-values-head" scope="row">Implicit Value for Role:</th>
<td class="implicit-values">
Default for <pref>aria-valuemin</pref> is <code class="default">0</code>. <br/>
Default for <pref>aria-valuemax</pref> is <code class="default">100</code>. <br/>
Default for <pref>aria-valuenow</pref> is half way between <code class="default">aria-valuemax</code> and <code class="default">aria-valuemin</code>.
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -10458,10 +10500,10 @@ <h2>State and Property Attribute Processing</h2>
<p>State and property attributes are included in host languages, and therefore syntax for representation of their value types is governed by the host language. For each of the value types defined in <a href="#propcharacteristic_value">Value</a>, an appropriate value type from the host language is used. Recommended correspondences between <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> value types and various host language value types are listed in <a href="#typemapping">Mapping <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> Value types to languages</a>. This is a non-normative mapping in order to accommodate new host languages supporting <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr>.</p>
<p>The list value types&#8212;ID reference list and token list&#8212;allow more than one value of the given type to be provided. The values are separated by delimiter characters recognized by the host language for list attributes, such as space characters, commas, etc. Some languages may require a specific, single delimiter, while others may allow various delimiters.</p>
<p>Global states and properties are supported on any element in the host language. However, authors MUST only use non-global states and properties on elements with a role supporting the state or property; either defined as an explicit <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> role, or as defined by the host language semantic matching an appropriate WAI-ARIA role. When a role attribute is added to an element, the <a>semantics</a> and behavior of the element, including support for <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> states and properties, are augmented or overridden by the role behavior. User agents <strong>MUST</strong> ignore non-global states and properties used on an element without a role supporting the state or property; either defined as an explicit WAI-ARIA role, or as defined by the host language semantic matching an appropriate <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> role. For example, the <pref>aria-valuetext</pref> attribute may be used on a <rref>progressbar</rref>.</p>
<p><abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> roles have associated states and properties that are qualified as "supported" or "required". For example, <a class="property-reference" href="#aria-autocomplete">aria-autocomplete</a> is a <em>supported</em> property of the <a class="role-reference" href=#combobox>combobox</a> role: a given combobox might or might not implement auto completion. In addition, the <span class="role-reference">combobox</span> role <em>requires</em> the <a class="state-reference" href="#aria-expanded">aria-expanded</a> state in order to indicate whether its descendant listbox is currently open. </p>
<p>When <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> roles are used, supported states and properties that are not present in the DOM are treated according to their default value -- their default value is equivalent to their absence. Keeping with the <span class="role-reference">combobox</span> example, a missing <span class="property-reference">aria-autocomplete</span> attribute is the same as its default value <code>none</code>, meaning the <span class="role-reference">combobox</span> does not offer auto completion. </p>
<p>In contrast, required states and properties that are absent are an author error. Missing required states and properties are treated as if they were present and have an implicit neutral value that is not necessarily their default value. For example, the default value of <span class="state-reference">aria-expanded</span> is <code>undefined</code>, meaning neither expandable nor collapsible. However, its implicit value for a <span class="role-reference">combobox</span> is <code>false</code>, meaning collapsed. The characteristics table associated with each WAI-ARIA role has an "Implicit Value for Role:" entry that specifies the value to use for that role when a required state or property is missing. <span class="ednote">Editorial Note: There are roles whose required states/properties do not list an implicit value, e.g., <a href="#slider">slider/aria-valuenow</a>. Is this a bug?</span> </p>
<p>Sometimes states and properties are present in the DOM but have a zero-length string ("") as their value. This is equivalent to their absence. Therefore, user agents SHOULD treat state and property attributes with a value of "" the same as they treat an absent attribute. For supported states and properties this corresponds to the default value, but if it is a required attribute, it signals an author error, and the implicit value for the role is used. </p>
<p><abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> roles have associated states and properties that are qualified as "supported" or "required". An example of a property that is <em>supported</em> by the <a class="role-reference" href=#combobox>combobox</a> role is <a class="property-reference" href="#aria-autocomplete">aria-autocomplete</a>. The property is designated "supported" in this case because a given <code>combobox</code> might or might not implement auto completion. In contrast, the <code>combobox</code> role <em>requires</em> the <a class="state-reference" href="#aria-expanded">aria-expanded</a> state in order to indicate whether its descendant <code>listbox</code> is currently open. </p>
<p>When <abbr title="Accessible Rich Internet Applications">WAI-ARIA</abbr> roles are used, <em>supported</em> states and properties that are not present in the DOM are treated according to their default value. Keeping with the <code>combobox</code> example, a missing <code>aria-autocomplete</code> attribute is the same as its default value <code>none</code>, meaning the <code>combobox</code> does not offer auto completion. </p>
<p>However, states and properties that are <em>required</em> by a role but are absent are an author error. Missing required states and properties are treated as if they were present and have an implicit neutral value that is not necessarily their default value. For example, the default value of <code>aria-expanded</code> is <code>undefined</code>, meaning neither expandable nor collapsible. However, its implicit value for the <code>combobox</code> role is <code>false</code>, meaning collapsed. The characteristics table associated with each WAI-ARIA role has an "Implicit Value for Role" entry that specifies the value to use for that role when a required state or property is missing. </p>
<p>Sometimes states and properties are present in the DOM but have a zero-length string ("") as their value. This is equivalent to their absence. User agents SHOULD treat state and property attributes with a value of "" the same as they treat an absent attribute. For supported states and properties this corresponds to the default value, but if it is a required attribute, it signals an author error, and the implicit value for the role is used. </p>
</section>
</section>
<section class="appendix informative" id="a_schemata">
Expand Down

0 comments on commit e7883a9

Please sign in to comment.