Skip to content

Commit

Permalink
[e] (0) Abstract out the <td> and <th> attribute definitions.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@1373 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 18, 2008
1 parent 3e05db5 commit 7424da0
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 150 deletions.
153 changes: 72 additions & 81 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<h1 id=html-5>HTML 5</h1>

<h2 class="no-num no-toc" id=working>Working Draft &mdash; 9 March 2008</h2>
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 18 March 2008</h2>

<p>You can take part in this work. <a
href="http://www.whatwg.org/mailing-list">Join the working group's
Expand Down Expand Up @@ -761,14 +761,17 @@
<li><a href="#the-th"><span class=secno>3.13.10 </span>The
<code>th</code> element</a>

<li><a href="#processing"><span class=secno>3.13.11 </span>Processing
<li><a href="#attributes0"><span class=secno>3.13.11 </span>Attributes
common to <code>td</code> and <code>th</code> elements</a>

<li><a href="#processing"><span class=secno>3.13.12 </span>Processing
model</a>
<ul class=toc>
<li><a href="#forming"><span class=secno>3.13.11.1. </span>Forming a
<li><a href="#forming"><span class=secno>3.13.12.1. </span>Forming a
table</a>

<li><a href="#header-and-data-cell-semantics"><span
class=secno>3.13.11.2. </span>Forming relationships between data
class=secno>3.13.12.2. </span>Forming relationships between data
cells and header cells</a>
</ul>
</ul>
Expand Down Expand Up @@ -1544,7 +1547,7 @@
<li><a href="#end-tags"><span class=secno>8.1.2.2. </span>End
tags</a>

<li><a href="#attributes0"><span class=secno>8.1.2.3.
<li><a href="#attributes1"><span class=secno>8.1.2.3.
</span>Attributes</a>

<li><a href="#optional"><span class=secno>8.1.2.4. </span>Optional
Expand Down Expand Up @@ -19907,65 +19910,26 @@ notes on what would need to be defined for dashed lines:

<dt>Element-specific attributes:

<dd><code title=attr-td-colspan><a href="#colspan">colspan</a></code>
<dd><code title=attr-tdth-colspan><a href="#colspan">colspan</a></code>

<dd><code title=attr-td-rowspan><a href="#rowspan">rowspan</a></code>
<dd><code title=attr-tdth-rowspan><a href="#rowspan">rowspan</a></code>

<dt>DOM interface:

<dd>
<pre
class=idl>interface <dfn id=htmltablecellelement>HTMLTableCellElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute long <a href="#colspan0" title=dom-td-colSpan>colSpan</a>;
attribute long <a href="#rowspan0" title=dom-td-rowSpan>rowSpan</a>;
readonly attribute long <a href="#cellindex" title=dom-td-cellIndex>cellIndex</a>;
class=idl>interface <dfn id=htmltabledatacellelement>HTMLTableDataCellElement</dfn> : <a href="#htmltablecellelement">HTMLTableCellElement</a> {
};</pre>
</dl>

<p>The <code><a href="#td">td</a></code> element represents a data <a
href="#cell" title=concept-cell>cell</a> in a table.

<p>The <code><a href="#td">td</a></code> element may have a <dfn id=colspan
title=attr-td-colspan><code>colspan</code></dfn> content attribute
specified, whose value must be a <a href="#valid">valid non-negative
integer</a> greater than zero. Its default value, which must be used if <a
href="#rules" title="rules for parsing non-negative integers">parsing the
attribute as a non-negative integer</a> returns either an error or zero,
is 1.

<p>The <code><a href="#td">td</a></code> element may also have a <dfn
id=rowspan title=attr-td-rowspan><code>rowspan</code></dfn> content
attribute specified, whose value must be a <a href="#valid">valid
non-negative integer</a>. Its default value, which must be used if <a
href="#rules" title="rules for parsing non-negative integers">parsing the
attribute as a non-negative integer</a> returns an error, is also 1.

<p>The <code><a href="#td">td</a></code> element and its <code
title=attr-td-colspan><a href="#colspan">colspan</a></code> and <code
title=attr-td-rowspan><a href="#rowspan">rowspan</a></code> attributes
title=attr-tdth-colspan><a href="#colspan">colspan</a></code> and <code
title=attr-tdth-rowspan><a href="#rowspan">rowspan</a></code> attributes
take part in the <a href="#table0">table model</a>.

