Skip to content

Commit

Permalink
[c] (0) Define better the restrictions on attributes of <command> (cr…
Browse files Browse the repository at this point in the history
…edit: hs)

git-svn-id: http://svn.whatwg.org/webapps@2415 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 18, 2008
1 parent 8192959 commit bdcd52a
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 36 deletions.
54 changes: 36 additions & 18 deletions index
Expand Up @@ -30610,15 +30610,28 @@ XXX selection ranges -->
with an associated action, or a state or option that can be toggled,
or a selection of one item from a list of items.</p>

<!-- XXX this should be an enumerated attribute -->
<p>The attribute is an <a href=#enumerated-attribute>enumerated attribute</a> with three
keywords and states. The keyword "<dfn id=attr-command-type-keyword-command title=attr-command-type-keyword-command><code>command</code></dfn>"
maps to the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state, the
<dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
maps to the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a>, and the
"<dfn id=attr-command-type-keyword-radio title=attr-command-type-keyword-radio><code>radio</code></dfn>"
keyword maps to the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state. The
<i>missing value default</i> is the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state.</p>

<p>The attribute's value must be either "<code title="">command</code>", "<code title="">checkbox</code>", or
"<code title="">radio</code>", denoting each of these three types of
commands respectively. The attribute may also be omitted if the
element is to represent the first of these types, a simple
command.</p>
<dl><dt>The <dfn id=attr-command-type-state-command title=attr-command-type-state-command>Command</dfn> state</dt>

<dd><p>The element represents a normal command with an associated action.</dd>

<dt>The <dfn id=attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</dfn> state</dt>

<dd><p>The element represents a state or option that can be toggled.</dd>

<dt>The <dfn id=attr-command-type-state-radio title=attr-command-type-state-radio>Radio</dfn> state</dt>

<p>The <dfn id=attr-command-label title=attr-command-label><code>label</code></dfn>
<dd><p>The element represents a selection of one item from a list of items.</dd>

</dl><p>The <dfn id=attr-command-label title=attr-command-label><code>label</code></dfn>
attribute gives the name of the command, as shown to the user.</p>

<p>The <dfn id=attr-command-title title=attr-command-title><code>title</code></dfn>
Expand All @@ -30645,19 +30658,26 @@ XXX selection ranges -->

<p>The <dfn id=attr-command-checked title=attr-command-checked><code>checked</code></dfn>
attribute is a <a href=#boolean-attribute>boolean attribute</a> that, if present,
indicates that the command is selected.</p>
indicates that the command is selected. The attribute must be
omitted unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code>
attribute is in either the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state or
the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a>
state.</p>

<p>The <dfn id=attr-command-radiogroup title=attr-command-radiogroup><code>radiogroup</code></dfn>
attribute gives the name of the group of commands that will be
toggled when the command itself is toggled, for commands whose <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute has the value "<code title="">radio</code>". The scope of the name is the child list of
the parent element.</p>
the parent element. The attribute must be omitted unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is in the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state.</p>

<p>If the <code><a href=#the-command>command</a></code> element is used when <span title="menu generation">generating</span> a <span>context
menu</span>, then the <dfn id=attr-command-default title=attr-command-default><code>default</code></dfn> attribute
indicates, if present, that the command is the one that would have
been invoked if the user had directly activated the menu's subject
instead of using its context menu. The <code title=attr-command-default><a href=#attr-command-default>default</a></code> attribute is a
<a href=#boolean-attribute>boolean attribute</a>.</p>
<a href=#boolean-attribute>boolean attribute</a>. The attribute must be omitted
unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
in the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a>
state.</p>

<div class=example>

Expand All @@ -30677,8 +30697,10 @@ XXX selection ranges -->
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>

<dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute
has the value <code title="">checkbox</code></dt>
<!-- XXX should integrate this better with the normal click() method -->

<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
Expand All @@ -30687,8 +30709,8 @@ XXX selection ranges -->
element.</dd>


<dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute
has the value <code title="">radio</code></dt>
<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-radio title=attr-command-type-state-radio>Radio</a> state</dt>

<dd><p>If the element has a parent, then the UA must walk the list
of child nodes of that parent element, and for each node that is a
Expand All @@ -30712,10 +30734,6 @@ XXX selection ranges -->
</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>

<p class=XXX> should change all the above so it actually is
just triggered by a click event, then we could remove the shadowing
click() method and rely on actual events. </p>

<p class=XXX>Need to define the command="" attribute</p>

<p class=note><code><a href=#the-command>command</a></code> elements are not rendered
Expand Down
69 changes: 51 additions & 18 deletions source
Expand Up @@ -34765,14 +34765,37 @@ XXX selection ranges -->
with an associated action, or a state or option that can be toggled,
or a selection of one item from a list of items.</p>

