Bug 258375 - Stroke is rendering the SVG with jagged edges
Summary: Stroke is rendering the SVG with jagged edges
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 16
Hardware: Unspecified macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-06-21 16:19 PDT by maria
Modified: 2024-03-12 12:21 PDT (History)
8 users (show)

See Also:


Attachments
Reproduction in a minimal environment. (1.16 KB, text/html)
2023-06-21 16:19 PDT, maria
no flags Details
Safari displaying jagged SVG (6.86 KB, image/png)
2023-06-21 16:24 PDT, maria
no flags Details
Firefox displaying smooth SVG (1.99 KB, image/png)
2023-06-21 16:25 PDT, maria
no flags Details
Chrome displaying smooth SVG (4.72 KB, image/png)
2023-06-21 16:27 PDT, maria
no flags Details
Video displaying the difference between Firefox and Safari (4.54 MB, video/quicktime)
2023-06-21 17:20 PDT, maria
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description maria 2023-06-21 16:19:33 PDT
Created attachment 466779 [details]
Reproduction in a minimal environment.

# Safari SVG jagged edges

## Reproduction

Check the attached file called `index.html`

## Description

The SVG keeps rendering with jagged edges. This does not happen in Firefox or Chrome.

## Steps to reproduce

1. Add `fill: white` to the SVG to make it easier to see the jagged edges
2. Add `stroke: black` to the SVG to make it easier to see the jagged edges
3. Add `width: 32px; height: 32px;` to the SVG, the smaller the size the more the edges become jagged

## Expected behavior

The SVG should have smooth edges.

## Actual behavior

The SVG does not have smooth edges, some sections of it show jagged areas.

## Other information

The SVG renders with smooth edges on Firefox and Chrome.
Comment 1 maria 2023-06-21 16:24:51 PDT
Created attachment 466780 [details]
Safari displaying jagged SVG
Comment 2 maria 2023-06-21 16:25:57 PDT
Created attachment 466781 [details]
Firefox displaying smooth SVG
Comment 3 maria 2023-06-21 16:26:21 PDT
Comment on attachment 466780 [details]
Safari displaying jagged SVG

I've added arrows to the location of the jagged edges.
Comment 4 maria 2023-06-21 16:27:54 PDT
Created attachment 466782 [details]
Chrome displaying smooth SVG
Comment 5 Ahmad Saleem 2023-06-21 16:42:43 PDT
I am unable to reproduce this using Safari 16.5.1 using attached test case. Any specific condition or steps, I need to do?
Comment 6 maria 2023-06-21 17:01:04 PDT
I'm using Safari v16.5.0. There shouldn't be anything extra needed.

I can also reproduce it on Stackblitz through https://stackblitz.com/edit/web-platform-uu2cbv?file=index.html

Does the link help?
Comment 7 Ahmad Saleem 2023-06-21 17:05:33 PDT
(In reply to maria from comment #6)
> I'm using Safari v16.5.0. There shouldn't be anything extra needed.
> 
> I can also reproduce it on Stackblitz through
> https://stackblitz.com/edit/web-platform-uu2cbv?file=index.html
> 
> Does the link help?

If I zoom in a lot and put focus then I see some smoothness issue on the outline but not similar to attached screenshots. :-(

Can you share your OS and machine details? Because I think macOS 13.2 (Ventura) also had some system level improvement to fix some SVG bugs. Also Apple Silicon or Intel might also be an issue.

I am using macOS 13.4.1 using Safari 16.5.1 on M1 Pro 38 GPU core to reproduce this issue.
Comment 8 maria 2023-06-21 17:12:21 PDT
I'm using macOS 13.4 with Safari 16.5.0 on M2 Max.
Comment 9 maria 2023-06-21 17:13:56 PDT
I updated the fill on the Stackblitz environment to mimic the screenshots.
Comment 10 maria 2023-06-21 17:20:22 PDT
Created attachment 466784 [details]
Video displaying the difference between Firefox and Safari
Comment 11 Radar WebKit Bug Importer 2023-06-28 16:20:18 PDT
<rdar://problem/111478546>
Comment 12 Liam DeBeasi 2023-07-10 07:59:23 PDT
This issue also reproduces on iOS. I am able to reproduce using the filled "airplane" or filled "people-circle" icons on ionicons.com.

I cannot reproduce this issue on iOS 15.6, but I can reproduce it on iOS 16.5 so this does appear to be a regression.
Comment 13 alex 2024-03-08 13:50:20 PST
This appears to be resolved in iOS 17.4
Comment 14 maria 2024-03-12 12:20:29 PDT
I have verified that this was fixed in iOS 17.3.