<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13174</bug_id>
          
          <creation_ts>2011-07-07 17:08:43 +0000</creation_ts>
          <short_desc>Allow block elements inside TH, maybe add new THCAPTION element</short_desc>
          <delta_ts>2011-10-04 15:57:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>a11y, a11ytf</keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marat Tanalin | tanalin.com">mtanalin</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>jfoliot</cc>
    
    <cc>laura.lee.carlson</cc>
    
    <cc>lwatson</cc>
    
    <cc>mike</cc>
    
    <cc>ndw</cc>
    
    <cc>public-html-a11y</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>w3-bugs</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50776</commentid>
    <comment_count>0</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-07-07 17:08:43 +0000</bug_when>
    <thetext>In XHTML 1.0, block elements inside TH elements was allowed.

In HTML5, only phrasing content is allowed inside TH:
http://www.w3.org/TR/html5/tabular-data.html#the-th-element

This is bad in some cases, and forces developers to use TD instead of TH when the cell actually contains _heading_ content. Using TD instead of TH for heading content is harmful as for semantics.

For example:

&lt;th&gt;
	&lt;dl&gt;
		&lt;dt&gt;Actual header&lt;/dt&gt;
		&lt;dd&gt;Additional content that, by visual design,
		cannot be represented as a separate table cell&lt;/dd&gt;
	&lt;/dl&gt;
&lt;/th&gt;

Its very questionable that heading content cannot contain blocks at all according to common sense. However, if necessary, new THCAPTION element could be added to the HTML standard to resolve the semantic issue:

&lt;th&gt;
	&lt;dl&gt;
		&lt;dt&gt;&lt;thcaption&gt;Real header&lt;/thcaption&gt;&lt;/dt&gt;
		&lt;dd&gt;Additional content that, by visual design,
		cannot be represented as a separate table cell&lt;/dd&gt;
	&lt;/dl&gt;
&lt;/th&gt;

Thus, user agents (that ones that care about such semantics) would treat THCAPTION content as actual heading content of the TH, and all other content of the TH could be treated as non-heading content (as inside TD).

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50780</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-07-07 17:31:04 +0000</bug_when>
    <thetext>What is a specific real-world use-case where you want to put non-phrasing content inside a &lt;th&gt;?  Can you point to particular sites you were trying to write (or someone else was) where you did this or wanted to do it, and explain why?  Personally I&apos;m inclined to think this would be a good change, but it would help your case a lot if you provided specific real-world examples.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50785</commentid>
    <comment_count>2</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-07-07 17:54:07 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Personally I&apos;m inclined to think this would be a good change, but it
&gt; would help your case a lot if you provided specific real-world examples.

Real-world example:

&lt;th scope=&quot;row&quot;&gt;
	&lt;div&gt;&lt;a href=&quot;#&quot;&gt;Example preparation&lt;/a&gt;&lt;/div&gt;
	&lt;dl&gt;
		&lt;dt&gt;&lt;abbr title=&quot;International nonproprietary name&quot;&gt;INN&lt;/abbr&gt;:&lt;/dt&gt;
		&lt;dd&gt;&lt;a href=&quot;#&quot;&gt;Example nonproprietary name&lt;/a&gt;&lt;/dd&gt;
	&lt;/dl&gt;
&lt;/th&gt;

Example preparation is a preparation title.
INN is (sematically) DL and, by visual design, is placed inside TH after preparation title.

Moreover, both preparation title and international nonproprietary name are heading content, and so should be placed inside TH.

In XHTML 1.0, this is perfectly valid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54129</commentid>
    <comment_count>3</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:36:21 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54539</commentid>
    <comment_count>4</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-08-10 01:42:06 +0000</bug_when>
    <thetext>Another case where you might want flow content inside a &lt;th&gt; is &lt;h#&gt;.  Consider a Wikipedia article that consists of a single long table, with information about several hundred different things listed alphabetically.  You might want to subdivide it by letter, with rows like

&lt;tr&gt;&lt;th colspan=X&gt;&lt;h2&gt;M&lt;/h2&gt;&lt;/th&gt;&lt;/tr&gt;

But you want it to all be in one big table, not split into several tables, because it&apos;s logically one big table with hundreds of rows and not multiple unrelated tables.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55911</commentid>
    <comment_count>5</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-08-27 12:11:57 +0000</bug_when>
    <thetext>*** Bug 13924 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57520</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-29 20:55:21 +0000</bug_when>
    <thetext>No need for the &lt;hx&gt; in comment 4. The &lt;th&gt; provides sufficient semantics. In fact an &lt;hx&gt; element there would screw up the outline.

I don&apos;t understand the case in example 2. Can you show me a Web page using this?

The only use case that I&apos;ve seen on real sites is including a tooltip in a &lt;th&gt;. My plan is to address that by specifically allowing &lt;dialog&gt; when we introduce that later on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57524</commentid>
    <comment_count>7</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-09-29 21:11:22 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Can you show me a Web page using this?

http://cdl.ru/categories_in_item.mhtml?CatID=3&amp;ShortID=945
http://cdl.ru/categories_in_item.mhtml?CatID=3&amp;ShortID=69
etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57575</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-30 18:22:46 +0000</bug_when>
    <thetext>Hm, yeah, hard to argue with that. I guess I&apos;ll change the content model back to allowing flow content, but add an example or note explaining why putting headings in &lt;th&gt;s is a bad idea.

Maybe we should just allow flow but blacklist certain descendants, say sectioning content, sectioning roots, and heading content?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57595</commentid>
    <comment_count>9</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-09-30 20:48:49 +0000</bug_when>
    <thetext>(In reply to comment #8)

&gt; I guess I&apos;ll change the content model back to allowing flow content

Unbelievable. ;-)

&gt; but add an example or note explaining why putting
&gt; headings in &lt;th&gt;s is a bad idea.

Yes, it&apos;s good idea to give recommendations here instead of requiring smth. It makes sense to adopt this practice more widely in the HTML spec.

&gt; Maybe we should just allow flow but blacklist certain descendants, say
&gt; sectioning content, sectioning roots, and heading content?

Maybe. But, quoting yourself, wouldn&apos;t it be confusing for authors who do not read specs (as well as do not care about validation) at all?

Anyway, it may make sense to just rollback rules for TH to HTML4 state, and, instead of inventing some blacklists, work harder on more important things like providing consistency between good-practice server-side validation and client-side one (bug 13769).

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57601</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-30 22:44:47 +0000</bug_when>
    <thetext>&gt; But, quoting yourself, wouldn&apos;t it be confusing for authors who do not
&gt; read specs (as well as do not care about validation) at all?

A conformance requirement is unlikely to have any effect at all on someone who doesn&apos;t look up the conformance requirements nor use software that checks the conformance requirements, least of all confusing them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57619</commentid>
    <comment_count>11</comment_count>
    <who name="Marat Tanalin | tanalin.com">mtanalin</who>
    <bug_when>2011-10-01 21:25:51 +0000</bug_when>
    <thetext>(In reply to comment #10)

Ok. By the way, I personally would prefer to have the blacklist as spec recommendations, not requirements (first of the options you proposed in comment 8). Sothat validator could detect such situations and report them not as errors, but as just notices or warnings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57774</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-04 15:57:50 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: http://html5.org/tools/web-apps-tracker?from=6617&amp;to=6618
Rationale: I&apos;ve allowed all flow content except &lt;header&gt;, &lt;footer&gt;, heading, and sectioning content, based on the discussions above.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>