[html5] r1377 - /

whatwg at whatwg.org whatwg at whatwg.org
Fri Mar 21 17:12:35 PDT 2008


Author: ianh
Date: 2008-03-21 17:12:34 -0700 (Fri, 21 Mar 2008)
New Revision: 1377

Modified:
   index
   source
Log:
[act] (0) Smarter table header cell / data cell association algorithm.

Modified: index
===================================================================
--- index	2008-03-20 23:38:10 UTC (rev 1376)
+++ index	2008-03-22 00:12:34 UTC (rev 1377)
@@ -24,7 +24,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=working>Working Draft — 20 March 2008</h2>
+   <h2 class="no-num no-toc" id=working>Working Draft — 21 March 2008</h2>
 
    <p>You can take part in this work. <a
     href="http://www.whatwg.org/mailing-list">Join the working group's
@@ -20151,7 +20151,7 @@
    title="">height</var> such that the row group covers all the slots with
    coordinates (<var title="">x</var>, <var title="">y</var>) where
    <span>0 ≤ <var title="">x</var> < <var
-   title="">x<sub title="">width</sub></var>-1</span> and <span><var
+   title="">x<sub title="">width</sub></var></span> and <span><var
    title="">group<sub title="">y</sub></var> ≤ <var
    title="">y</var> < <var title="">group<sub
    title="">y</sub></var>+<var title="">height</var></span>. Row groups
@@ -20169,7 +20169,7 @@
    title="">x</var> < <var title="">group<sub
    title="">x</sub></var>+<var title="">width</var></span> and
    <span>0 ≤ <var title="">y</var> < <var
-   title="">y<sub title="">height</sub></var>-1</span>. Column groups
+   title="">y<sub title="">height</sub></var></span>. Column groups
    correspond to <code><a href="#colgroup">colgroup</a></code> elements. Not
    every column is necessarily in a column group.
 
@@ -20697,136 +20697,212 @@
        slot to which the header cell is anchored.</p>
 
      <li>
+      <p>Let <var title="">header<sub title="">width</sub></var> be the width
+       of the header cell.</p>
+
+     <li>
+      <p>Let <var title="">header<sub title="">height</sub></var> be the
+       height of the header cell.</p>
+
+     <li>
+      <p>Let <var title="">data cells</var> be a list of data cells,
+       initially empty.</p>
+
+     <li>
       <p>Examine the <code title=attr-th-scope><a
        href="#scope0">scope</a></code> attribute of the <code><a
        href="#th">th</a></code> element corresponding to the header cell,
        and, based on its state, apply the appropriate substep:</p>
-      <!-- XXX this entire switch statement should be changed around
-      so that it just defines the area to assign headers in, and the
-      direction to do the assigning in, and then defers to a set of
-      steps below it that then does the assigning. Then, we can
-      support colspaning/rowspaning headers and can stop when we hit
-      other headers, if we want to do that. -->
-      
+
       <dl class=switch>
        <dt>If it is in the <em title=attr-th-scope-row><a
         href="#row">row</a></em> state
 
        <dd>
-        <p>Assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">header<sub title="">x</sub></var> < <var
-         title="">data<sub title="">x</sub></var> ≤ <var
-         title="">x<sub title="">width</sub></var></span> and <span><var
-         title="">data<sub title="">y</sub></var> = <var
-         title="">header<sub title="">y</sub></var></span>, except for any
-         data cells corresponding to <code><a href="#td">td</a></code>
-         elements that have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+        <p>Add all the data cells that cover slots with coordinates (<var
+         title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+         title="">y</sub></var>), where <span><var title="">header<sub
+         title="">x</sub></var>+<var title="">header<sub
+         title="">width</sub></var> ≤ <var title="">slot<sub
+         title="">x</sub></var> < <var title="">x<sub
+         title="">width</sub></var></span> and <span><var title="">header<sub
+         title="">y</sub></var> ≤ <var title="">slot<sub
+         title="">y</sub></var> < <var title="">header<sub
+         title="">y</sub></var>+<var title="">header<sub
+         title="">height</sub></var></span>, to the <var title="">data
+         cells</var> list.</p>
 
        <dt>If it is in the <em title=attr-th-scope-col><a
         href="#col0">column</a></em> state
 
        <dd>
