Bug 215258 - SVG textPath startOffset unitless decimals values are interpreted as relative to the path length
Summary: SVG textPath startOffset unitless decimals values are interpreted as relative...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 13
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL: https://codepen.io/gingerchris/pen/WN...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-06 23:58 PDT by Chris Dowling
Modified: 2022-09-03 11:24 PDT (History)
8 users (show)

See Also:


Attachments
Image showing two textPaths, one with percentage and one with decimal startOffset - both render identical in Safari (515 bytes, image/svg+xml)
2020-08-06 23:58 PDT, Chris Dowling
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.