Skip to content

Commit

Permalink
define DOM interfaces for remaining table elements
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@288 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 13, 2006
1 parent 2ac31bb commit 7ccc7fc
Show file tree
Hide file tree
Showing 2 changed files with 382 additions and 50 deletions.
226 changes: 198 additions & 28 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -10716,13 +10716,13 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>
no <code><a href="#col0">col</a></code> elements, then the element may
have a <dfn id=span1 title=attr-colgroup-span><code>span</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 either an error or zero,
is 1.
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="#colgroup0">colgroup</a></code> element and its <code
title=dom-colgroup-span><a href="#span2">span</a></code> attribute take
title=attr-colgroup-span><a href="#span1">span</a></code> attribute take
part in the <a href="#table1">table model</a>.

<p>The <dfn id=span2 title=dom-colgroup-span><code>span</code></dfn> DOM
Expand Down Expand Up @@ -10782,14 +10782,15 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>

<p>The element may have a <dfn id=span3
title=attr-col-span><code>span</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 either an error or zero, is 1.
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="#col0">col</a></code> element and its <code
title=dom-col-span><a href="#span4">span</a></code> attribute take part in
the <a href="#table1">table model</a>.
title=attr-col-span><a href="#span3">span</a></code> attribute take part
in the <a href="#table1">table model</a>.

<p>The <dfn id=span4 title=dom-col-span><code>span</code></dfn> DOM
attribute must <a href="#reflect">reflect</a> the content attribute of the
Expand Down Expand Up @@ -10824,7 +10825,9 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>
<dd>
<pre
class=idl>interface <dfn id=htmltablesectionelement>HTMLTableSectionElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
// ...
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#rows0" title=dom-tbody-rows>rows</a>;
<a href="#htmlelement">HTMLElement</a> <a href="#insertrow0" title=dom-tbody-insertRow>insertRow</a>(in long index);
void <a href="#deleterow0" title=dom-tbody-deleteRow>deleteRow</a>(in long index);
};</pre>

<p>The <code><a
Expand All @@ -10842,7 +10845,41 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>
<p>The <code><a href="#tbody0">tbody</a></code> element takes part in the
<a href="#table1">table model</a>.

<p class=big-issue>interface definitions...
<p>The <dfn id=rows0 title=dom-tbody-rows><code>rows</code></dfn> attribute
must return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
rooted at the element, whose filter matches only <code><a
href="#tr0">tr</a></code> elements that are children of the element.

<p>The <dfn id=insertrow0 title=dom-tbody-insertRow><code>insertRow(<var
title="">index</var>)</code></dfn> method must, when invoked on an element
<var title="">table section</var>, act as follows:

<p>If <var title="">index</var> is less than -1 or greater than the number
of elements in the <code title=dom-tbody-rows><a
href="#rows0">rows</a></code> collection, the method must raise an
<code>INDEX_SIZE_ERR</code> exception.

<p>If <var title="">index</var> is equal to -1 or equal to the number of
items in the <code title=dom-tbody-rows><a href="#rows0">rows</a></code>
collection, the method must create a <code><a href="#tr0">tr</a></code>
element, append it to the element <var title="">table section</var>, and
return the newly created <code><a href="#tr0">tr</a></code> element.

<p>Otherwise, the method must create a <code><a href="#tr0">tr</a></code>
element, insert it as a child of the <var title="">table section</var>
element, immediately before the <var title="">index</var>th <code><a
href="#tr0">tr</a></code> element in the <code title=dom-tbody-rows><a
href="#rows0">rows</a></code> collection, and finally must return the
newly created <code><a href="#tr0">tr</a></code> element.

<p>The <dfn id=deleterow0 title=dom-tbody-deleteRow><code>deleteRow(<var
title="">index</var>)</code></dfn> method must remove the <var
title="">index</var>th element in the <code title=dom-tbody-rows><a
href="#rows0">rows</a></code> collection from its parent. If <var
title="">index</var> is less than zero or greater than or equal to the
number of elements in the <code title=dom-tbody-rows><a
href="#rows0">rows</a></code> collection, the method must instead raise an
<code>INDEX_SIZE_ERR</code> exception.

<h4 id=the-thead><span class=secno>3.13.6. </span>The <dfn
id=thead1><code>thead</code></dfn> element</h4>
Expand Down Expand Up @@ -10969,7 +11006,11 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>
<dd>
<pre
class=idl>interface <dfn id=htmltablerowelement>HTMLTableRowElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
// ...
readonly attribute long <a href="#rowindex" title=dom-tr-rowIndex>rowIndex</a>;
readonly attribute long <a href="#rowindex0" title=dom-tr-sectionRowIndex>sectionRowIndex</a>;
readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#cells" title=dom-tr-cells>cells</a>;
<a href="#htmlelement">HTMLElement</a> <a href="#insertcell" title=dom-tr-insertCell>insertCell</a>(in long index);
void <span>deleteCell</span>(in long index);
};</pre>
</dl>

Expand All @@ -10979,7 +11020,68 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>
<p>The <code><a href="#tr0">tr</a></code> element takes part in the <a
href="#table1">table model</a>.

<p class=big-issue>interface definitions...
<p>The <dfn id=rowindex title=dom-tr-rowIndex><code>rowIndex</code></dfn>
element must, if the element has a parent <code><a
href="#table0">table</a></code> element, or a parent <code><a
href="#tbody0">tbody</a></code>, <code><a href="#thead1">thead</a></code>,
or <code><a href="#tfoot1">tfoot</a></code> element and a
<em>grandparent</em> <code><a href="#table0">table</a></code> element,
return the index of the <code><a href="#tr0">tr</a></code> element in that
<code>table<code> element's <code title=dom-table-rows><a
href="#rows">rows</a></code> collection. If there is no such <code><a
href="#table0">table</a></code> element, then the attribute must return
0.</code></code>

<p>The <dfn id=rowindex0
title=dom-tr-sectionRowIndex><code>rowIndex</code></dfn> element must, if
the element has a parent <code><a href="#table0">table</a></code>,
<code><a href="#tbody0">tbody</a></code>, <code><a
href="#thead1">thead</a></code>, or <code><a
href="#tfoot1">tfoot</a></code> element, return the index of the <code><a
href="#tr0">tr</a></code> element in the parent element's <code
title="">rows</code> collection (for tables, that's the <code
title=dom-table-rows><a href="#rows">rows</a></code> collection; for table
sections, that's the <code title=dom-tbody-rows><a
href="#rows0">rows</a></code> collection). If there is no such parent
element, then the attribute must return 0.

<p>The <dfn id=cells title=dom-tr-cells><code>cells</code></dfn> attribute
must return an <code><a href="#htmlcollection0">HTMLCollection</a></code>
rooted at the <code><a href="#tr0">tr</a></code> element, whose filter
matches only <code><a href="#td0">td</a></code> and <code><a
href="#th0">th</a></code> elements that are children of the <code><a
href="#tr0">tr</a></code> element.

<p>The <dfn id=insertcell title=dom-tr-insertCell><code>insertCell(<var
title="">index</var>)</code></dfn> method must act as follows:

<p>If <var title="">index</var> is less than -1 or greater than the number
of elements in the <code title=dom-tr-cells><a
href="#cells">cells</a></code> collection, the method must raise an
<code>INDEX_SIZE_ERR</code> exception.

<p>If <var title="">index</var> is equal to -1 or equal to the number of
items in <code title=dom-tr-cells><a href="#cells">cells</a></code>
collection, the method must create a <code><a href="#td0">td</a></code>
element, append it to the <code><a href="#tr0">tr</a></code> element, and
return the newly created <code><a href="#td0">td</a></code> element.

<p>Otherwise, the method must create a <code><a href="#td0">td</a></code>
element, insert it as a child of the <code><a href="#tr0">tr</a></code>
element, immediately before the <var title="">index</var>th <code><a
href="#td0">td</a></code> or <code><a href="#th0">th</a></code> element in
the <code title=dom-tr-cells><a href="#cells">cells</a></code> collection,
and finally must return the newly created <code><a
href="#td0">td</a></code> element.

<p>The <dfn id=deletecell title=dom-tr-deleteCell><code>deleteCell(<var
title="">index</var>)</code></dfn> method must remove the <var
title="">index</var>th element in the <code title=dom-tr-cells><a
href="#cells">cells</a></code> collection from its parent. If <var
title="">index</var> is less than zero or greater than or equal to the
number of elements in the <code title=dom-tr-cells><a
href="#cells">cells</a></code> collection, the method must instead raise
an <code>INDEX_SIZE_ERR</code> exception.

<h4 id=the-td><span class=secno>3.13.9. </span>The <dfn
id=td0><code>td</code></dfn> element</h4>
Expand All @@ -10997,26 +11099,59 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>

<dt>Element-specific attributes:

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

<dd><code title=attr-td-rowspan>rowspan</code>
<dd><code title=attr-td-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>;
};</pre>
</dl>

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

<p>The <code><a href="#td0">td</a></code> element takes part in the <a
href="#table1">table model</a>.
<p>The <code><a href="#td0">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="#td0">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="#td0">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
take part in the <a href="#table1">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 class=big-issue>interface definitions...
<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="#tr0">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=the-th><span class=secno>3.13.10. </span>The <dfn
id=th0><code>th</code></dfn> element</h4>
Expand All @@ -11034,28 +11169,63 @@ Address: &lt;input name="address"&gt;&lt;/p&gt;</pre>

<dt>Element-specific attributes:

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

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

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

<dt>DOM interface:

<dd>
<pre
class=idl>interface <dfn id=htmltableheadercellelement>HTMLTableHeaderCellElement</dfn> : <a href="#htmltablecellelement">HTMLTableCellElement</a> {
// ...
attribute DOMString <a href="#scope1" title=dom-th-scope>scope</a>;
};</pre>
</dl>

<p>The <code><a href="#th0">th</a></code> element represents a header cell
in a table.

<p>The <code><a href="#th0">th</a></code> element takes part in the <a
href="#table1">table model</a>.
<p>The <code><a href="#th0">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="#th0">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="#th0">th</a></code> element may have a <dfn id=scope0
title=attr-th-scope><code>scope</code></dfn> content attribute specified,
whose value must be one of the following literal strings: <code
title=attr-th-scope-row>row</code>, <code
title=attr-th-scope-cell>cell</code>, <code
title=attr-th-scope-row>rowgroup</code>, or <code
title=attr-th-scope-cell>cellgroup</code>.

<p>The <code><a href="#th0">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-th-scope><a href="#scope0">scope</a></code> attributes take
part in the <a href="#table1">table model</a>.

<p class=big-issue>interface definitions...
<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="#td0">td</a></code> section.

<h3 id=forms><span class=secno>3.14. </span>Forms <a href="#tbw"
title=TBW>[TBW]</a></h3>
Expand Down
Loading

0 comments on commit 7ccc7fc

Please sign in to comment.