Bug 215258

Summary: SVG textPath startOffset unitless decimals values are interpreted as relative to the path length
Product: WebKit Reporter: Chris Dowling <chrisdowling84>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, mmaxfield, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Mac   
OS: macOS 10.14   
URL: https://codepen.io/gingerchris/pen/WNwbEym
Attachments:
Description Flags
Image showing two textPaths, one with percentage and one with decimal startOffset - both render identical in Safari none

Description Chris Dowling 2020-08-06 23:58:43 PDT
Created attachment 406155 [details]
Image showing two textPaths, one with percentage and one with decimal startOffset - both render identical in Safari

When specifying a unitless decimal value for the startOffset attribute of a textPath element, I would expect the text to be indented by an absolute amount - the specified distance in the user's coordinate system (see https://www.w3.org/TR/SVG11/text.html#TextPathElementStartOffsetAttribute).  

EG. `startOffset="0.4"` I would expect to indent the text 0.4 units

Instead what happens is the decimal is interpreted as a fraction of the total path length.  So a value of `0.4` is the same as `40%`.

In the attached SVG and the linked CodePen the two textPaths should render with the text offset by different amounts.  In Safari they appear identical.
Comment 1 Radar WebKit Bug Importer 2020-08-08 17:49:46 PDT
<rdar://problem/66736723>
Comment 2 Ahmad Saleem 2022-09-03 11:23:55 PDT
I am able to reproduce this bug in Safari 15.6.1 on macOS 12.5.1 but not in Safari Technology Preview 152 and it matches with other browsers (Chrome Canary 107 and Firefox Nightly 106). I am going to mark other engineers to find right commit but I am going to close this as "RESOLVED CONFIGURATION CHANGED". Thanks!

In Safari 15.6.1, the circle / image is huge (kind of like zoomed in) while in STP 152, it is in reasonable size similar to other browsers.