Skip to content

Commit

Permalink
Merge the two table cell interfaces together
Browse files Browse the repository at this point in the history
Ever since the dawn of HTML (2ac31bb),
there have been two table cell interfaces, HTMLTableDataCellElement for
<td>, and HTMLTableHeaderCellElement for <th>. No browser ever
implemented this split, instead using the single HTMLTableCellElement
interface. This aligns the spec with browser reality.

Fixes #1115.
  • Loading branch information
domenic committed Apr 26, 2016
1 parent 9997cd9 commit e383ae2
Showing 1 changed file with 23 additions and 35 deletions.
58 changes: 23 additions & 35 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -39457,7 +39457,17 @@ the cell that corresponds to the values of the two dice.
<!-- v2 char, to specify the decimal character used in numeric cells -->
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
<dd>
<pre class="idl">interface <dfn>HTMLTableDataCellElement</dfn> : <span>HTMLTableCellElement</span> {};</pre>
<pre class="idl">interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute unsigned long <span data-x="dom-tdth-colSpan">colSpan</span>;
[<span>CEReactions</span>] attribute unsigned long <span data-x="dom-tdth-rowSpan">rowSpan</span>;
[<span>CEReactions</span>, SameObject, PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-tdth-headers">headers</span>;
readonly attribute long <span data-x="dom-tdth-cellIndex">cellIndex</span>;

[<span>CEReactions</span>] attribute DOMString <span data-x="dom-th-scope">scope</span>; // only conforming for th elements
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-th-abbr">abbr</span>; // only conforming for th elements
};</pre>

<p>The <code>HTMLTableCellElement</code> interface is also used for <code>th</code> elements.</p>
</dd>
</dl><!--TOPIC:HTML-->

Expand Down Expand Up @@ -39541,10 +39551,7 @@ the cell that corresponds to the values of the two dice.
<dd><code data-x="attr-th-abbr">abbr</code></dd>
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
<dd>
<pre class="idl">interface <dfn>HTMLTableHeaderCellElement</dfn> : <span>HTMLTableCellElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-th-scope">scope</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-th-abbr">abbr</span>;
};</pre>
<code>HTMLTableCellElement</code>, as defined for <code>td</code> elements.
</dd>
</dl><!--TOPIC:HTML-->

Expand Down Expand Up @@ -39607,12 +39614,6 @@ the cell that corresponds to the values of the two dice.
data-x="attr-tdth-rowspan">rowspan</code>, <code data-x="attr-tdth-headers">headers</code>, and
<code data-x="attr-th-scope">scope</code> attributes take part in the <span>table model</span>.</p>

<p>The <dfn><code data-x="dom-th-scope">scope</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name, <span>limited to only known values</span>.</p>

<p>The <dfn><code data-x="dom-th-abbr">abbr</code></dfn> IDL attribute must <span>reflect</span>
the content attributes of the same name.</p>

</div>

<div class="example">
Expand Down Expand Up @@ -39711,16 +39712,6 @@ the cell that corresponds to the values of the two dice.

<hr>

<p>The <code>td</code> and <code>th</code> elements implement interfaces that inherit from the
<code>HTMLTableCellElement</code> interface:</p>

<pre class="idl">interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute unsigned long <span data-x="dom-tdth-colSpan">colSpan</span>;
[<span>CEReactions</span>] attribute unsigned long <span data-x="dom-tdth-rowSpan">rowSpan</span>;
[<span>CEReactions</span>, SameObject, PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-tdth-headers">headers</span>;
readonly attribute long <span data-x="dom-tdth-cellIndex">cellIndex</span>;
};</pre>

<!--TOPIC:DOM APIs-->
<dl class="domintro">

Expand Down Expand Up @@ -39761,6 +39752,12 @@ the cell that corresponds to the values of the two dice.
element's <code data-x="dom-tr-cells">cells</code> collection. If there is no such parent element,
then the attribute must return &#x2212;1.</p>

<p>The <dfn><code data-x="dom-th-scope">scope</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name, <span>limited to only known values</span>.</p>

<p>The <dfn><code data-x="dom-th-abbr">abbr</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name.</p>

</div>
<!--TOPIC:HTML-->

Expand Down Expand Up @@ -113138,7 +113135,7 @@ if (s = prompt('What is your name?')) {
data-x="attr-tdth-nowrap">nowrap</code> content attributes.</p>

<p>The <dfn><code data-x="dom-tdth-vAlign">vAlign</code></dfn> IDL attribute of the <code>td</code>
and <code>th</code> element must <span>reflect</span> the elements' <code
and <code>th</code> elements must <span>reflect</span> the elements' <code
data-x="attr-tdth-valign">valign</code> content attributes.</p>

<p>The <dfn><code data-x="dom-tdth-bgColor">bgColor</code></dfn> IDL attribute of the
Expand All @@ -113147,15 +113144,6 @@ if (s = prompt('What is your name?')) {

<hr>

<pre class="idl">partial interface <span id="HTMLTableDataCellElement-partial">HTMLTableDataCellElement</span> {
attribute DOMString <span data-x="dom-td-abbr">abbr</span>;
};</pre>

<p>The <dfn><code data-x="dom-td-abbr">abbr</code></dfn> IDL attribute of the <code>td</code>
element must <span>reflect</span> the respective content attributes of the same name.</p>

<hr>

<pre class="idl">partial interface <span id="HTMLTableRowElement-partial">HTMLTableRowElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-tr-align">align</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-tr-ch">ch</span>;
Expand Down Expand Up @@ -115424,7 +115412,7 @@ interface <dfn>External</dfn> {
<code data-x="attr-tdth-colspan">colspan</code>;
<code data-x="attr-tdth-rowspan">rowspan</code>;
<code data-x="attr-tdth-headers">headers</code></td>
<td><code>HTMLTableDataCellElement</code></td>
<td><code>HTMLTableCellElement</code></td>
</tr>

<tr>
Expand Down Expand Up @@ -115501,7 +115489,7 @@ interface <dfn>External</dfn> {
<code data-x="attr-tdth-headers">headers</code>;
<code data-x="attr-th-scope">scope</code>;
<code data-x="attr-th-abbr">abbr</code></td>
<td><code>HTMLTableHeaderCellElement</code></td>
<td><code>HTMLTableCellElement</code></td>
</tr>

<tr>
Expand Down Expand Up @@ -118015,7 +118003,7 @@ interface <dfn>External</dfn> {

<tr>
<td> <code>td</code>
<td> <code>HTMLTableDataCellElement</code> : <code>HTMLTableCellElement</code> : <code>HTMLElement</code>
<td> <code>HTMLTableCellElement</code> : <code>HTMLElement</code>

<tr>
<td> <code>template</code>
Expand All @@ -118031,7 +118019,7 @@ interface <dfn>External</dfn> {

<tr>
<td> <code>th</code>
<td> <code>HTMLTableHeaderCellElement</code> : <code>HTMLTableCellElement</code> : <code>HTMLElement</code>
<td> <code>HTMLTableCellElement</code> : <code>HTMLElement</code>

<tr>
<td> <code>thead</code>
Expand Down

0 comments on commit e383ae2

Please sign in to comment.