Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b96c3b022beffb2a1e79281d90062ef6b0b5fc37
      
https://github.com/WebKit/WebKit/commit/b96c3b022beffb2a1e79281d90062ef6b0b5fc37
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-04-17 (Fri, 17 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/scripted/smil-values-empty-segments-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/scripted/smil-values-empty-segments.html
    M Source/WebCore/svg/SVGAnimationElement.cpp

  Log Message:
  -----------
  SMIL values attribute should preserve empty values and handle trailing 
semicolons as per spec
https://bugs.webkit.org/show_bug.cgi?id=310988
rdar://173594455

Reviewed by Simon Fraser.

The SMIL values attribute parser was using String::split() which silently
drops empty entries. This meant values="red;green;;" produced only
["red", "green"] instead of ["red", "green", ""], losing the meaningful
empty value between the consecutive semicolons. Similarly,
values="red;;green" lost the empty middle value.

Per the spec [1], "If the last semicolon separator is followed by either
just white space or no more characters, ignore both the separator and the
trailing white space."

Switch to splitAllowingEmptyEntries so empty values are preserved, then
explicitly strip a single trailing empty entry per the spec rule above.

[1] https://svgwg.org/specs/animations/#ValuesAttribute

* Source/WebCore/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::attributeChanged): Use
splitAllowingEmptyEntries for values attribute, then strip a single
trailing empty value per spec.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/scripted/smil-values-empty-segments-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/scripted/smil-values-empty-segments.html:
 Added.

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



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

Reply via email to