Description
We calculate the used offset distance
by the steps defined in [1]. For a closed loop, the spec says:
Let used offset distance be equal to offset distance modulus the total length of the path. If the total length of the path is 0, used offset distance is also 0.
Perhaps it'd be better to mention that the used offset distance
should be equal to or larger than 0 in this case. (Though this may just depend on the implementation detail.)
Note: Chromium did it [2], and Firefox will follow this idea as well [3].
[1] https://drafts.fxtf.org/motion-1/#calculating-the-computed-distance-along-a-path
[2] https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/style/computed_style.cc?l=1207-1208&rcl=ebc261685e926af961bb12a34cd04ae7dec35182
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1429299