Skip to content

Commit

Permalink
[giow] (2) Fix 'activation behavior' definitions for form controls so…
Browse files Browse the repository at this point in the history
… that .click() doesn't do anything on them if they're disabled; fix definition of default submit buttons so that they are more predictable; unhide some v2COMMAND text that is now applicable again

Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7004 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 22, 2012
1 parent ace52c1 commit beaee03
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 166 deletions.
123 changes: 70 additions & 53 deletions complete.html
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 February 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 22 February 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -46299,6 +46299,9 @@ <h6 id="checkbox-state-(type=checkbox)"><span class=secno>4.10.7.1.16 </span><df
cancelable. Once this fires, the control is checked, end of story.
--></p>

<p>If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

<p><strong>Constraint validation</strong>: If the element is <i title=concept-input-required><a href=#concept-input-required>required</a></i> and its <a href=#concept-fe-checked title=concept-fe-checked>checkedness</a> is false, then the
element is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>

Expand Down Expand Up @@ -46436,6 +46439,9 @@ <h6 id="radio-button-state-(type=radio)"><span class=secno>4.10.7.1.17 </span><d
cancelable. Once this fires, the control is checked, end of story.
-->.</p>

<p>If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

<p><strong>Constraint validation</strong>: If an element in the
<i><a href=#radio-button-group>radio button group</a></i> is <i title=concept-input-required><a href=#concept-input-required>required</a></i>, and all of the
<code><a href=#the-input-element>input</a></code> elements in the <i><a href=#radio-button-group>radio button group</a></i> have a
Expand Down Expand Up @@ -46724,12 +46730,13 @@ <h6 id="submit-button-state-(type=submit)"><span class=secno>4.10.7.1.19 </span>
<div class=impl>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element.</p>
then the element's <a href=#activation-behavior>activation behavior</a> is as follows:
if the element has a <a href=#form-owner>form owner</a>, <a href=#concept-form-submit title=concept-form-submit>submit</a> the <a href=#form-owner>form
owner</a> from the <code><a href=#the-input-element>input</a></code> element; otherwise, do
nothing.</p>

<p>The element's <a href=#activation-behavior>activation behavior</a>, if the element
has a <a href=#form-owner>form owner</a>, is to <a href=#concept-form-submit title=concept-form-submit>submit</a> the <a href=#form-owner>form
owner</a> from the <code><a href=#the-input-element>input</a></code> element; otherwise, it is
to do nothing.</p>
<p>If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

</div>

Expand Down Expand Up @@ -46903,24 +46910,29 @@ <h6 id="image-button-state-(type=image)"><span class=secno>4.10.7.1.20 </span><d
element <a href=#represents>represents</a> a control for selecting a <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>coordinate</a> from
the image specified by the <code title=attr-input-src><a href=#attr-input-src>src</a></code>
attribute; if the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>, the user agent should
allow the user to select this <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>coordinate</a>. The
<a href=#activation-behavior>activation behavior</a> in this case consists of taking the
user's selected <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>coordinate</a>, and
then, if the element has a <a href=#form-owner>form owner</a>, <a href=#concept-form-submit title=concept-form-submit>submitting</a> the <code><a href=#the-input-element>input</a></code>
element's <a href=#form-owner>form owner</a> from the <code><a href=#the-input-element>input</a></code>
element. If the user activates the control without explicitly
selecting a coordinate, then the coordinate (0,0) must be
assumed.</p>
allow the user to select this <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>coordinate</a>, and
the element's <a href=#activation-behavior>activation behavior</a> is as follows: if the
element has a <a href=#form-owner>form owner</a>, take the user's selected
<a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>coordinate</a>,
and <a href=#concept-form-submit title=concept-form-submit>submit</a> the
<code><a href=#the-input-element>input</a></code> element's <a href=#form-owner>form owner</a> from the
<code><a href=#the-input-element>input</a></code> element. If the user activates the control
without explicitly selecting a coordinate, then the coordinate (0,0)
must be assumed.</p>

<p>Otherwise, the element <a href=#represents>represents</a> a submit button
whose label is given by the value of the <code title=attr-input-alt><a href=#attr-input-alt>alt</a></code> attribute; if the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>, the user agent should
allow the user to activate the button. The <a href=#activation-behavior>activation
behavior</a> in this case consists of setting the <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>selected
coordinate</a> to (0,0), and then, if the element has a
<a href=#form-owner>form owner</a>, <a href=#concept-form-submit title=concept-form-submit>submitting</a> the <code><a href=#the-input-element>input</a></code>
whose label is given by the value of the <code title=attr-input-alt><a href=#attr-input-alt>alt</a></code> attribute; if the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>, then the element's
<a href=#activation-behavior>activation behavior</a> is as follows: if the element has a
<a href=#form-owner>form owner</a>, set the <a href=#concept-input-type-image-coordinate title=concept-input-type-image-coordinate>selected
coordinate</a> to (0,0), and <a href=#concept-form-submit title=concept-form-submit>submit</a> the <code><a href=#the-input-element>input</a></code>
element's <a href=#form-owner>form owner</a> from the <code><a href=#the-input-element>input</a></code>
element.</p>

