Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 18cb6a6161bab1b5d54b0d600b72b84fc8a567f6
https://github.com/WebKit/WebKit/commit/18cb6a6161bab1b5d54b0d600b72b84fc8a567f6
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-14 (Wed, 14 Oct 2026)
Changed paths:
M Source/WebCore/svg/SVGTextContentElement.cpp
M Source/WebCore/svg/SVGTextContentElement.h
M Source/WebCore/svg/SVGTextContentElement.idl
Log Message:
-----------
SVGTextContentElement::getNumberOfChars() returns unsigned but the IDL
declares long
https://bugs.webkit.org/show_bug.cgi?id=327149
rdar://189740041
Reviewed by Chris Dumez.
SVGTextContentElement interface declares `long getNumberOfChars()` as per
SVG 2 specification [1], but the C++ implementation returned `unsigned`. Make
the
C++ signature match the IDL by returning `int`, clamping the character count
to the `int` range.
The C++ method is renamed to numberOfCharsForBindings() and the IDL uses
ImplementedAs=numberOfCharsForBindings, following the existing *ForBindings
convention.
The internal callers compare the count against unsigned `charnum` arguments,
so they now use a new private `unsigned numberOfChars()` helper instead, to
avoid signed / unsigned comparisons.
No new tests, no behavior change; covered by existing tests.
[1]
https://w3c.github.io/svgwg/svg2-draft/text.html#InterfaceSVGTextContentElement
* Source/WebCore/svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::numberOfCharsForBindings):
(WebCore::SVGTextContentElement::numberOfChars):
(WebCore::SVGTextContentElement::getSubStringLength):
(WebCore::SVGTextContentElement::getStartPositionOfChar):
(WebCore::SVGTextContentElement::getEndPositionOfChar):
(WebCore::SVGTextContentElement::getExtentOfChar):
(WebCore::SVGTextContentElement::getRotationOfChar):
(WebCore::SVGTextContentElement::selectSubString):
* Source/WebCore/svg/SVGTextContentElement.h:
* Source/WebCore/svg/SVGTextContentElement.idl:
Canonical link: https://commits.webkit.org/323790@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications