Skip to content

'path-length' property repeats the zero rule without the 'non-percentage' qualifier the attribute has #1179

Open

Description

@karlcow

The pathLength attribute and the path-length property state the same zero rule, and only one of them carries the percentage exemption.

The attribute, 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.

The property, https://w3c.github.io/svgwg/svg2-draft/paths.html#PathLengthProperty:

A <length> value must be zero or greater. 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 value greater than zero must become +Infinity.

The property version is the text as it stood between 2016 and 2018. The words non-percentage were added to the attribute on 2018-07-08 in 3500743, resolving #383, together with the separate sentence "'pathLength' has no effect on percentage distance-along-a-path calculations". The property section was written later, in 5a6f8d1 and 01e1fef, and reproduced the pre-2018 sentence.

Both sections have the separate percentage sentence. But the attribute now maps to the property, the property is the normative part. A reader who stops at the zero rule gets the 2016 answer from one section and the 2018 answer from the other.

Proposed edit

Two words, master/paths.html, in the path-length property section:

 A value of zero scaled infinitely must remain zero, while any
-value greater than zero must become +Infinity.
+non-percentage value greater than zero must become +Infinity.

This is not only editorial.
The pre-2018 reading is what is shipping in two engines and what one WPT test asserts.

For pathLength="0" and startOffset="50%" on a path running x=10 to x=390, measured 2026-09-14:

Safari 26.4 Chrome 155 Firefox 158
text starts at x=200, halfway x=10, start x=10, start

Gecko implemented the 2016 wording deliberately in https://bugzilla.mozilla.org/show_bug.cgi?id=1815061 on 2023-02-04, titled "Fix pathlength="0" handling per SVGWG resolution" and citing #81. #383 is not mentioned there, which is easy to understand: #81's own thread never discusses percentages, and its resolution comment reads as complete.

svg/path/distance/pathLength-zero-percentage.svg asserts the same 2016 reading. It was written on 2018-02-01, five months before the amendment, and its reference drops every startOffset so all three percentage rows sit at the start of the path. Its sibling from the same commit, pathLength-positive-percentage.svg, keeps the offsets and so asserts the 2018 rule, which leaves the two files contradicting each other about the limit as pathLength goes to zero. #383 closed on 2018-08-13 with the label Needs tests still on it. I am repairing that test and adding coverage for startOffset="100%", which nothing tests today.

So the two missing words are the only place in the spec where the old rule can still be read as current, and the old rule is not hypothetical.

@longsonr for review

Activity

  1. karlcow commented on Sep 14, 2026

    @karlcow
    MemberAuthor

    And for understanding the history of this discussion this is related to
    https://bugs.webkit.org/show_bug.cgi?id=322537#c6 and followup comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions