<?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>138577</bug_id>
          
          <creation_ts>2014-11-10 13:56:28 -0800</creation_ts>
          <short_desc>th { text-align: inherit; } is not respected</short_desc>
          <delta_ts>2022-06-16 19:47:54 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anthony Ryan">anthonyryan1</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>anthonyryan1</cc>
    
    <cc>hyatt</cc>
    
    <cc>karlcow</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ntim</cc>
    
    <cc>rreno</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1047619</commentid>
    <comment_count>0</comment_count>
    <who name="Anthony Ryan">anthonyryan1</who>
    <bug_when>2014-11-10 13:56:28 -0800</bug_when>
    <thetext>Example URL:
http://codepen.io/anthonyryan1/pen/QwLZZZ

The expected behavior when using text-align: inherit; on a th is to inherit the text alignment of a parent element, in the case of my example left. Rather than doing this Safari uses the useragent default for th which is text-align: center.

Verified in Safari 8 and the latest WebKit Nightly build.

Other browsers:
Firefox 33: Working as expected
Internet Explorer 11: Working as expected
Chrome 39: Also broken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1047620</commentid>
    <comment_count>1</comment_count>
    <who name="Anthony Ryan">anthonyryan1</who>
    <bug_when>2014-11-10 13:56:56 -0800</bug_when>
    <thetext>Chromium bug for cross-reference:
https://code.google.com/p/chromium/issues/detail?id=431867</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1184603</commentid>
    <comment_count>2</comment_count>
    <who name="Anthony Ryan">anthonyryan1</who>
    <bug_when>2016-04-18 01:17:00 -0700</bug_when>
    <thetext>The Chromium patch to resolve this bug, for cross-reference: https://chromium.googlesource.com/chromium/src.git/+/367b26a9cdb1389d3e16c30527742f7cd33ef74d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873533</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-02 01:09:08 -0700</bug_when>
    <thetext>&lt;rdar://problem/94272958&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873534</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-02 01:14:16 -0700</bug_when>
    <thetext>This issue forced Bootstrap to use `-webkit-match-parent` on their CSS
https://github.com/twbs/bootstrap/issues/30321#issuecomment-592981559

which in return makes it hard to remove it from the Web platform without breaking Safari. 

If it is being fixed it will help to obsolete it, and convince BootStrap to remove it too. 

The WPT has already a test to remove the support of `-webkit-match-parent`
https://github.com/web-platform-tests/wpt/commit/006029222c021a7c0b524328b0d3385cf4a97c95</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873542</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-06-02 02:20:30 -0700</bug_when>
    <thetext>Filed https://github.com/whatwg/html/issues/7978

because the spec says Safari does the right thing. 
but Firefox and Chrome do differently.

```
data:text/html,&lt;!doctype%20html&gt;&lt;table&gt;&lt;tr&gt;&lt;th%20style=&quot;text-align:inherit&quot;&gt;START&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AAAAAAAAAAAAAA&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873673</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-06-02 13:13:46 -0700</bug_when>
    <thetext>This is the relevant bit in WebKit:
https://webkit-search.igalia.com/webkit/rev/26eff7cbe4e53bbd8b325ee12a3567128ba52d2e/Source/WebCore/style/StyleAdjuster.cpp#318-323

I personally haven&apos;t tested which approach works, but the 2 I have in mind are:

1. Add a applyInheritTextAlign function here: https://webkit-search.igalia.com/webkit/rev/26eff7cbe4e53bbd8b325ee12a3567128ba52d2e/Source/WebCore/style/StyleBuilderCustom.h#197-207 that sets both textAlign, but also hasExplicitlySetTextAlign(). This needs to change: https://webkit-search.igalia.com/webkit/rev/26eff7cbe4e53bbd8b325ee12a3567128ba52d2e/Source/WebCore/css/CSSProperties.json#4590 to &quot;custom&quot;: &quot;All&quot; in order to work.

2. Remove the StyleAdjuster code, do like Firefox/Chrome and add an `-internal-center-or-inherit` value, implement it in https://webkit-search.igalia.com/webkit/rev/26eff7cbe4e53bbd8b325ee12a3567128ba52d2e/Source/WebCore/style/StyleBuilderConverter.h#609 , something like:

```
if (primitiveValue.valueID() == CSSValueInternalCenterOrInherit)
  if (parentStyle.textAlign() != TextAlign::Start)
     return parentStyle.textAlign();
  return TextAlign::Center;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875798</commentid>
    <comment_count>7</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-06-14 09:38:07 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/1503</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875906</commentid>
    <comment_count>8</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-06-14 16:13:12 -0700</bug_when>
    <thetext>Last PR ended up breaking some WPT tests for `all: revert`. I&apos;m going to go for Tim&apos;s #2 suggestion and use an internal CSS property instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876173</commentid>
    <comment_count>9</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-06-15 19:43:50 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/1568</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876394</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-06-16 19:47:52 -0700</bug_when>
    <thetext>Committed r295625 (251630@main): &lt;https://commits.webkit.org/251630@main&gt;

Reviewed commits have been landed. Closing PR #1568 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>