Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40238a317bef41bf4fb231e3d830f1aff3914a89
      
https://github.com/WebKit/WebKit/commit/40238a317bef41bf4fb231e3d830f1aff3914a89
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/svg/SVGRenderSupport.cpp
    M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp

  Log Message:
  -----------
  Fix SVG pathLength="0" and negative pathLength handling for stroke dashing
https://bugs.webkit.org/show_bug.cgi?id=313729
rdar://175928827

Reviewed by Rob Buis.

Per https://w3c.github.io/svgwg/svg2-draft/paths.html#PathLengthAttribute:

  "A value of zero is valid and must be treated as a scaling factor of
  infinity. A value of zero scaled infinitely must remain zero, while any
  non-percentage value greater than zero must become +Infinity."

  "A negative value is an error (see Error handling)."

The pathLength attribute was checked via `if (float pathLength = ...)` which
treats zero as falsy/unspecified, and negative values were used for scaling
instead of being ignored.

Use hasAttribute() to distinguish specified-zero from unspecified, then
handle zero and negative values per spec. Note: hasAttribute() (not
hasAttributeWithoutSynchronization()) is required because pathLength is
an SVG animated property that needs synchronization before attribute lookup.

* LayoutTests/TestExpectations: Unskip Progressions
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::beginTextPathLayout):

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



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

Reply via email to