Bug 200779 - Text is sometime not rendered on canvas when using transform and clip
Summary: Text is sometime not rendered on canvas when using transform and clip
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2019-08-15 12:18 PDT by webrant
Modified: 2022-06-01 16:21 PDT (History)
6 users (show)

See Also:


Attachments
Safari 15.5 matches other browsers (776.26 KB, image/png)
2022-06-01 16:18 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description webrant 2019-08-15 12:18:19 PDT
Simple repro that works fine in other browsers:

<html>
  <body style="display: flex;">
    <canvas id="canvas1" style="flex: 1; width: 100%; height: 100%; background: #eee" />
  </body>
  <script>

    const canvas = document.getElementById("canvas1");
    const ctx = canvas.getContext("2d");

    ctx.canvas.width = 800;
    ctx.canvas.height = 600;

    ctx.transform(1, 0.27, 0, 1, 0, -95.26);
    ctx.textAlign = "center";
    ctx.textBaseline = "top";
    ctx.lineWidth = 1;
    ctx.font = "22px Arial";
    ctx.beginPath();
    ctx.rect(200, 200, 400, 29);
    ctx.closePath();
    ctx.fillStyle = "#FFE0C0";
    ctx.fill("nonzero");
    ctx.clip("nonzero");
    ctx.fillStyle = "#000";
    ctx.fillText("Text that doesn't display in Safari", 400, 205);

  </script>
</html>
Comment 1 Radar WebKit Bug Importer 2019-08-16 22:40:26 PDT
<rdar://problem/54420498>
Comment 2 Ahmad Saleem 2022-06-01 16:18:50 PDT
Created attachment 459942 [details]
Safari 15.5 matches other browsers

I created a JSFiddle using attached test case from Comment 01 and tested it in Safari 15.5 on macOS 12.4 and it matches with other browser as shown from the attached screenshot. I was not able to replace any bug, which was previously happening and since it is aligned with other browsers, this should be marked as "RESOLVED CONFIGURATION CHANGE". Thanks!
Comment 3 Ahmad Saleem 2022-06-01 16:20:43 PDT
JS Fiddle for testing - https://jsfiddle.net/8e4hx6qw/
Comment 4 Simon Fraser (smfr) 2022-06-01 16:21:17 PDT
Thank you for testing.