Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d32b6f5f3630f92c961e3b665fa3545a6d6ef6ec
https://github.com/WebKit/WebKit/commit/d32b6f5f3630f92c961e3b665fa3545a6d6ef6ec
Author: Ahmad Saleem <[email protected]>
Date: 2026-05-15 (Fri, 15 May 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray.html
M
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Log Message:
-----------
Negative stroke-dashoffset renders incorrectly with odd-length
stroke-dasharray
https://bugs.webkit.org/show_bug.cgi?id=249307
rdar://103596361
Reviewed by Simon Fraser.
The SVG spec says odd-length dash arrays are repeated to yield an even
number of values [1], so the full pattern cycle length is doubled. The CG
backend's negative dashoffset normalization computed the cycle length from
the raw array sum without accounting for this, producing wrong offsets and
a visible jump when animating across zero. This patch fixes the issue and
add test cases for both.
[1]
https://flagged.apple.com:443/proxy?t2=Dv1B6z6rH9&o=aHR0cHM6Ly93M2MuZ2l0aHViLmlvL3N2Z3dnL3N2ZzItZHJhZnQvcGFpbnRpbmcuaHRtbCNTdHJva2VEYXNoaW5n&emid=bd4e62ef-d858-4bbe-8027-3dd584b551c6&c=11
Tests:
imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray-ref.html
imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray.html
imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray-ref.html
imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray.html
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/animated-dashoffset-odd-dasharray.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/painting/negative-dashoffset-odd-dasharray.html:
Added.
*
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::setLineDash):
Canonical link:
https://flagged.apple.com:443/proxy?t2=Ds3X5j9dX2&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzEzMzUzQG1haW4=&emid=bd4e62ef-d858-4bbe-8027-3dd584b551c6&c=11
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications