Bug 256064 - SVG <marker> elements are scaling when they should not be.
Summary: SVG <marker> elements are scaling when they should not be.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-27 16:53 PDT by Justin Everett
Modified: 2023-05-04 16:54 PDT (History)
3 users (show)

See Also:


Attachments

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