Bug 237818
| Summary: | Canvas export fails due to security reasons because of CanvasPattern | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Eduard Kuzmenko <thanwords24> |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bfulgham, dino, sabouhallawa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 15 | ||
| Hardware: | Unspecified | ||
| OS: | macOS 12 | ||
Eduard Kuzmenko
Export fails with error: 'Operation is insecure' when canvas is being filled with pattern, which was created using an image from the same origin. Chrome does not have this issue.
Steps to Reproduce:
- Get an image from the same origin (header 'Access-Control-Allow-Origin: *' must not be present)
- Wait for its load
- Create CanvasPattern using the image
- Fill the canvas with created pattern
- Try to use canvas.toBlob() and it'll fail with 'operation is insecure'
Example: https://jsfiddle.net/morethanwords/4u0L5gdn/54/
Temporary solution: draw the image to additional canvas and create the pattern using the canvas, instead of image.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/90248577>