<?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>209116</bug_id>
          
          <creation_ts>2020-03-14 15:02:42 -0700</creation_ts>
          <short_desc>Issue 1061714: Quirky / SVG lengths parse number expressions in calc() like length, and behave oddly</short_desc>
          <delta_ts>2025-05-13 17:52:26 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emilio Cobos Álvarez (:emilio)">emilio</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>emilio</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>taher_ali</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1630098</commentid>
    <comment_count>0</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2020-03-14 15:02:42 -0700</bug_when>
    <thetext>See also:

 * https://bugzilla.mozilla.org/show_bug.cgi?id=1258270#c5
 * https://bugs.chromium.org/p/chromium/issues/detail?id=1061714

1. data:text/html,&lt;!doctype html&gt;&lt;div id=a style=&quot;stroke-width: calc(2 * 2)&quot;&gt;&lt;/div&gt;&lt;div id=b style=&quot;stroke-width: calc(2px * 2)&quot;&gt;&lt;/div&gt;
2. getComputedStyle(a).strokeWidth
3. getComputedStyle(b).strokeWidth

On WebKit, I get the right result for b, as I&apos;d expect, but I get 0px for a, which looks very odd.

It seems like numbers are a bit ambiguous in calc() for these properties, and we should probably allow just &lt;length-percentage&gt; for them...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1630101</commentid>
    <comment_count>1</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2020-03-14 15:16:01 -0700</bug_when>
    <thetext>I filed https://github.com/w3c/csswg-drafts/issues/4874 to discuss this with the working group.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1630212</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-03-15 14:29:30 -0700</bug_when>
    <thetext>&lt;rdar://problem/60474453&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884787</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-18 11:05:30 -0700</bug_when>
    <thetext>I am not sure on expected behavior but by taking the test case example from Chrome bug in Comment 5, I change it to following JSFiddle:

Link - https://jsfiddle.net/b5svdrx1/show

All browsers have different output:

*** Safari 15.5 on macOS 12.4 ***

a. 0 px &lt;&lt;&lt;&lt;&lt;
b. 4 px

*** Firefox Nightly 104 ***

a. 4 px &lt;&lt;&lt;&lt;&lt;
b. 4 px

*** Chrome Canary 105 ***

a. 1 px &lt;&lt;&lt;&lt;
b. 4 px

____

Chrome followed-up on bug to match with Firefox intro behavior as follow:

https://chromium.googlesource.com/chromium/src.git/+/7377d9c6d278bca393042b843f4f5f7f45de57a8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934937</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-02-18 15:54:59 -0800</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #3)
&gt; I am not sure on expected behavior but by taking the test case example from
&gt; Chrome bug in Comment 5, I change it to following JSFiddle:
&gt; 
&gt; Link - https://jsfiddle.net/b5svdrx1/show
&gt; 
&gt; All browsers have different output:
&gt; 
&gt; *** Safari 15.5 on macOS 12.4 ***
&gt; 
&gt; a. 0 px &lt;&lt;&lt;&lt;&lt;
&gt; b. 4 px
&gt; 
&gt; *** Firefox Nightly 104 ***
&gt; 
&gt; a. 4 px &lt;&lt;&lt;&lt;&lt;
&gt; b. 4 px
&gt; 
&gt; *** Chrome Canary 105 ***
&gt; 
&gt; a. 1 px &lt;&lt;&lt;&lt;
&gt; b. 4 px
&gt; 
&gt; ____
&gt; 
&gt; Chrome followed-up on bug to match with Firefox intro behavior as follow:
&gt; 
&gt; https://chromium.googlesource.com/chromium/src.git/+/
&gt; 7377d9c6d278bca393042b843f4f5f7f45de57a8

Just to update:

Safari Technology Preview 163 shows:

a. 4 px
b. 4 px

Which is same as &quot;Chrome Canary 112&quot; but differs from now Firefox Nightly 112, which has now old behavior of Chrome Canary.

a. 1 px
b. 4 px</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945911</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-31 22:32:41 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #4)
&gt; (In reply to Ahmad Saleem from comment #3)
&gt; &gt; I am not sure on expected behavior but by taking the test case example from
&gt; &gt; Chrome bug in Comment 5, I change it to following JSFiddle:
&gt; &gt; 
&gt; &gt; Link - https://jsfiddle.net/b5svdrx1/show
&gt; &gt; 
&gt; &gt; All browsers have different output:
&gt; &gt; 
&gt; &gt; *** Safari 15.5 on macOS 12.4 ***
&gt; &gt; 
&gt; &gt; a. 0 px &lt;&lt;&lt;&lt;&lt;
&gt; &gt; b. 4 px
&gt; &gt; 
&gt; &gt; *** Firefox Nightly 104 ***
&gt; &gt; 
&gt; &gt; a. 4 px &lt;&lt;&lt;&lt;&lt;
&gt; &gt; b. 4 px
&gt; &gt; 
&gt; &gt; *** Chrome Canary 105 ***
&gt; &gt; 
&gt; &gt; a. 1 px &lt;&lt;&lt;&lt;
&gt; &gt; b. 4 px
&gt; &gt; 
&gt; &gt; ____
&gt; &gt; 
&gt; &gt; Chrome followed-up on bug to match with Firefox intro behavior as follow:
&gt; &gt; 
&gt; &gt; https://chromium.googlesource.com/chromium/src.git/+/
&gt; &gt; 7377d9c6d278bca393042b843f4f5f7f45de57a8
&gt; 
&gt; Just to update:
&gt; 
&gt; Safari Technology Preview 163 shows:
&gt; 
&gt; a. 4 px
&gt; b. 4 px
&gt; 
&gt; Which is same as &quot;Chrome Canary 112&quot; but differs from now Firefox Nightly
&gt; 112, which has now old behavior of Chrome Canary.
&gt; 
&gt; a. 1 px
&gt; b. 4 px

____

Chrome Canary 114:

a: calc(0% + 4px)
b: 4px

Safari 16.4 &amp; STP166:

a. 4 px
b. 4 px

Firefox Nightly 113:

a. 1 px
b. 4 px</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109222</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-04-05 22:46:23 -0700</bug_when>
    <thetext>*** Firefox Nightly 138 ***
a: 1px
b: 4px

*** Chrome Canary 137 ***
a: calc(4px)
b: 4px

*** Safari Technology Preview 216 ***
a: 4px
b: 4px</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>