Skip to content

Commit

Permalink
[] (0) Fold command.click() into the regular HTMLElement.click().
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3298 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 17, 2009
1 parent dc17a78 commit a0bbc5b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 47 deletions.
44 changes: 21 additions & 23 deletions index
Expand Up @@ -8141,6 +8141,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
events dispatched by author script. However, the <code title=dom-click><a href=#dom-click>click()</a></code> method can be used to make it
happen programmatically.</p>

<p>When a user agent is to <dfn id=run-pre-click-activation-steps>run pre-click activation steps</dfn>
on an element, it must run the <dfn id=pre-click-activation-steps>pre-click activation steps</dfn>
defined for that element, if any.</p>

<p>When a user agent is to <dfn id=run-post-click-activation-steps>run post-click activation
steps</dfn> on an element, the user agent must <a href=#fire-a-simple-event>fire a simple
event</a> called <code title=event-DOMActivate>DOMActivate</code> that is cancelable at
Expand All @@ -8149,10 +8153,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
canceled, the user agent must <a href=#run-canceled-activation-steps>run canceled activation
steps</a> on the element instead.</p>

<p>When a user agent is to <dfn id=run-pre-click-activation-steps>run pre-click activation steps</dfn>
on an element, it must run the <dfn id=pre-click-activation-steps>pre-click activation steps</dfn>
defined for that element, if any.</p>

