<?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>267560</bug_id>
          
          <creation_ts>2024-01-15 16:45:51 -0800</creation_ts>
          <short_desc>[SVG] baseVal value of circle r attribute returns 0 and a console error while still drawing</short_desc>
          <delta_ts>2025-11-26 00:41:39 -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>SVG</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=192507</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=84966</see_also>
          <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>
          
          <blocked>261656</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</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>2005165</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-01-15 16:45:51 -0800</bug_when>
    <thetext>Steps to reproduce
1. Copy in Safari URL bar this: data:text/html,&lt;!doctype html&gt;&lt;svg&gt;&lt;circle r=&quot;100 &quot;/&gt;&lt;/svg&gt;
   (Notice the space at the end of the r attribute: &quot;100 &quot;.)
3. In the Web Inspector console, type:
   document.querySelector(&apos;circle&apos;).r.baseVal.value

Results:
* Web Inspector Console displays: 
  Error: Invalid value for &lt;circle&gt; attribute r=&quot;100 &quot;
* document.querySelector(&apos;circle&apos;).r.baseVal.value   returns 0
* document.querySelector(&apos;circle&apos;).r.animVal.value   returns 0
* document.querySelector(&apos;circle&apos;).getAttribute(&apos;r&apos;) returns &quot;100 &quot;


While Firefox and Chrome
* No error message in the console
* document.querySelector(&apos;circle&apos;).r.baseVal.value   returns 100
* document.querySelector(&apos;circle&apos;).r.animVal.value   returns 100
* document.querySelector(&apos;circle&apos;).getAttribute(&apos;r&apos;) returns &quot;100 &quot;



Error message in WebKit is coming from 
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGElement.cpp#150-169

which has been called by length.setValueAsString(valueAsString).hasException()
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGLengthValue.cpp#192-202

called by SVGLengthValue::setValueAsString(StringView string)
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGLengthValue.cpp#324-342


There is a         
   auto convertedNumber = parseNumber(buffer, SuffixSkippingPolicy::DontSkip);

which seems not able to ignore spaces.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005166</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-01-15 16:46:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/121020904&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005167</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-01-15 16:51:31 -0800</bug_when>
    <thetext>Probably related to Bug 192507</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005168</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-01-15 16:54:35 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #2)
&gt; Probably related to Bug 192507

Should we tackle following bug 261656 case by case and see how many these issue get fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005177</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-01-15 17:34:35 -0800</bug_when>
    <thetext>Oh I had forgotten about this. &lt;3 
Feel free to go ahead if you have a solution for one thing or all things.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2161394</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-11-25 23:50:22 -0800</bug_when>
    <thetext>@Karl - It seems to be fixed, I get:

* document.querySelector(&apos;circle&apos;).r.baseVal.value   returns 100
* document.querySelector(&apos;circle&apos;).r.animVal.value   returns 100
* document.querySelector(&apos;circle&apos;).getAttribute(&apos;r&apos;) returns &quot;100 &quot;

and no error matching other browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2161400</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-11-26 00:41:39 -0800</bug_when>
    <thetext>Wonderful</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>