<p>In either case, if the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i> but has no <a href=#form-owner>form
owner</a>, then its <a href=#activation-behavior>activation behavior</a> must be to
do nothing. If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

<p>The <dfn id=concept-input-type-image-coordinate title=concept-input-type-image-coordinate>selected
coordinate</dfn> must consist of an <var title="">x</var>-component
and a <var title="">y</var>-component. The coordinates represent the
Expand Down Expand Up @@ -47067,12 +47079,13 @@ <h6 id="reset-button-state-(type=reset)"><span class=secno>4.10.7.1.21 </span><d
<div class=impl>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element.</p>

<p>The element's <a href=#activation-behavior>activation behavior</a>, if the element
then the element's <a href=#activation-behavior>activation behavior</a>, if the element
has a <a href=#form-owner>form owner</a>, is to <a href=#concept-form-reset title=concept-form-reset>reset</a> the <a href=#form-owner>form owner</a>;
otherwise, it is to do nothing.</p>

<p>If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

<p><strong>Constraint validation</strong>: The element is
<a href=#barred-from-constraint-validation>barred from constraint validation</a>.</p>

Expand Down Expand Up @@ -47150,8 +47163,10 @@ <h6 id="button-state-(type=button)"><span class=secno>4.10.7.1.22 </span><dfn ti
<div class=impl>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element. The
element's <a href=#activation-behavior>activation behavior</a> is to do nothing.</p>
the element's <a href=#activation-behavior>activation behavior</a> is to do nothing.</p>

<p>If the element is <i title=concept-input-immutable><a href=#concept-input-immutable>immutable</a></i>, it has no
<a href=#activation-behavior>activation behavior</a>.</p>

<p><strong>Constraint validation</strong>: The element is
<a href=#barred-from-constraint-validation>barred from constraint validation</a>.</p>
Expand Down Expand Up @@ -48433,9 +48448,7 @@ <h4 id=the-button-element><span class=secno>4.10.8 </span>The <dfn><code>button<
readonly attribute <a href=#nodelist>NodeList</a> <a href=#dom-lfe-labels title=dom-lfe-labels>labels</a>;
};</pre>
</dd>
</dl><!--TOPIC:HTML--><p>The <code><a href=#the-button-element>button</a></code> element <a href=#represents>represents</a> a
button. <span class=impl>If the element is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, then the user agent
should allow the user to activate the button.</span></p>
</dl><!--TOPIC:HTML--><p>The <code><a href=#the-button-element>button</a></code> element <a href=#represents>represents</a> a button.</p>

<p>The element is a <a href=#concept-button title=concept-button>button</a>.</p>

Expand Down Expand Up @@ -48471,10 +48484,9 @@ <h4 id=the-button-element><span class=secno>4.10.8 </span>The <dfn><code>button<
the <a href=#attr-button-type-button-state title=attr-button-type-button-state>Button</a> state,
the element is <a href=#barred-from-constraint-validation>barred from constraint validation</a>.</p>

<p>If the element is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the <a href=#activation-behavior>activation
behavior</a> of the <code><a href=#the-button-element>button</a></code> element is to run the
steps defined in the following list for the current state of the
element's <code title=attr-button-type><a href=#attr-button-type>type</a></code> attribute.</p>
<p>When a <code><a href=#the-button-element>button</a></code> element is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, its <a href=#activation-behavior>activation
behavior</a> element is to run the steps defined in the following
list for the current state of the element's <code title=attr-button-type><a href=#attr-button-type>type</a></code> attribute:</p>

<dl><dt> <dfn id=attr-button-type-submit-state title=attr-button-type-submit-state>Submit Button</dfn> </dt>

Expand Down Expand Up @@ -52063,16 +52075,16 @@ <h5 id=introduction-2><span class=secno>4.10.22.1 </span>Introduction</h5>

<h5 id=implicit-submission><span class=secno>4.10.22.2 </span>Implicit submission</h5>

<p>User agents may establish a <a href=#concept-button title=concept-button>button</a> in each form as being the
form's <dfn id=default-button>default button</dfn>. This should be the first <a href=#concept-submit-button title=concept-submit-button>submit button</a> in <a href=#tree-order>tree
order</a> whose <a href=#form-owner>form owner</a> is that <code><a href=#the-form-element>form</a></code>
element, but user agents may pick another button if another would be
more appropriate for the platform. If the platform supports letting
the user submit a form implicitly (for example, on some platforms
hitting the "enter" key while a text field is focused implicitly
submits the form), then doing so must cause the form's <a href=#default-button>default
button</a>'s <a href=#activation-behavior>activation behavior</a>, if any, to be
run.</p>
<p>A <code><a href=#the-form-element>form</a></code> element's <dfn id=default-button>default button</dfn> is the
first <a href=#concept-submit-button title=concept-submit-button>submit button</a> in
<a href=#tree-order>tree order</a> whose <a href=#form-owner>form owner</a> is that
<code><a href=#the-form-element>form</a></code> element.</p>

<p>If the platform supports letting the user submit a form
implicitly (for example, on some platforms hitting the "enter" key
while a text field is focused implicitly submits the form), then
doing so must cause the form's <a href=#default-button>default button</a>'s
<a href=#activation-behavior>activation behavior</a>, if any, to be run.</p>

<p class=note>Consequently, if the <a href=#default-button>default button</a> is
<a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the form is not
Expand Down Expand Up @@ -53398,15 +53410,19 @@ <h4 id=the-command-element><span class=secno>4.11.3 </span>The <dfn id=the-comma
IDL attribute must return the <a href=#master-command>master command</a>, if any,
or null otherwise.</p>

<hr><p>The element's <a href=#activation-behavior>activation behavior</a> depends on the
element's <code title=attr-command-type><a href=#attr-command-type>type</a></code> and <code title=attr-command-command><a href=#attr-command-command>command</a></code> attributes, as
<hr><p>If the element's <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> is false
(enabled) then the element's <a href=#activation-behavior>activation behavior</a>
depends on the element's <code title=attr-command-type><a href=#attr-command-type>type</a></code>
and <code title=attr-command-command><a href=#attr-command-command>command</a></code> attributes, as
follows:</p>

<dl class=switch><dt>If the element has a <a href=#master-command>master command</a> set by its
<code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute</dt>

<dd><p>The user agent must <a href=#run-synthetic-click-activation-steps>run synthetic click activation
steps</a> on the element's <a href=#master-command>master command</a>.</dd>
<!-- we know it has a defined <span>activation behavior</span> if
we get here -->


<dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
Expand All @@ -53433,16 +53449,17 @@ <h4 id=the-command-element><span class=secno>4.11.3 </span>The <dfn id=the-comma

<dt>Otherwise</dt>

<dd><p>The element has no <a href=#activation-behavior>activation behavior</a>.</dd>
<dd><p>The element's <a href=#activation-behavior>activation behavior</a> is to do
nothing.</dd>

</dl><p class=note>Firing a synthetic <code title=event-click><a href=#event-click>click</a></code> event at the element does not cause
any of the actions described above to happen.</p>

<!-- v2COMMAND: the command="" attribute to make a <command> element
reflect the state of another command, so that the script can update
one place in the page and have context menus, toolbars, shortcuts,
etc, automatically update. Once we add this, expose the Triggers
facet again. -->
<!-- v2COMMAND: Expose the Triggers facet again. -->

<p>If the element's <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> is true
(disabled) then the element has no <a href=#activation-behavior>activation
behavior</a>.</p>

</div>

Expand Down Expand Up @@ -53826,10 +53843,10 @@ <h5 id=toolbars><span class=secno>4.11.4.4 </span><dfn>Toolbars</dfn></h5>
<h4 id=commands><span class=secno>4.11.5 </span>Commands</h4>

<p>A <dfn id=concept-command title=concept-command>command</dfn> is the abstraction
behind menu items, buttons, and links.<!--v2COMMAND: Once a command
behind menu items, buttons, and links. Once a command
is defined, other parts of the interface can refer to the same
command, allowing many access points to a single feature to share
aspects such as the disabled state.--></p>
facets such as the <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a>.</p>

<p id=facets>Commands are defined to have the following
<dfn id=concept-facet title=concept-facet>facets</dfn>:</p>
Expand Down Expand Up @@ -56689,7 +56706,7 @@ <h4 id=pseudo-classes><span class=secno>4.14.2 </span>Pseudo-classes</h4>
<li><code><a href=#the-li-element>li</a></code> elements that are children of
<code><a href=#the-menu-element>menu</a></code> elements, and that have a child element that
defines a <a href=#concept-command title=concept-command>command</a>, if the
first such element's <a href=#command-facet-disabledstate title=command-facet-disabledstate>Disabled State</a> facet
first such element's <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> facet
is false (not disabled)</li>

<li><code><a href=#the-fieldset-element>fieldset</a></code> elements that do not have a <code title=attr-fieldset-disabled><a href=#attr-fieldset-disabled>disabled</a></code> attribute</li>
Expand Down Expand Up @@ -56724,7 +56741,7 @@ <h4 id=pseudo-classes><span class=secno>4.14.2 </span>Pseudo-classes</h4>
<li><code><a href=#the-li-element>li</a></code> elements that are children of
<code><a href=#the-menu-element>menu</a></code> elements, and that have a child element that
defines a <a href=#concept-command title=concept-command>command</a>, if the
first such element's <a href=#command-facet-disabledstate title=command-facet-disabledstate>Disabled State</a> facet
first such element's <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> facet
is true (disabled)</li>

<li><code><a href=#the-fieldset-element>fieldset</a></code> elements that have a <code title=attr-fieldset-disabled><a href=#attr-fieldset-disabled>disabled</a></code> attribute</li>
Expand Down

0 comments on commit beaee03

Please sign in to comment.