-        <p>Assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">data<sub title="">x</sub></var> = <var
-         title="">header<sub title="">x</sub></var></span> and <span><var
-         title="">header<sub title="">y</sub></var> < <var
-         title="">data<sub title="">y</sub></var> ≤ <var
-         title="">y<sub title="">height</sub></var></span>, except for any
-         data cells corresponding to <code><a href="#td">td</a></code>
-         elements that have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+        <p>Add all the data cells that cover slots with coordinates (<var
+         title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+         title="">y</sub></var>), where <span><var title="">header<sub
+         title="">x</sub></var> ≤ <var title="">slot<sub
+         title="">x</sub></var> < <var title="">header<sub
+         title="">x</sub></var>+<var title="">header<sub
+         title="">width</sub></var></span> and <span><var title="">header<sub
+         title="">y</sub></var>+<var title="">header<sub
+         title="">height</sub></var> ≤ <var title="">slot<sub
+         title="">y</sub></var> < <var title="">y<sub
+         title="">height</sub></var></span>, to the <var title="">data
+         cells</var> list.</p>
 
        <dt>If it is in the <em title=attr-th-scope-rowgroup><a
         href="#rowgroup">row group</a></em> state
 
        <dd>
         <p>If the header cell is not in a <a href="#row-group"
-         title=concept-row-group>row group</a>, then don't assign the header
-         cell to any data cells.</p>
+         title=concept-row-group>row group</a>, then do nothing.</p>
 
-        <p>Otherwise, let (1, <var title="">group<sub title="">y</sub></var>)
+        <p>Otherwise, let (0, <var title="">group<sub title="">y</sub></var>)
          be the slot at which the row group is anchored, let <var
          title="">height</var> be the number of rows in the row group, and
-         assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">header<sub title="">x</sub></var> ≤ <var
-         title="">data<sub title="">x</sub></var> ≤ <var
-         title="">x<sub title="">width</sub></var></span> and <span><var
-         title="">header<sub title="">y</sub></var> ≤ <var
-         title="">data<sub title="">y</sub></var> < <var
-         title="">group<sub title="">y</sub></var>+<var
-         title="">height</var></span>, except for any data cells
-         corresponding to <code><a href="#td">td</a></code> elements that
-         have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+         add all the data cells that cover slots with coordinates (<var
+         title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+         title="">y</sub></var>), where <span><var title="">header<sub
+         title="">x</sub></var> ≤ <var title="">slot<sub
+         title="">x</sub></var> < <var title="">x<sub
+         title="">width</sub></var></span> and <span><var title="">header<sub
+         title="">y</sub></var> ≤ <var title="">slot<sub
+         title="">y</sub></var> < <var title="">group<sub
+         title="">y</sub></var>+<var title="">height</var></span>, to the
+         <var title="">data cells</var> list.</p>
 
        <dt>If it is in the <em title=attr-th-scope-colgroup><a
         href="#colgroup0">column group</a></em> state
 
        <dd>
         <p>If the header cell is not in a <a href="#column0"
-         title=concept-column-group>column group</a>, then don't assign the
-         header cell to any data cells.</p>
+         title=concept-column-group>column group</a>, then do nothing.</p>
 
-        <p>Otherwise, let (<var title="">group<sub title="">x</sub></var>, 1)
+        <p>Otherwise, let (<var title="">group<sub title="">x</sub></var>, 0)
          be the slot at which the column group is anchored, let <var
          title="">width</var> be the number of columns in the column group,
-         and assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">header<sub title="">x</sub></var> ≤ <var
-         title="">data<sub title="">x</sub></var> < <var
-         title="">group<sub title="">x</sub></var>+<var
-         title="">width</var></span> and <span><var title="">header<sub
-         title="">y</sub></var> ≤ <var title="">data<sub
-         title="">y</sub></var> ≤ <var title="">y<sub
-         title="">height</sub></var></span>, except for any data cells
-         corresponding to <code><a href="#td">td</a></code> elements that
-         have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+         and add all the data cells that cover slots with coordinates (<var
+         title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+         title="">y</sub></var>), where <span><var title="">header<sub
+         title="">x</sub></var> ≤ <var title="">slot<sub
+         title="">x</sub></var> < <var title="">group<sub
+         title="">x</sub></var>+<var title="">width</var></span> and
+         <span><var title="">header<sub
+         title="">y</sub></var> ≤ <var title="">slot<sub
+         title="">y</sub></var> < <var title="">y<sub
+         title="">height</sub></var></span>, to the <var title="">data
+         cells</var> list.</p>
 
        <dt>Otherwise, it is in the <em title="">auto</em> state
 
        <dd>
-        <p>If the header cell is not in the first row of the table, or not in
-         the first cell of a row, then don't assign the header cell to any
-         data cells.</p>
+        <p>Run these steps:</p>
 
-        <p class=big-issue>This is shortly to be made better and more
-         magical.</p>
+        <ol>
+         <li>
+          <p>If the header cell is <a href="#equivalent">equivalent to a wide
+           cell</a>, let <var title="">header<sub title="">width</sub></var>
+           equal <span><var title="">x<sub title="">width</sub></var>-<var
+           title="">header<sub title="">x</sub></var></span>. <a
+           href="#refsUNICODE">[UNICODE]</a></p>
 
-        <p>Otherwise, if the header cell is in the first row of the table,
-         assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">data<sub title="">x</sub></var> = <var
-         title="">header<sub title="">x</sub></var></span> and <span><var
-         title="">header<sub title="">y</sub></var> < <var
-         title="">data<sub title="">y</sub></var> ≤ <var
-         title="">y<sub title="">height</sub></var></span>, except for any
-         data cells corresponding to <code><a href="#td">td</a></code>
-         elements that have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+         <li>
+          <p>Let <var title="">x</var> equal <span><var title="">header<sub
+           title="">x</sub></var>+<var title="">header<sub
+           title="">width</sub></var></span>.</p>
 
-        <p>Otherwise, the header cell is in the first column of the table;
-         assign the header cell to any data cells anchored at slots with
-         coordinates (<var title="">data<sub title="">x</sub></var>, <var
-         title="">data<sub title="">y</sub></var>) where <span><var
-         title="">header<sub title="">x</sub></var> < <var
-         title="">data<sub title="">x</sub></var> ≤ <var
-         title="">x<sub title="">width</sub></var></span> and <span><var
-         title="">data<sub title="">y</sub></var> = <var
-         title="">header<sub title="">y</sub></var></span>, except for any
-         data cells corresponding to <code><a href="#td">td</a></code>
-         elements that have a <code title=attr-td-headers><a
-         href="#headers">headers</a></code> attribute specified.</p>
+         <li>
+          <p><i>Horizontal</i>: If <var title="">x</var> is equal to <var
+           title="">x<sub title="">width</sub></var>, then jump down to the
+           step below labelled <i>vertical</i>.</p>
+
+         <li>
+          <p>If there is a header cell anchored at (<var title="">x</var>,
+           <var title="">header<sub title="">y</sub></var>) with height <var
+           title="">header<sub title="">height</sub></var>, then jump down to
+           the step below labelled <i>vertical</i>.</p>
+
+         <li>
+          <p>Add all the data cells that cover slots with coordinates (<var
+           title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+           title="">y</sub></var>), where <span><var title="">slot<sub
+           title="">x</sub></var> = <var title="">x</var></span>
+           and <span><var title="">header<sub
+           title="">y</sub></var> ≤ <var title="">slot<sub
+           title="">y</sub></var> < <var title="">header<sub
+           title="">y</sub></var>+<var title="">header<sub
+           title="">height</sub></var></span>, to the <var title="">data
+           cells</var> list.</p>
+
+         <li>
+          <p>Increase <var title="">x</var> by 1.</p>
+
+         <li>
+          <p>Jump up to the step above labelled <i>horizontal</i>.</p>
+
+         <li>
+          <p>Let <var title="">y</var> equal <var title="">header<sub
+           title="">y</sub></var>.</p>
+
+         <li>
+          <p><i>Vertical</i>: let <var title="">y</var> equal <span><var
+           title="">header<sub title="">y</sub></var>+<var
+           title="">header<sub title="">height</sub></var></span>.</p>
+
+         <li>
+          <p>If <var title="">y</var> is equal to <var title="">y<sub
+           title="">height</sub></var>, then jump to the step below labelled
+           <i>end</i>.</p>
+
+         <li>
+          <p>If there is a header cell <var title="">cell</var> anchored at
+           (<var title="">header<sub title="">x</sub></var>, <var
+           title="">y</var>), then follow these substeps:</p>
+
+          <ol>
+           <li>
+            <p>If the header cell <var title="">cell</var> is <a
+             href="#equivalent">equivalent to a wide cell</a>, then let <var
+             title="">width</var> be <span><var title="">x<sub
+             title="">width</sub></var>-<var title="">header<sub
+             title="">x</sub></var></span>. Otherwise, let <var
+             title="">width</var> be the width of the header cell <var
+             title="">cell</var>.</p>
+
+           <li>
+            <p>If <var title="">width</var> is equal to <var
+             title="">header<sub title="">width</sub></var>, then jump to the
+             step below labelled <i>end</i>.</p>
+          </ol>
+
+         <li>
+          <p>Add all the data cells that cover slots with coordinates (<var
+           title="">slot<sub title="">x</sub></var>, <var title="">slot<sub
+           title="">y</sub></var>), where <span><var title="">header<sub
+           title="">x</sub></var> ≤ <var title="">slot<sub
+           title="">x</sub></var> < <var title="">header<sub
+           title="">x</sub></var>+<var title="">header<sub
+           title="">width</sub></var></span> and <span><var title="">slot<sub
+           title="">y</sub></var> = <var title="">y</var></span>,
+           to the <var title="">data cells</var> list.</p>
+
+         <li>
+          <p>Increase <var title="">y</var> by 1.</p>
+
+         <li>
+          <p>Jump up to the step above labelled <i>vertical</i>.</p>
+
+         <li>
+          <p><i>End</i>: Coalesce all the duplicate entries in the <var
+           title="">data cells</var> list, so that each data cell is only
+           present once, in tree order.</p>
+        </ol>
       </dl>
+
+     <li>
+      <p>Assign the header cell to all the data cells <var title="">data
+       cells</var> that correspond to <code><a href="#td">td</a></code>
+       elements that do not have a <code title=attr-td-headers><a
+       href="#headers">headers</a></code> attribute specified.</p>
     </ol>
 
    <li>
@@ -20866,6 +20942,32 @@
     </ol>
   </ol>
 
+  <p>A header cell anchored at (<var title="">header<sub
+   title="">x</sub></var>, <var title="">header<sub title="">y</sub></var>)
+   with width <var title="">header<sub title="">width</sub></var> and height
+   <var title="">header<sub title="">height</sub></var> is said to be <dfn
+   id=equivalent>equivalent to a wide cell</dfn> if all the slots with
+   coordinates (<var title="">slot<sub title="">x</sub></var>, <var
+   title="">slot<sub title="">y</sub></var>), where <span><var
+   title="">header<sub title="">x</sub></var>+<var title="">header<sub
+   title="">width</sub></var> ≤ <var title="">slot<sub
+   title="">x</sub></var> < <var title="">x<sub
+   title="">width</sub></var></span> and <span><var title="">header<sub
+   title="">y</sub></var> ≤ <var title="">slot<sub
+   title="">y</sub></var> < <var title="">header<sub
+   title="">y</sub></var>+<var title="">header<sub
+   title="">height</sub></var></span>, are all either empty or covered by <a
+   href="#empty0" title="empty data cell">empty data cells</a>.
+
+  <p>A data cell is said to be an <dfn id=empty0>empty data cell</dfn> if it
+   contains no elements and its text content, if any, consists only of
+   characters in the Unicode character class Zs. <a
+   href="#refsUNICODE">[UNICODE]</a>
+
+  <p>User agents may remove <a href="#empty0" title="empty data cell">empty
+   data cells</a> when analysing data in a <span title="concept
+   table">table</span>.
+
   <h3 id=forms><span class=secno>3.14 </span>Forms</h3>
   <!-- XXX everything in WF2 -->
 

Modified: source
===================================================================
--- source	2008-03-20 23:38:10 UTC (rev 1376)
+++ source	2008-03-22 00:12:34 UTC (rev 1377)
@@ -17645,7 +17645,7 @@
   with coordinates (<var title="">x</var>, <var title="">y</var>)
   where <span>0 ≤ <var
   title="">x</var> < <var title="">x<sub
-  title="">width</sub></var>-1</span> and <span><var
+  title="">width</sub></var></span> and <span><var
   title="">group<sub title="">y</sub></var> ≤ <var
   title="">y</var> < <var title="">group<sub
   title="">y</sub></var>+<var title="">height</var></span>. Row groups
@@ -17663,7 +17663,7 @@
   title="">x</var> < <var title="">group<sub
   title="">x</sub></var>+<var title="">width</var></span> and
   <span>0 ≤ <var title="">y</var> < <var
-  title="">y<sub title="">height</sub></var>-1</span>. Column groups
+  title="">y<sub title="">height</sub></var></span>. Column groups
   correspond to <code>colgroup</code> elements. Not every column is
   necessarily in a column group.</p>
 
@@ -18379,36 +18379,52 @@
 
      <li>
 
+      <p>Let <var title="">header<sub title="">width</sub></var> be
+      the width of the header cell.</p>
+
+     </li>
+
+     <li>
+
+      <p>Let <var title="">header<sub title="">height</sub></var> be
+      the height of the header cell.</p>
+
+     </li>
+
+     <li>
+
+      <p>Let <var title="">data cells</var> be a list of data cells,
+      initially empty.</p>
+
+     </li>
+
+     <li>
+
       <p>Examine the <code title="attr-th-scope">scope</code>
       attribute of the <code>th</code> element corresponding to the
       header cell, and, based on its state, apply the appropriate
       substep:</p>
 
-      <!-- XXX this entire switch statement should be changed around
-      so that it just defines the area to assign headers in, and the
-      direction to do the assigning in, and then defers to a set of
-      steps below it that then does the assigning. Then, we can
-      support colspaning/rowspaning headers and can stop when we hit
-      other headers, if we want to do that. -->
-
       <dl class="switch">
 
        <dt>If it is in the <em title="attr-th-scope-row">row</em> state</dt>
 
        <dd>
 
-        <p>Assign the header cell to any data cells anchored at slots
-        with coordinates (<var title="">data<sub
-        title="">x</sub></var>, <var title="">data<sub
-        title="">y</sub></var>) where <span><var title="">header<sub
-        title="">x</sub></var> < <var title="">data<sub
-        title="">x</sub></var> ≤ <var title="">x<sub
-        title="">width</sub></var></span> and <span><var
-        title="">data<sub title="">y</sub></var> = <var
-        title="">header<sub title="">y</sub></var></span>, except for
-        any data cells corresponding to <code>td</code> elements that
-        have a <code title="attr-td-headers">headers</code> attribute
-        specified.</p>
+        <p>Add all the data cells that cover slots with coordinates
+        (<var title="">slot<sub title="">x</sub></var>, <var
+        title="">slot<sub title="">y</sub></var>), where <span><var
+        title="">header<sub title="">x</sub></var>+<var
+        title="">header<sub
+        title="">width</sub></var> ≤ <var
+        title="">slot<sub title="">x</sub></var> < <var
+        title="">x<sub title="">width</sub></var></span> and
+        <span><var title="">header<sub
+        title="">y</sub></var> ≤ <var title="">slot<sub
+        title="">y</sub></var> < <var title="">header<sub
+        title="">y</sub></var>+<var title="">header<sub
+        title="">height</sub></var></span>, to the <var title="">data
+        cells</var> list.</p>
 
        </dd>
 
@@ -18416,18 +18432,19 @@
 
        <dd>
 
-        <p>Assign the header cell to any data cells anchored at slots
-        with coordinates (<var title="">data<sub
-        title="">x</sub></var>, <var title="">data<sub
-        title="">y</sub></var>) where <span><var title="">data<sub
-        title="">x</sub></var> = <var title="">header<sub
-        title="">x</sub></var></span> and <span><var
-        title="">header<sub title="">y</sub></var> < <var
-        title="">data<sub title="">y</sub></var> ≤ <var
-        title="">y<sub title="">height</sub></var></span>, except for any
-        data cells corresponding to <code>td</code> elements that have
-        a <code title="attr-td-headers">headers</code> attribute
-        specified.</p>
+        <p>Add all the data cells that cover slots with coordinates
+        (<var title="">slot<sub title="">x</sub></var>, <var
+        title="">slot<sub title="">y</sub></var>), where <span><var
+        title="">header<sub title="">x</sub></var> ≤ <var
+        title="">slot<sub title="">x</sub></var> < <var
+        title="">header<sub title="">x</sub></var>+<var
+        title="">header<sub title="">width</sub></var></span> and
+        <span><var title="">header<sub title="">y</sub></var>+<var
+        title="">header<sub
+        title="">height</sub></var> ≤ <var
+        title="">slot<sub title="">y</sub></var> < <var
+        title="">y<sub title="">height</sub></var></span>, to the <var
+        title="">data cells</var> list.</p>
 
        </dd>
 
@@ -18436,26 +18453,24 @@
        <dd>
 
         <p>If the header cell is not in a <span
-        title="concept-row-group">row group</span>, then don't assign
-        the header cell to any data cells.</p>
+        title="concept-row-group">row group</span>, then do
+        nothing.</p>
 
-        <p>Otherwise, let (1, <var title="">group<sub
+        <p>Otherwise, let (0, <var title="">group<sub
         title="">y</sub></var>) be the slot at which the row group is
         anchored, let <var title="">height</var> be the number of rows
-        in the row group, and assign the header cell to any data cells
-        anchored at slots with coordinates (<var title="">data<sub
-        title="">x</sub></var>, <var title="">data<sub
-        title="">y</sub></var>) where <span><var title="">header<sub
-        title="">x</sub></var> ≤ <var title="">data<sub
-        title="">x</sub></var> ≤ <var title="">x<sub
+        in the row group, and add all the data cells that cover slots
+        with coordinates (<var title="">slot<sub
+        title="">x</sub></var>, <var title="">slot<sub
+        title="">y</sub></var>), where <span><var title="">header<sub
+        title="">x</sub></var> ≤ <var title="">slot<sub
+        title="">x</sub></var> < <var title="">x<sub
         title="">width</sub></var></span> and <span><var
         title="">header<sub title="">y</sub></var> ≤ <var
-        title="">data<sub title="">y</sub></var> < <var
+        title="">slot<sub title="">y</sub></var> < <var
         title="">group<sub title="">y</sub></var>+<var
-        title="">height</var></span>, except for any data cells
-        corresponding to <code>td</code> elements that have a <code
-        title="attr-td-headers">headers</code> attribute
-        specified.</p>
+        title="">height</var></span>, to the <var title="">data
+        cells</var> list.</p>
 
        </dd>
 
@@ -18464,26 +18479,24 @@
        <dd>
 
         <p>If the header cell is not in a <span
-        title="concept-column-group">column group</span>, then don't
-        assign the header cell to any data cells.</p>
+        title="concept-column-group">column group</span>, then do
+        nothing.</p>
 
         <p>Otherwise, let (<var title="">group<sub
-        title="">x</sub></var>, 1) be the slot at which the column
+        title="">x</sub></var>, 0) be the slot at which the column
         group is anchored, let <var title="">width</var> be the number
-        of columns in the column group, and assign the header cell to
-        any data cells anchored at slots with coordinates (<var
-        title="">data<sub title="">x</sub></var>, <var
-        title="">data<sub title="">y</sub></var>) where <span><var
-        title="">header<sub title="">x</sub></var> ≤ <var
-        title="">data<sub title="">x</sub></var> < <var
-        title="">group<sub title="">x</sub></var>+<var
-        title="">width</var></span> and <span><var title="">header<sub
-        title="">y</sub></var> ≤ <var title="">data<sub
-        title="">y</sub></var> ≤ <var title="">y<sub
-        title="">height</sub></var></span>, except for any data cells
-        corresponding to <code>td</code> elements that have a <code
-        title="attr-td-headers">headers</code> attribute
-        specified.</p>
+        of columns in the column group, and add all the data cells
+        that cover slots with coordinates (<var title="">slot<sub
+        title="">x</sub></var>, <var title="">slot<sub
+        title="">y</sub></var>), where <span><var title="">header<sub
+        title="">x</sub></var> ≤ <var title="">slot<sub
+        title="">x</sub></var> < <var title="">group<sub
+        title="">x</sub></var>+<var title="">width</var></span> and
+        <span><var title="">header<sub
+        title="">y</sub></var> ≤ <var title="">slot<sub
+        title="">y</sub></var> < <var title="">y<sub
+        title="">height</sub></var></span>, to the <var title="">data
+        cells</var> list.</p>
 
        </dd>
 
