<?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>309035</bug_id>
          
          <creation_ts>2026-03-02 20:56:52 -0800</creation_ts>
          <short_desc>rounding issue for svg rect height with em and percentage</short_desc>
          <delta_ts>2026-05-26 19:35:55 -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>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/60194</see_also>
          <bug_file_loc>http://wpt.live/svg/geometry/svg-baseval-in-display-none.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Karl Dubost">karlcow</assigned_to>
          <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>2186387</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-02 20:56:52 -0800</bug_when>
    <thetext>http://wpt.live/svg/geometry/svg-baseval-in-display-none.html
https://wpt.fyi/results/svg/geometry/svg-baseval-in-display-none.html

https://codepen.io/webcompat/pen/ogzjVyQ?editors=1010

&lt;svg width=&quot;0&quot; height=&quot;0&quot;&gt;
  &lt;svg width=&quot;600&quot; height=&quot;400&quot; font-size=&quot;5&quot;&gt;
    &lt;symbol width=&quot;40em&quot; height=&quot;20em&quot;&gt;
      &lt;g font-size=&quot;10px&quot;&gt;
        &lt;rect id=&quot;r1&quot; x=&quot;5em&quot; y=&quot;6em&quot; width=&quot;20%&quot; height=&quot;30%&quot;&gt;&lt;/rect&gt;
        &lt;circle id=&quot;c1&quot; cx=&quot;5em&quot; cy=&quot;6em&quot; r=&quot;10em&quot;&gt;&lt;/circle&gt;
      &lt;/g&gt;
    &lt;/symbol&gt;
    &lt;g font-size=&quot;10px&quot; style=&quot;display:none&quot;&gt;
      &lt;rect id=&quot;r2&quot; x=&quot;5em&quot; y=&quot;6em&quot; width=&quot;20%&quot; height=&quot;30%&quot;&gt;&lt;/rect&gt;
      &lt;circle id=&quot;c2&quot; cx=&quot;5em&quot; cy=&quot;6em&quot; r=&quot;10em&quot;&gt;&lt;/circle&gt;
    &lt;/g&gt;
  &lt;/svg&gt;
&lt;/svg&gt;

Test Results:

SAFARI
r1.width = 120 (120)
r1.height = 120.00000762939453 (120)
r2.width = 120 (120)
r2.height = 120.00000762939453 (120)

CHROME/FIREFOX
r1.width = 120 (120)
r1.height = 120 (120)
r2.width = 120 (120)
r2.height = 120 (120)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2186388</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-03-02 20:57:41 -0800</bug_when>
    <thetext>&lt;rdar://problem/171587382&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190899</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-17 00:56:38 -0700</bug_when>
    <thetext>The fact that this is failing only for height is pure luck. Width has the same issue. 
We should probably modify the tests that it is able to fail in the same way for width.

The float parameter in convertValueFromPercentageToUserUnits(float value, ...) truncates the double result of value / 100.0 before multiplying by the viewport dimension. The fix needs to keep the computation in double precision through the multiplication, only casting to float at the end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190901</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-03-17 00:58:15 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/60750</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2214812</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-26 19:18:20 -0700</bug_when>
    <thetext>Committed 313935@main (5ed9fc92e49b): &lt;https://commits.webkit.org/313935@main&gt;

Reviewed commits have been landed. Closing PR #60750 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2214821</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-05-26 19:35:55 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/60194</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>