Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e06b3d98e63b389b65a5b763cf942ea0c7d9e353
https://github.com/WebKit/WebKit/commit/e06b3d98e63b389b65a5b763cf942ea0c7d9e353
Author: David Kilzer <[email protected]>
Date: 2026-02-03 (Tue, 03 Feb 2026)
Changed paths:
M Source/WebCore/rendering/svg/SVGTextChunk.cpp
M Source/WebCore/rendering/svg/SVGTextChunk.h
Log Message:
-----------
[SVG] Convert SVGTextChunk::ChunkStyle to enum class with OptionSet for type
safety
<https://bugs.webkit.org/show_bug.cgi?id=306833>
<rdar://problem/169502342>
Reviewed by Said Abou-Hallawa.
Convert ChunkStyle from an unscoped enum to a scoped
`enum class ChunkStyle : uint8_t` and change the member variable from
`unsigned m_chunkStyle` to `OptionSet<ChunkStyle> m_chunkStyle`.
Improve type safety by preventing implicit conversions and provide a
cleaner API with semantic methods like contains() and containsAny()
instead of bitwise operations.
Other changes:
- Move ChunkStyle from public to private section.
- Remove ChunkStyle::DefaultStyle since OptionSet<> defaults to empty.
- Reorder class members by placing the smaller OptionSet member after
the float member.
- Make use of isVerticalText() in SVGTextChunk.cpp.
No new tests since no change in behavior.
* Source/WebCore/rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
(WebCore::SVGTextChunk::totalLength const):
(WebCore::SVGTextChunk::totalAnchorShift const):
(WebCore::SVGTextChunk::processTextLengthSpacingCorrection const):
(WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform const):
(WebCore::SVGTextChunk::processTextAnchorCorrection const):
* Source/WebCore/rendering/svg/SVGTextChunk.h:
(WebCore::SVGTextChunk::isVerticalText const):
(WebCore::SVGTextChunk::hasDesiredTextLength const):
(WebCore::SVGTextChunk::hasTextAnchor const):
(WebCore::SVGTextChunk::hasLengthAdjustSpacing const):
(WebCore::SVGTextChunk::hasLengthAdjustSpacingAndGlyphs const):
Canonical link: https://commits.webkit.org/306732@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications