Bug 256064

Summary: SVG <marker> elements are scaling when they should not be.
Product: WebKit Reporter: Justin Everett <justin.b.everett>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: sabouhallawa, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   

Description Justin Everett 2023-04-27 16:53:29 PDT
Marker elements are scaling with SVG images as opposed to being fixed to strokeSize or userSpaceOnUse.

Steps to recreate:

1. Display the following SVG in WebKit so that it fills its container:

<svg viewBox='0 0 100 100' xmlns="http://www.w3.org/2000/svg">
  <defs>
    <marker 
      id='circle'
      viewBox='0 0 2 2'
      refX="1"
      refY="1"
      markerWidth="2"
      markerHeight="2"
      markerUnits="userSpaceOnUse">
      <circle cx='1' cy='1' r='1' fill="red" /> 
    </marker>
  </defs>
  <line x1='2' y1='2' x2='98' y2='2' stroke='black' stroke-width='2' vector-effect="non-scaling-stroke" marker-start='url(#circle)' marker-end='url(#circle)'/>
</svg>

2. Resize the window/container.

Marker elements change size while the stroke of the line does not. Replacing userSpaceOnUse with strokeWidth does not resolve the issue.
Comment 1 Radar WebKit Bug Importer 2023-05-04 16:54:19 PDT
<rdar://problem/108921711>