<?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>263387</bug_id>
          
          <creation_ts>2023-10-19 12:20:04 -0700</creation_ts>
          <short_desc>[GPU Process] REGRESSION: display-p3 stroke color in canvas crashes the webpage</short_desc>
          <delta_ts>2023-10-31 14:43:51 -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 17</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=264000</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Starli0n">s_theroude</reporter>
          <assigned_to name="Said Abou-Hallawa">sabouhallawa</assigned_to>
          <cc>dino</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit-unassigned</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1986205</commentid>
    <comment_count>0</comment_count>
    <who name="Starli0n">s_theroude</who>
    <bug_when>2023-10-19 12:20:04 -0700</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #263375 +++

In this version of Safari, the bug mentioned above is getting worst.

Instead of having an invisible stroke, it crashes the webpage.

Here is an updated sample, with some comments, to easily reproduce the bug:
(The code needs to be copy/paste)

The aim is to draw two lines with the same color but with a different line width.

// https://www.w3schools.com/jsref/tryit.asp?filename=tryhtml5_canvas_stroke

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;HTML5 Canvas&lt;/h1&gt;
&lt;h2&gt;The stroke() Method&lt;/h2&gt;

&lt;canvas id=&quot;myCanvas&quot; width=&quot;300&quot; height=&quot;150&quot; style=&quot;border:1px solid grey&quot;&gt;&lt;/canvas&gt;

&lt;script&gt;
const c = document.getElementById(&quot;myCanvas&quot;);
const ctx = c.getContext(&quot;2d&quot;);

ctx.strokeStyle = &quot;color(display-p3 1 0 0 / 1)&quot;;
ctx.lineWidth = 1;

ctx.beginPath();
ctx.moveTo(20, 20);
ctx.lineTo(20, 100);
ctx.stroke();

// ctx.strokeStyle = &quot;color(display-p3 0 0 1 / 1)&quot;; // &lt;== Uncomment this, to not have the bug but the color are not the same
ctx.lineWidth = 2;

ctx.beginPath();
// ctx.moveTo(-1, -1); &lt;&lt;== Uncomment this to have a workaround that fulfill the purpose of the code
ctx.moveTo(40, 20);
ctx.lineTo(40, 100);
ctx.stroke(); // &lt;&lt;== It crashes here !!

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986287</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-19 14:46:55 -0700</bug_when>
    <thetext>&lt;rdar://problem/117226767&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986602</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2023-10-20 17:05:39 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/19383</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1986928</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-23 13:48:01 -0700</bug_when>
    <thetext>Committed 269664@main (922c037bca6e): &lt;https://commits.webkit.org/269664@main&gt;

Reviewed commits have been landed. Closing PR #19383 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1988064</commentid>
    <comment_count>4</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2023-10-27 12:36:31 -0700</bug_when>
    <thetext>Re-opening for pull request https://github.com/apple/WebKit/pull/892</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1988166</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-27 18:45:06 -0700</bug_when>
    <thetext>Committed 267815.463@safari-7617-branch (584274dcf192): &lt;https://commits.webkit.org/267815.463@safari-7617-branch&gt;

Reviewed commits have been landed. Closing PR #892 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>