<p>The <dfn id=colspan0 title=dom-td-colspan><code>colspan</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the content attribute of the
same name, with the exception that on setting, if the new value is 0, then
an <code>INDEX_SIZE_ERR</code> exception must be raised.

<p>The <dfn id=rowspan0 title=dom-td-rowspan><code>rowspan</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the content attribute of the
same name.

<p>The <dfn id=cellindex
title=dom-td-cellIndex><code>cellIndex</code></dfn> DOM attribute must, if
the element has a parent <code><a href="#tr">tr</a></code> element, return
the index of the cell's element in the parent element's <code
title=dom-tr-cells><a href="#cells">cells</a></code> collection. If there
is no such parent element, then the attribute must return 0.

<p class=big-issue>There has been some suggestion that the <code
title="">headers</code> attribute from HTML4, or some other mechanism that
is more powerful than <code title="">scope=""</code>, should be included.
This has not yet been considered.

<h4 id=the-th><span class=secno>3.13.10 </span>The <dfn
id=th><code>th</code></dfn> element</h4>

Expand All @@ -19984,9 +19948,9 @@ notes on what would need to be defined for dashed lines:

<dt>Element-specific attributes:

<dd><code title=attr-th-colspan><a href="#colspan1">colspan</a></code>
<dd><code title=attr-tdth-colspan><a href="#colspan">colspan</a></code>

<dd><code title=attr-th-rowspan><a href="#rowspan1">rowspan</a></code>
<dd><code title=attr-tdth-rowspan><a href="#rowspan">rowspan</a></code>

<dd><code title=attr-th-scope><a href="#scope0">scope</a></code>

Expand All @@ -20002,21 +19966,6 @@ notes on what would need to be defined for dashed lines:
<p>The <code><a href="#th">th</a></code> element represents a header <a
href="#cell" title=concept-cell>cell</a> in a table.

<p>The <code><a href="#th">th</a></code> element may have a <dfn
id=colspan1 title=attr-th-colspan><code>colspan</code></dfn> content
attribute specified, whose value must be a <a href="#valid">valid
non-negative integer</a> greater than zero. Its default value, which must
be used if <a href="#rules" title="rules for parsing non-negative
integers">parsing the attribute as a non-negative integer</a> returns
either an error or zero, is 1.

<p>The <code><a href="#th">th</a></code> element may also have a <dfn
id=rowspan1 title=attr-th-rowspan><code>rowspan</code></dfn> content
attribute specified, whose value must be a <a href="#valid">valid
non-negative integer</a>. Its default value, which must be used if <a
href="#rules" title="rules for parsing non-negative integers">parsing the
attribute as a non-negative integer</a> returns an error, is also 1.

<p>The <code><a href="#th">th</a></code> element may have a <dfn id=scope0
title=attr-th-scope><code>scope</code></dfn> content attribute specified.
The <code title=attr-th-scope><a href="#scope0">scope</a></code> attribute
Expand Down Expand Up @@ -20065,23 +20014,65 @@ notes on what would need to be defined for dashed lines:
cells and header cells.

<p>The <code><a href="#th">th</a></code> element and its <code
title=attr-th-colspan><a href="#colspan1">colspan</a></code>, <code
title=attr-th-rowspan><a href="#rowspan1">rowspan</a></code>, and <code
title=attr-tdth-colspan><a href="#colspan">colspan</a></code>, <code
title=attr-tdth-rowspan><a href="#rowspan">rowspan</a></code>, and <code
title=attr-th-scope><a href="#scope0">scope</a></code> attributes take
part in the <a href="#table0">table model</a>.

<p>The <dfn id=scope1 title=dom-th-scope><code>scope</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the content attribute of the
same name.

<p>The <code><a
href="#htmltableheadercellelement">HTMLTableHeaderCellElement</a></code>
interface inherits from the <code><a
href="#htmltablecellelement">HTMLTableCellElement</a></code> interface and
therefore also has the DOM attributes defined above in the <code><a
href="#td">td</a></code> section.
<h4 id=attributes0><span class=secno>3.13.11 </span>Attributes common to
<code><a href="#td">td</a></code> and <code><a href="#th">th</a></code>
elements</h4>

<p>The <code><a href="#td">td</a></code> and <code><a
href="#th">th</a></code> elements may have a <dfn id=colspan
title=attr-tdth-colspan><code>colspan</code></dfn> content attribute
specified, whose value must be a <a href="#valid">valid non-negative
integer</a> greater than zero. Its default value, which must be used if <a
href="#rules" title="rules for parsing non-negative integers">parsing the
attribute as a non-negative integer</a> returns either an error or zero,
is 1.