<p>When a user agent is to <dfn id=run-canceled-activation-steps>run canceled activation steps</dfn>
on an element, it must run the <dfn id=canceled-activation-steps>canceled activation steps</dfn>
defined for that element, if any.</p>
Expand Down Expand Up @@ -38245,7 +38245,6 @@ interface <dfn id=renderingcontext2dcallback>RenderingContext2DCallback</dfn> {
attribute boolean <a href=#dom-command-checked title=dom-command-checked>checked</a>;
attribute DOMString <a href=#dom-command-radiogroup title=dom-command-radiogroup>radiogroup</a>;<!--
attribute boolean <span title="dom-command-default">default</span>;-->
void <a href=#dom-command-click title=dom-command-click>click</a>(); // shadows <code><a href=#htmlelement>HTMLElement</a></code>.<code title=dom-click><a href=#dom-click>click()</a></code>
};</pre>
</dd>
</dl><p>The <code><a href=#the-command>command</a></code> element represents a command that the user
Expand Down Expand Up @@ -38351,19 +38350,17 @@ interface <dfn id=renderingcontext2dcallback>RenderingContext2DCallback</dfn> {
DOM attributes must <a href=#reflect>reflect</a> the respective content
attributes of the same name.</p>

<p>The <dfn id=dom-command-click title=dom-command-click><code>click()</code></dfn>
method's behavior depends on the value of the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute of the element, as
follows:</p>

<!-- XXX should integrate this better with the normal click() method -->
<p>The element's <a href=#activation-behavior>activation behavior</a> depends on the
value of the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute
of the element, as follows:</p>

<dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
in the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state</dt>

<dd><p>If the element has a <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute, the UA must
remove that attribute. Otherwise, the UA must add a <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute, with the
literal value <code title="">checked</code>. The UA must then
<a href=#fire-a-click-event>fire a <code title="">click</code> event</a> at the
<a href=#fire-a-click-event>fire a <code title=event-click>click</code> event</a> at the
element.</dd>


Expand All @@ -38375,19 +38372,17 @@ interface <dfn id=renderingcontext2dcallback>RenderingContext2DCallback</dfn> {
<code><a href=#the-command>command</a></code> element, if that element has a <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code> attribute whose
value exactly matches the current element's (treating missing <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code> attributes as if
they were the empty string), and has a <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute, must remove
that attribute and <a href=#fire-a-click-event>fire a <code title="">click</code>
event</a> at the element.</p>
that attribute.</p>

<p>Then, the element's <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute attribute
must be set to the literal value <code title="">checked</code> and
a <span title="file a click event"><code title="">click</code>
event must be fired</span> at the element.</dd>
the user agent must <a href=#fire-a-click-event>fire a <code title=event-click>click</code>
event</a> at the element.</dd>


<dt>Otherwise</dt>

<dd><p>The UA must <a href=#fire-a-click-event>fire a <code title="">click</code>
event</a> at the element.</dd>
<dd><p>The element has no <a href=#activation-behavior>activation behavior</a>.</dd>

</dl><p class=note>Firing a synthetic <code title=event-click>click</code> event at the element does not cause
any of the actions described above to happen.</p>
Expand Down Expand Up @@ -39241,7 +39236,7 @@ explain that only direct children of the <menu> matter
of the command is always false. (The command is never checked.)</p>

<p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
command is to <a href=#fire-a-click-event title="fire a click event">fire a <code title="">click</code> event</a> at the element.</p>
command is to <a href=#fire-a-click-event title="fire a click event">fire a <code title=event-click>click</code> event</a> at the element.</p>


<h5 id=using-the-button-element-to-define-a-command><span class=secno>4.11.6.2 </span><dfn title=button-command>Using the <code>button</code> element to define a command</dfn></h5>
Expand Down Expand Up @@ -39315,7 +39310,7 @@ explain that only direct children of the <menu> matter
attribute, and false otherwise.</p>

<p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
command is to <a href=#fire-a-click-event title="fire a click event">fire a <code title="">click</code> event</a> at the element.</p> <!-- XXX this
command is to <a href=#fire-a-click-event title="fire a click event">fire a <code title=event-click>click</code> event</a> at the element.</p> <!-- XXX this
is probably wrong for radio and checkbox types, depending on how we
define <input>. -->

Expand Down Expand Up @@ -39420,10 +39415,13 @@ explain that only direct children of the <menu> matter
otherwise.</p>

<p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
command is to invoke the behavior described in the definition of
the <code title=dom-command-click><a href=#dom-command-click>click()</a></code> method of the
<code><a href=#htmlcommandelement>HTMLCommandElement</a></code> interface.</p> <!-- XXX update to
point to dom-click when we remove dom-command-click -->
command, if the element has a defined <a href=#activation-behavior>activation
behavior</a>, is to <a href=#run-synthetic-click-activation-steps>run synthetic click activation
steps</a> on the element. Otherwise, it is just to <a href=#fire-a-click-event>fire a
<code title=event-click>click</code> event</a> at the
element.</p>




<h5 id=using-the-bb-element-to-define-a-command><span class=secno>4.11.6.6 </span><dfn title=bb-command>Using the <code>bb</code> element to define a command</dfn></h5>
Expand Down
45 changes: 21 additions & 24 deletions source
Expand Up @@ -8257,6 +8257,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
title="dom-click">click()</code> method can be used to make it
happen programmatically.</p>

<p>When a user agent is to <dfn>run pre-click activation steps</dfn>
on an element, it must run the <dfn>pre-click activation steps</dfn>
defined for that element, if any.</p>

<p>When a user agent is to <dfn>run post-click activation
steps</dfn> on an element, the user agent must <span>fire a simple
event</span> called <code
Expand All @@ -8266,10 +8270,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
canceled, the user agent must <span>run canceled activation
steps</span> on the element instead.</p>

<p>When a user agent is to <dfn>run pre-click activation steps</dfn>
on an element, it must run the <dfn>pre-click activation steps</dfn>
defined for that element, if any.</p>

<p>When a user agent is to <dfn>run canceled activation steps</dfn>
on an element, it must run the <dfn>canceled activation steps</dfn>
defined for that element, if any.</p>
Expand Down Expand Up @@ -42926,7 +42926,6 @@ interface <dfn>RenderingContext2DCallback</dfn> {
attribute boolean <span title="dom-command-checked">checked</span>;
attribute DOMString <span title="dom-command-radiogroup">radiogroup</span>;<!--
attribute boolean <span title="dom-command-default">default</span>;-->
void <span title="dom-command-click">click</span>(); // shadows <code>HTMLElement</code>.<code title="dom-click">click()</code>
};</pre>
</dd>
</dl>
Expand Down Expand Up @@ -43059,12 +43058,9 @@ interface <dfn>RenderingContext2DCallback</dfn> {
DOM attributes must <span>reflect</span> the respective content
attributes of the same name.</p>

<p>The <dfn title="dom-command-click"><code>click()</code></dfn>
method's behavior depends on the value of the <code
title="attr-command-type">type</code> attribute of the element, as
follows:</p>

<!-- XXX should integrate this better with the normal click() method -->
<p>The element's <span>activation behavior</span> depends on the
value of the <code title="attr-command-type">type</code> attribute
of the element, as follows:</p>

<dl class="switch">

Expand All @@ -43077,7 +43073,7 @@ interface <dfn>RenderingContext2DCallback</dfn> {
remove that attribute. Otherwise, the UA must add a <code
title="attr-command-checked">checked</code> attribute, with the
literal value <code title="">checked</code>. The UA must then
<span>fire a <code title="">click</code> event</span> at the
<span>fire a <code title="event-click">click</code> event</span> at the
element.</p></dd>


Expand All @@ -43093,20 +43089,18 @@ interface <dfn>RenderingContext2DCallback</dfn> {
title="attr-command-radiogroup">radiogroup</code> attributes as if
they were the empty string), and has a <code
title="attr-command-checked">checked</code> attribute, must remove
that attribute and <span>fire a <code title="">click</code>
event</span> at the element.</p>
that attribute.</p>

<p>Then, the element's <code
title="attr-command-checked">checked</code> attribute attribute
must be set to the literal value <code title="">checked</code> and
a <span title="file a click event"><code title="">click</code>
event must be fired</span> at the element.</p></dd>
the user agent must <span>fire a <code title="event-click">click</code>
event</span> at the element.</p></dd>


<dt>Otherwise</dt>

<dd><p>The UA must <span>fire a <code title="">click</code>
event</span> at the element.</p></dd>
<dd><p>The element has no <span>activation behavior</span>.</p></dd>

</dl>

Expand Down Expand Up @@ -44070,7 +44064,7 @@ explain that only direct children of the <menu> matter

<p>The <span title="command-facet-Action">Action</span> of the
command is to <span title="fire a click event">fire a <code
title="">click</code> event</span> at the element.</p>
title="event-click">click</code> event</span> at the element.</p>


<h5><dfn title="button-command">Using the <code>button</code> element to define a command</dfn></h5>
Expand Down Expand Up @@ -44172,7 +44166,7 @@ explain that only direct children of the <menu> matter

<p>The <span title="command-facet-Action">Action</span> of the
command is to <span title="fire a click event">fire a <code
title="">click</code> event</span> at the element.</p> <!-- XXX this
title="event-click">click</code> event</span> at the element.</p> <!-- XXX this
is probably wrong for radio and checkbox types, depending on how we
define <input>. -->

Expand Down Expand Up @@ -44298,10 +44292,13 @@ explain that only direct children of the <menu> matter
otherwise.</p>

<p>The <span title="command-facet-Action">Action</span> of the
command is to invoke the behavior described in the definition of
the <code title="dom-command-click">click()</code> method of the
<code>HTMLCommandElement</code> interface.</p> <!-- XXX update to
point to dom-click when we remove dom-command-click -->
command, if the element has a defined <span>activation
behavior</span>, is to <span>run synthetic click activation
steps</span> on the element. Otherwise, it is just to <span>fire a
<code title="event-click">click</code> event</span> at the
element.</p>




<h5><dfn title="bb-command">Using the <code>bb</code> element to define a command</dfn></h5>
Expand Down

0 comments on commit a0bbc5b

Please sign in to comment.