<?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>250012</bug_id>
          
          <creation_ts>2023-01-02 15:42:48 -0800</creation_ts>
          <short_desc>baseline-shift property does not allow inheritance of numerical values</short_desc>
          <delta_ts>2025-02-02 07:40:40 -0800</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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=269878</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fantasai.bugs</cc>
    
    <cc>karlcow</cc>
    
    <cc>ntim</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1922565</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-02 15:42:48 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, came across another testcase:

Test Case - https://jsfiddle.net/7u9bcd1y/show

^ Chrome Canary 111 only fails first test while Firefox Nightly 110 fail all. Safari 16.2 &amp; STP160 only fail last two test cases.

Web-Spec: https://svgwg.org/svg2-draft/single-page.html#text-BaselineShiftProperty &amp; https://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty

Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&amp;revision=176928

Just wanted to raise so this can be fixed according to SVG2 specs etc.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924189</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-09 15:43:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/104048718&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942405</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-19 07:33:25 -0700</bug_when>
    <thetext>Took updated copy of test and changed it into JSfiddle - https://jsfiddle.net/5oL8uzfs/show

^ Chrome Canary 113 passes all, while WebKit ToT (261835@main) fails two:

&gt;&gt;&gt; Inheritance of the baseline-shift property, baseline.
&gt;&gt;&gt; Inheritance of the baseline-shift property, 100%.

________________________

Just wanted to update. Thanks!

Do we need to push this bit of &apos;BaselineShiftValue&quot; to above &quot;inherited&quot; flags?

https://searchfox.org/wubkat/source/Source/WebCore/rendering/style/SVGRenderStyle.cpp#171</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942406</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-19 07:37:19 -0700</bug_when>
    <thetext>Plus I think here - https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp#56

baselineshift::Length:

We are returning &apos;default&apos; of &apos;0&apos; rather than percentage value?

But at the same time, the length type of percentage is dealt here, if I am reading this bit correctly:

https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp#42

Confused...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1960872</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-09 16:36:52 -0700</bug_when>
    <thetext>We kind of already have this:

https://searchfox.org/wubkat/source/Source/WebCore/style/StyleBuilderCustom.h#1141

and did:

auto baselineShift = svgParentStyle.baselineShift();

if (baselineShift == BaselineShift::Length)
        svgStyle.setBaselineShiftValue(forwardInheritedValue(svgParentStyle.baselineShiftValue()));

_____

and it does not progress this testcase but when I look into WPT for &apos;baseline-shift&apos; coverage, we are doing better than Blink.

https://wpt.fyi/results/?label=master&amp;label=experimental&amp;aligned=&amp;q=baseline-shift

Now back to investigation board. :-)

_____

@Karl &amp; @Tim - any input would be welcome. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977832</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-16 05:44:39 -0700</bug_when>
    <thetext>We are passing all WPT here: https://wpt.fyi/results/css?label=master&amp;label=experimental&amp;aligned=&amp;q=baseline-shift</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978595</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-09-20 01:31:48 -0700</bug_when>
    <thetext>The spec says
https://drafts.csswg.org/css-inline/#propdef-baseline-shift

&gt; Percentages: 	refer to the used value of line-height
&gt; Computed value: the specified keyword or a computed &lt;length-percentage&gt; value 

The test case in the JS fiddle is 


data:text/html,&lt;svg height=&quot;0&quot; style=&quot;baseline-shift: 100%;&quot;&gt;&lt;text&gt;&lt;/text&gt;&lt;/svg&gt;

and window.getComputedStyle(document.getElementsByTagName(&apos;svg&apos;)[0]).baselineShift

returns: 

0px       in Safari 
undefined in Firefox
100%      in Chrome

line-height value in that test case is: `normal`

If I set the height to something different than 0.
data:text/html,&lt;svg height=&quot;10&quot; style=&quot;baseline-shift: 100%;&quot;&gt;&lt;text&gt;&lt;/text&gt;&lt;/svg&gt;

212.249863px in Safari 
undefined    in Firefox
100%         in Chrome


To me, WebKit does the right thing as it returns the computed &lt;length-percentage&gt; value, defined in
https://drafts.csswg.org/css-values-4/#typedef-length-percentage

&gt; &lt;length-percentage&gt;
&gt;     Equivalent to [ &lt;length&gt; | &lt;percentage&gt; ], where the &lt;percentage&gt; will resolve to a &lt;length&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978596</commentid>
    <comment_count>7</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-09-20 01:34:55 -0700</bug_when>
    <thetext>But Elika will probably know better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1992310</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-13 16:44:24 -0800</bug_when>
    <thetext>Chrome Canary 121 passes all test: https://jsfiddle.net/tfn035qm/show

and

Safari Technology Preview 182 fails first and last test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2091303</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-02-02 07:40:40 -0800</bug_when>
    <thetext>`baseline-shift` is deprecated in SVG2 and Firefox also not support it. I think we should discuss this in SVGWG and coordinate with Chrome to remove it as well.

https://svgwg.org/svg2-draft/text.html#BaselineShiftProperty</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>