<?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>269429</bug_id>
          
          <creation_ts>2024-02-14 20:07:01 -0800</creation_ts>
          <short_desc>Use enum class for SVG Angle Types as suggested in 274778@main</short_desc>
          <delta_ts>2026-02-26 02:02:28 -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 Technology Preview</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=267180</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="Karl Dubost">karlcow</assigned_to>
          <cc>karlcow</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>2013779</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-14 20:07:01 -0800</bug_when>
    <thetext>Hi Team,

We will rename this bug once the PR lands to commit number but this is about FIXME added by Karl:

PR Link - https://github.com/WebKit/WebKit/pull/22653

// FIXME: change the casing style of the enum type or naming of the Angle Value
// see https://github.com/WebKit/WebKit/pull/22653#discussion_r1448856015

Where it should be changed to this as per Tim:

enum class Type : uint8_t {
  Unknown,
  Deg,
  Rad,
  Grad,
  Turn,
}

WebKit Source (pre PR): https://github.com/WebKit/WebKit/blob/49fef559975eadeb4609dfe423aed84f43dcacb9/Source/WebCore/svg/SVGAngleValue.h#L32

Just wanted to raise before we forget.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2013968</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-02-15 09:09:34 -0800</bug_when>
    <thetext>How would you solve the difference with IDL?

https://searchfox.org/wubkat/source/Source/WebCore/svg/SVGAngleValue.h
https://searchfox.org/wubkat/source/Source/WebCore/svg/SVGAngle.idl</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2015958</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-02-21 20:07:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/123419968&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060316</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-09-15 09:39:19 -0700</bug_when>
    <thetext>I tried it today but got stuck here:

/Users/ahmadsaleem/OpenSource/Source/WebCore/svg/SVGMarkerElement.cpp:163:62: error: 
      cannot initialize a parameter of type &apos;unsigned short&apos; with an rvalue of
      type &apos;SVGAngleValue::Type&apos;
  163 |     Ref { m_orientAngle }-&gt;baseVal()-&gt;newValueSpecifiedUnits(angle.unitType(), a...
      |</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060418</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-09-16 05:49:24 -0700</bug_when>
    <thetext>    ExceptionOr&lt;void&gt; newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);

https://github.com/WebKit/WebKit/blob/84cc6561cbc81c2b2cb3bc36e8d704b78ffe635a/Source/WebCore/svg/SVGAngleValue.h#L54-L55


newValueSpecifiedUnits is expecting a &quot;unsigned short unitType&quot;
but not the enum declaration. 

so probably the types need to be aligned everywhere in the code, whichever is chosen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2185162</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-02-26 02:02:28 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/59498</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>