WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
269429
Use enum class for SVG Angle Types as suggested in
274778@main
https://bugs.webkit.org/show_bug.cgi?id=269429
Summary
Use enum class for SVG Angle Types as suggested in 274778@main
Ahmad Saleem
Reported
2024-02-14 20:07:01 PST
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!
Attachments
Add attachment
proposed patch, testcase, etc.
Karl Dubost
Comment 1
2024-02-15 09:09:34 PST
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
Radar WebKit Bug Importer
Comment 2
2024-02-21 20:07:14 PST
<
rdar://problem/123419968
>
Ahmad Saleem
Comment 3
2024-09-15 09:39:19 PDT
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 'unsigned short' with an rvalue of type 'SVGAngleValue::Type' 163 | Ref { m_orientAngle }->baseVal()->newValueSpecifiedUnits(angle.unitType(), a... |
Karl Dubost
Comment 4
2024-09-16 05:49:24 PDT
ExceptionOr<void> newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
https://github.com/WebKit/WebKit/blob/84cc6561cbc81c2b2cb3bc36e8d704b78ffe635a/Source/WebCore/svg/SVGAngleValue.h#L54-L55
newValueSpecifiedUnits is expecting a "unsigned short unitType" but not the enum declaration. so probably the types need to be aligned everywhere in the code, whichever is chosen.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug