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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>37590</bug_id>
          
          <creation_ts>2010-04-14 11:25:08 -0700</creation_ts>
          <short_desc>Centering of th should use CSS text-align</short_desc>
          <delta_ts>2010-09-12 11:06:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Aryeh Gregor">ayg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mjs</cc>
    
    <cc>Ms2ger</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>212455</commentid>
    <comment_count>0</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-04-14 11:25:08 -0700</bug_when>
    <thetext>data URL test case:

data:text/html,&lt;!doctype html&gt;
&lt;table&gt;&lt;tr&gt;&lt;th&gt;Table 1&lt;tr&gt;&lt;td&gt;Longish string to observe centering&lt;/table&gt;
&lt;table style=text-align:left&gt;&lt;tr&gt;&lt;th&gt;Table 2&lt;tr&gt;&lt;td&gt;Longish string to observe centering&lt;/table&gt;

Expected results: th should be centered in both cases, because of a text-align: center rule in CSS that overrides the inheritance.  th { text-align: center } is recommended in both HTML5 and CSS2.1: &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#alignment&gt; &lt;http://www.w3.org/TR/CSS2/sample.html&gt;

Actual results: The second th is not centered.  The text-align:left from the ancestor table somehow overrides the alignment of the th.  Web Inspector shows no text-align rule for th, so th centering is apparently not handled by CSS.

Firefox &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=559382&gt; and Opera both seem to have the same bug.  IE8 reportedly does not have the bug: &lt;http://haslayout.net/css/Non-Inherited-TH-Text-Align-Bug&gt;.  If there&apos;s a compelling reason to not use CSS for centering here, a spec bug should be filed against HTML5 so this can be documented for other browsers.

Observed in Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.3 Safari/533.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>212843</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-04-15 07:32:15 -0700</bug_when>
    <thetext>Clarification: HTML5 specifies further behavior to capture the legacy semantics of align=left and such, namely:

&quot;&quot;&quot;
The div, caption, thead, tbody, tfoot, tr, td, and th elements, when they have
an align attribute whose value is an ASCII case-insensitive match for the
string &quot;left&quot;, are expected to left-align text within themselves, as if they
had their &apos;text-align&apos; property set to &apos;left&apos; in a presentational hint, and to
align descendants to the left.

. . .

When a user agent is to align descendants of a node, the user agent is expected
to align only those descendants that have both their &apos;margin-left&apos; and
&apos;margin-right&apos; properties computing to a value other than &apos;auto&apos;, that are
over-constrained and that have one of those two margins with a used value
forced to a greater value, and that do not themselves have an applicable align
attribute. When multiple elements are to align a particular descendant, the
most deeply nested such element is expected to override the others.
&quot;&quot;&quot;
&lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#alignment&gt;

So fixing this would not mean causing misrendering of &quot;&lt;table align=left&gt;&lt;tr&gt;&lt;th&gt;Foo...&quot;.  It would make actual CSS properties behave the way you expect CSS properties to behave, though, which would be nice.  (See discussion on the Mozilla bug.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>277876</commentid>
    <comment_count>2</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-09-12 11:06:27 -0700</bug_when>
    <thetext>Invalidated by spec change:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=9542
http://html5.org/tools/web-apps-tracker?from=5463&amp;to=5464</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>