<!-- XXX this should be an enumerated attribute -->
<p>The attribute is an <span>enumerated attribute</span> with three
keywords and states. The keyword "<dfn
title="attr-command-type-keyword-command"><code>command</code></dfn>"
maps to the <span
title="attr-command-type-state-command">Command</span> state, the
<dfn
title="attr-command-type-keyword-checkbox"><code>checkbox</code></dfn>"
maps to the <span
title="attr-command-type-state-checkbox">Checkbox</span>, and the
"<dfn
title="attr-command-type-keyword-radio"><code>radio</code></dfn>"
keyword maps to the <span
title="attr-command-type-state-radio">Radio</span> state. The
<i>missing value default</i> is the <span
title="attr-command-type-state-command">Command</span> state.</p>

<p>The attribute's value must be either "<code
title="">command</code>", "<code title="">checkbox</code>", or
"<code title="">radio</code>", denoting each of these three types of
commands respectively. The attribute may also be omitted if the
element is to represent the first of these types, a simple
command.</p>
<dl>

<dt>The <dfn title="attr-command-type-state-command">Command</dfn> state</dt>

<dd><p>The element represents a normal command with an associated action.</p></dd>

<dt>The <dfn title="attr-command-type-state-checkbox">Checkbox</dfn> state</dt>

<dd><p>The element represents a state or option that can be toggled.</p></dd>

<dt>The <dfn title="attr-command-type-state-radio">Radio</dfn> state</dt>

<dd><p>The element represents a selection of one item from a list of items.</p></dd>

</dl>

<p>The <dfn title="attr-command-label"><code>label</code></dfn>
attribute gives the name of the command, as shown to the user.</p>
Expand Down Expand Up @@ -34804,15 +34827,22 @@ XXX selection ranges -->

<p>The <dfn title="attr-command-checked"><code>checked</code></dfn>
attribute is a <span>boolean attribute</span> that, if present,
indicates that the command is selected.</p>
indicates that the command is selected. The attribute must be
omitted unless the <code title="attr-command-type">type</code>
attribute is in either the <span
title="attr-command-type-state-checkbox">Checkbox</span> state or
the <span title="attr-command-type-state-radio">Radio</span>
state.</p>

<p>The <dfn
title="attr-command-radiogroup"><code>radiogroup</code></dfn>
attribute gives the name of the group of commands that will be
toggled when the command itself is toggled, for commands whose <code
title="attr-command-type">type</code> attribute has the value "<code
title="">radio</code>". The scope of the name is the child list of
the parent element.</p>
the parent element. The attribute must be omitted unless the <code
title="attr-command-type">type</code> attribute is in the <span
title="attr-command-type-state-radio">Radio</span> state.</p>

<p>If the <code>command</code> element is used when <span
title="menu generation">generating</span> a <span>context
Expand All @@ -34822,7 +34852,10 @@ XXX selection ranges -->
been invoked if the user had directly activated the menu's subject
instead of using its context menu. The <code
title="attr-command-default">default</code> attribute is a
<span>boolean attribute</span>.</p>
<span>boolean attribute</span>. The attribute must be omitted
unless the <code title="attr-command-type">type</code> attribute is
in the <span title="attr-command-type-state-command">Command</span>
state.</p>

<div class="example">

Expand All @@ -34848,10 +34881,13 @@ XXX selection ranges -->
title="attr-command-type">type</code> attribute of the element, as
follows:</p>

<!-- XXX should integrate this better with the normal click() method -->

<dl class="switch">

<dt>If the <code title="attr-command-type">type</code> attribute
has the value <code title="">checkbox</code></dt>
<dt>If the <code title="attr-command-type">type</code> attribute is
in the <span
title="attr-command-type-state-checkbox">Checkbox</span> state</dt>

<dd><p>If the element has a <code
title="attr-command-checked">checked</code> attribute, the UA must
Expand All @@ -34862,8 +34898,9 @@ XXX selection ranges -->
element.</p></dd>


<dt>If the <code title="attr-command-type">type</code> attribute
has the value <code title="">radio</code></dt>
<dt>If the <code title="attr-command-type">type</code> attribute is
in the <span
title="attr-command-type-state-radio">Radio</span> state</dt>

<dd><p>If the element has a parent, then the UA must walk the list
of child nodes of that parent element, and for each node that is a
Expand Down Expand Up @@ -34894,10 +34931,6 @@ XXX selection ranges -->
title="event-click">click</code> event at the element does not cause
any of the actions described above to happen.</p>

<p class="XXX"> should change all the above so it actually is
just triggered by a click event, then we could remove the shadowing
click() method and rely on actual events. </p>

<p class="XXX">Need to define the command="" attribute</p>

<p class="note"><code>command</code> elements are not rendered
Expand Down

0 comments on commit bdcd52a

Please sign in to comment.