<?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>230339</bug_id>
          
          <creation_ts>2021-09-16 04:00:10 -0700</creation_ts>
          <short_desc>tab width is computed incorrectly for inline elements with font changes</short_desc>
          <delta_ts>2023-09-28 08:02:49 -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>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://wpt.live/css/css-text/tab-size/tab-size-block-ancestor.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Kew">jfkthame</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>kevin_neal</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1794002</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Kew">jfkthame</who>
    <bug_when>2021-09-16 04:00:10 -0700</bug_when>
    <thetext>The CSS spec (https://drafts.csswg.org/css-text-3/#tab-size-property) for tab-size is clear that 

&gt; A &lt;number&gt; represents the measure as a multiple of the advance width of the space character (U+0020) of the nearest block container ancestor of the preserved tab,

but webkit appears to be using the advance width of the inline element&apos;s own space character, not the block container&apos;s.

See testcase at https://codepen.io/jfkthame/pen/JjJMoqN.

Firefox renders this correctly per spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795637</commentid>
    <comment_count>1</comment_count>
    <who name="Kevin Neal">kevin_neal</who>
    <bug_when>2021-09-21 10:33:02 -0700</bug_when>
    <thetext>Thank you for filing. The appropriate engineers have been notified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795638</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-21 10:33:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/83358190&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1795661</commentid>
    <comment_count>3</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2021-09-21 11:07:17 -0700</bug_when>
    <thetext>I wonder why... 🤔</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894520</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-29 07:22:13 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari Technology Preview 152 using CodePen from Comment 0 and it does not align &quot;A&quot; in one line and it matches with Chrome Canary 107. Only browser (Firefox Nightly 106) show all &quot;A&quot; aligned in one line. Just wanted to share updated test results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977831</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-16 05:36:54 -0700</bug_when>
    <thetext>Looks similar to : https://wpt.fyi/results/css/css-text/tab-size/tab-size-block-ancestor.html?label=master&amp;label=experimental&amp;aligned=&amp;q=tab+size</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980976</commentid>
    <comment_count>6</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-09-28 08:02:49 -0700</bug_when>
    <thetext>(In reply to Myles C. Maxfield from comment #3)
&gt; I wonder why... 🤔
It&apos;s because tab width is resolved against the current FontCascade and not what the (nearest) block container specifies.
e.g. &lt;div style=&quot;tab-size: 10; font-size: 100px;&quot;&gt;&lt;span style=&quot;font-size: 1px&quot;&gt;
In WidthIterator we use the [span]&apos;s font to resolve the tab-size value of 10. At WidthIterator we don&apos;t have the context of containing blocks we just have a font (whatever the inline box has) and the specified tab-size value.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>