<p>The <code><a href="#td">td</a></code> and <code><a
href="#th">th</a></code> elements may also have a <dfn id=rowspan
title=attr-tdth-rowspan><code>rowspan</code></dfn> content attribute
specified, whose value must be a <a href="#valid">valid non-negative
integer</a>. Its default value, which must be used if <a href="#rules"
title="rules for parsing non-negative integers">parsing the attribute as a
non-negative integer</a> returns an error, is also 1.

<p>The <code><a href="#td">td</a></code> and <code><a
href="#th">th</a></code> elements implement interfaces that inherit from
the <code><a href="#htmltablecellelement">HTMLTableCellElement</a></code>
interface:

<pre
class=idl>interface <dfn id=htmltablecellelement>HTMLTableCellElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute long <span title=dom-td-colSpan>colSpan</span>;
attribute long <span title=dom-td-rowSpan>rowSpan</span>;
readonly attribute long <span title=dom-td-cellIndex>cellIndex</span>;
};</pre>

<p>The <dfn id=colspan0 title=dom-tdth-colspan><code>colspan</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the content attribute of
the same name, with the exception that on setting, if the new value is 0,
then an <code>INDEX_SIZE_ERR</code> exception must be raised.

<p>The <dfn id=rowspan0 title=dom-tdth-rowspan><code>rowspan</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the content attribute of
the same name.

<p>The <dfn id=cellindex
title=dom-tdth-cellIndex><code>cellIndex</code></dfn> DOM attribute must,
if the element has a parent <code><a href="#tr">tr</a></code> element,
return the index of the cell's element in the parent element's <code
title=dom-tr-cells><a href="#cells">cells</a></code> collection. If there
is no such parent element, then the attribute must return 0.

<h4 id=processing><span class=secno>3.13.11 </span>Processing model</h4>
<h4 id=processing><span class=secno>3.13.12 </span>Processing model</h4>

<p>The various table elements and their content attributes together define
the <dfn id=table0>table model</dfn>.
Expand Down Expand Up @@ -20184,7 +20175,7 @@ notes on what would need to be defined for dashed lines:
represented by <code><a href="#table">table</a></code> elements and their
descendants. Documents must not have table model errors.

<h5 id=forming><span class=secno>3.13.11.1. </span>Forming a table</h5>
<h5 id=forming><span class=secno>3.13.12.1. </span>Forming a table</h5>

<p>To determine which elements correspond to which slots in a <a
href="#table1" title=concept-table>table</a> associated with a <code><a
Expand Down Expand Up @@ -20670,7 +20661,7 @@ notes on what would need to be defined for dashed lines:
title=concept-cell>cell</a> anchored to them, then this is a <a
href="#table2">table model error</a>.

<h5 id=header-and-data-cell-semantics><span class=secno>3.13.11.2.
<h5 id=header-and-data-cell-semantics><span class=secno>3.13.12.2.
</span>Forming relationships between data cells and header cells</h5>

<p>Each data cell can be assigned zero or more header cells. The <dfn
Expand Down Expand Up @@ -37844,13 +37835,13 @@ function receiver(e) {
characters</a>.

<li>Then, the start tag may have a number of attributes, the <a
href="#attributes1" title=syntax-attributes>syntax for which</a> is
href="#attributes2" title=syntax-attributes>syntax for which</a> is
described below. Attributes may be separated from each other by one or
more <a href="#space" title="space character">space characters</a>.

<li>After the attributes, there may be one or more <a href="#space"
title="space character">space characters</a>. (Some attributes are
required to be followed by a space. See the <a href="#attributes1"
required to be followed by a space. See the <a href="#attributes2"
title=syntax-attributes>attributes section</a> below.)

<li>Then, if the element is one of the void elements, then there may be a
Expand Down Expand Up @@ -37884,9 +37875,9 @@ function receiver(e) {
(<code>&gt;</code>) character.
</ol>

<h5 id=attributes0><span class=secno>8.1.2.3. </span>Attributes</h5>
<h5 id=attributes1><span class=secno>8.1.2.3. </span>Attributes</h5>

<p><dfn id=attributes1 title=syntax-attributes>Attributes</dfn> for an
<p><dfn id=attributes2 title=syntax-attributes>Attributes</dfn> for an
element are expressed inside the element's start tag.

<p>Attributes have a name and a value. <dfn id=attribute
Expand Down
Loading

0 comments on commit 7424da0

Please sign in to comment.