Bug 269429
| Summary: | Use enum class for SVG Angle Types as suggested in 274778@main | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | karlcow, sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=267180 | ||
Ahmad Saleem
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
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
<rdar://problem/123419968>
Ahmad Saleem
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
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.