<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>237818</bug_id>
          
          <creation_ts>2022-03-13 04:21:03 -0700</creation_ts>
          <short_desc>Canvas export fails due to security reasons because of CanvasPattern</short_desc>
          <delta_ts>2022-03-14 13:43:22 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Canvas</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 12</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eduard Kuzmenko">thanwords24</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1850758</commentid>
    <comment_count>0</comment_count>
    <who name="Eduard Kuzmenko">thanwords24</who>
    <bug_when>2022-03-13 04:21:03 -0700</bug_when>
    <thetext>Export fails with error: &apos;Operation is insecure&apos; 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 &apos;Access-Control-Allow-Origin: *&apos; 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&apos;ll fail with &apos;operation is insecure&apos;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850887</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-03-14 08:55:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/90248577&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>