Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 97bb10a8c3c5b4d1dfb605bf1e5d4e8058a8acbf
      
https://github.com/WebKit/WebKit/commit/97bb10a8c3c5b4d1dfb605bf1e5d4e8058a8acbf
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-19 (Sat, 19 Sep 2026)

  Changed paths:
    M Source/WebCore/svg/SVGAngleValue.cpp

  Log Message:
  -----------
  SVGAngleValue::valueAsString() should use CSS-spec-compliant number 
serialization
https://bugs.webkit.org/show_bug.cgi?id=323939

Reviewed by Sam Weinig.

SVGAngleValue::valueAsString() was using makeString(float, literal) which goes
through WTF's generic float-to-string conversion. This differs from the
CSS-spec-compliant FormattedCSSNumber path used by 
SVGLengthValue::valueAsString()
and CSSPrimitiveValue::customCSSText().

Update SVGAngleValue to use CSS::formatCSSNumberValue() with CSS::unitString(),
matching the serialization approach already used by SVGLengthValue. This ensures
consistent number formatting (e.g. handling of -0, significant digits, 
infinities,
and NaN) across all SVG numeric attribute serialization.

* Source/WebCore/svg/SVGAngleValue.cpp:
(WebCore::svgAngleTypeToUnitString): Added. Maps each known SVGAngleValue::Type 
to
its CSS unit string via CSS::unitString(), returning a null string for the
unspecified/unknown types.
(WebCore::SVGAngleValue::valueAsString): Use CSS::formatCSSNumberValue() with 
the
suffix from svgAngleTypeToUnitString(), removing the switch on m_unitType.

Canonical link: https://commits.webkit.org/321460@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to