@@ -18491,47 +18504,184 @@
 
        <dd>
 
-        <p>If the header cell is not in the first row of the table, or
-        not in the first cell of a row, then don't assign the header
-        cell to any data cells.</p>
+        <p>Run these steps:</p>
 
-        <p class="big-issue">This is shortly to be made better and
-        more magical.</p>
+        <ol>
 
-        <p>Otherwise, if the header cell is in the first row of the
-        table, assign the header cell to any data cells anchored at
-        slots with coordinates (<var title="">data<sub
-        title="">x</sub></var>, <var title="">data<sub
-        title="">y</sub></var>) where <span><var title="">data<sub
-        title="">x</sub></var> = <var title="">header<sub
-        title="">x</sub></var></span> and <span><var
-        title="">header<sub title="">y</sub></var> < <var
-        title="">data<sub title="">y</sub></var> ≤ <var
-        title="">y<sub title="">height</sub></var></span>, except for any
-        data cells corresponding to <code>td</code> elements that have
-        a <code title="attr-td-headers">headers</code> attribute
-        specified.</p>
+         <li>
 
-        <p>Otherwise, the header cell is in the first column of the
-        table; assign the header cell to any data cells anchored at
-        slots with coordinates (<var title="">data<sub
-        title="">x</sub></var>, <var title="">data<sub
-        title="">y</sub></var>) where <span><var title="">header<sub
-        title="">x</sub></var> < <var title="">data<sub
-        title="">x</sub></var> ≤ <var title="">x<sub
-        title="">width</sub></var></span> and <span><var
-        title="">data<sub title="">y</sub></var> = <var
-        title="">header<sub title="">y</sub></var></span>, except for
-        any data cells corresponding to <code>td</code> elements that
-        have a <code title="attr-td-headers">headers</code> attribute
-        specified.</p>
+          <p>If the header cell is <span>equivalent to a wide
+          cell</span>, let <var title="">header<sub
+          title="">width</sub></var> equal <span><var title="">x<sub
+          title="">width</sub></var>-<var title="">header<sub
+          title="">x</sub></var></span>. <a
+          href="#refsUNICODE">[UNICODE]</a></p>
 
+         </li>
+
+         <li>
+
+          <p>Let <var title="">x</var> equal <span><var
+          title="">header<sub title="">x</sub></var>+<var
+          title="">header<sub title="">width</sub></var></span>.</p>
+
+         </li>
+
+         <li>
+
+          <p><i>Horizontal</i>: If <var title="">x</var> is equal to
+          <var title="">x<sub title="">width</sub></var>, then jump
+          down to the step below labelled <i>vertical</i>.</p>
+
+         </li>
+
+         <li>
+
+          <p>If there is a header cell anchored at (<var
+          title="">x</var>, <var title="">header<sub
+          title="">y</sub></var>) with height <var title="">header<sub
+          title="">height</sub></var>, then jump down to the step
+          below labelled <i>vertical</i>.</p>
+
+         </li>
+
+         <li>
+
+          <p>Add all the data cells that cover slots with coordinates
+          (<var title="">slot<sub title="">x</sub></var>, <var
+          title="">slot<sub title="">y</sub></var>), where <span><var
+          title="">slot<sub title="">x</sub></var> = <var
+          title="">x</var></span> and <span><var title="">header<sub
+          title="">y</sub></var> ≤ <var title="">slot<sub
+          title="">y</sub></var> < <var
+          title="">header<sub title="">y</sub></var>+<var
+          title="">header<sub title="">height</sub></var></span>, to
+          the <var title="">data cells</var> list.</p>
+
+         </li>
+
+         <li>
+
+          <p>Increase <var title="">x</var> by 1.</p>
+
+         </li>
+
+         <li>
+
+          <p>Jump up to the step above labelled <i>horizontal</i>.</p>
+
+         </li>
+
+         <li>
+
+          <p>Let <var title="">y</var> equal <var title="">header<sub
+          title="">y</sub></var>.</p>
+
+         </li>
+
+         <li>
+
+          <p><i>Vertical</i>: let <var title="">y</var> equal
+          <span><var title="">header<sub title="">y</sub></var>+<var
+          title="">header<sub title="">height</sub></var></span>.</p>
+
+         </li>
+
+         <li>
+
+          <p>If <var title="">y</var> is equal to <var title="">y<sub
+          title="">height</sub></var>, then jump to the step below
+          labelled <i>end</i>.</p>
+
+         </li>
+
+         <li>
+
+          <p>If there is a header cell <var title="">cell</var>
+          anchored at (<var title="">header<sub
+          title="">x</sub></var>, <var title="">y</var>), then follow
+          these substeps:</p>
+
+          <ol>
+
+           <li>
+
+            <p>If the header cell <var title="">cell</var> is
+            <span>equivalent to a wide cell</span>, then let <var
+            title="">width</var> be <span><var title="">x<sub
+            title="">width</sub></var>-<var title="">header<sub
+            title="">x</sub></var></span>. Otherwise, let <var
+            title="">width</var> be the width of the header cell <var
+            title="">cell</var>.</p>
+
+           </li>
+
+           <li>
+
+            <p>If <var title="">width</var> is equal to <var
+            title="">header<sub title="">width</sub></var>, then jump
+            to the step below labelled <i>end</i>.</p>
+
+           </li>
+
+          </ol>
+
+         </li>
+
+         <li>
+
+          <p>Add all the data cells that cover slots with coordinates
+          (<var title="">slot<sub title="">x</sub></var>, <var
+          title="">slot<sub title="">y</sub></var>), where <span><var
+          title="">header<sub
+          title="">x</sub></var> ≤ <var title="">slot<sub
+          title="">x</sub></var> < <var
+          title="">header<sub title="">x</sub></var>+<var
+          title="">header<sub title="">width</sub></var></span> and
+          <span><var title="">slot<sub
+          title="">y</sub></var> = <var
+          title="">y</var></span>, to the <var title="">data
+          cells</var> list.</p>
+
+         </li>
+
+         <li>
+
+          <p>Increase <var title="">y</var> by 1.</p>
+
+         </li>
+
+         <li>
+
+          <p>Jump up to the step above labelled <i>vertical</i>.</p>
+
+         </li>
+
+         <li>
+
+          <p><i>End</i>: Coalesce all the duplicate entries in the
+          <var title="">data cells</var> list, so that each data cell
+          is only present once, in tree order.</p>
+
+         </li>
+
+        </ol>
+
        </dd>
 
       </dl>
 
      </li>
 
+     <li>
+
+      <p>Assign the header cell to all the data cells <var
+      title="">data cells</var> that correspond to <code>td</code>
+      elements that do not have a <code
+      title="attr-td-headers">headers</code> attribute specified.</p>
+
+     </li>
+
     </ol>
 
    </li>
@@ -18591,7 +18741,34 @@
 
   </ol>
 
+  <p>A header cell anchored at (<var title="">header<sub
+  title="">x</sub></var>, <var title="">header<sub
+  title="">y</sub></var>) with width <var title="">header<sub
+  title="">width</sub></var> and height <var title="">header<sub
+  title="">height</sub></var> is said to be <dfn>equivalent to a wide
+  cell</dfn> if all the slots with coordinates (<var title="">slot<sub
+  title="">x</sub></var>, <var title="">slot<sub
+  title="">y</sub></var>), where <span><var title="">header<sub
+  title="">x</sub></var>+<var title="">header<sub
+  title="">width</sub></var> ≤ <var title="">slot<sub
+  title="">x</sub></var> < <var title="">x<sub
+  title="">width</sub></var></span> and <span><var title="">header<sub
+  title="">y</sub></var> ≤ <var title="">slot<sub
+  title="">y</sub></var> < <var title="">header<sub
+  title="">y</sub></var>+<var title="">header<sub
+  title="">height</sub></var></span>, are all either empty or covered
+  by <span title="empty data cell">empty data cells</span>.</p>
 
+  <p>A data cell is said to be an <dfn>empty data cell</dfn> if it
+  contains no elements and its text content, if any, consists only of
+  characters in the Unicode character class Zs. <a
+  href="#refsUNICODE">[UNICODE]</a></p>
+
+  <p>User agents may remove <span title="empty data cell">empty data
+  cells</span> when analysing data in a <span title="concept
+  table">table</span>.</p>
+
+
   <h3 id="forms">Forms</h3>
   <!-- XXX everything in WF2 -->
 




More information about the Commit-Watchers mailing list