<?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>263375</bug_id>
          
          <creation_ts>2023-10-19 05:06:12 -0700</creation_ts>
          <short_desc>display-p3 stroke color is invisible in canvas</short_desc>
          <delta_ts>2023-10-26 05:19:56 -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 16</version>
          <rep_platform>Mac (Apple Silicon)</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>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Starli0n">s_theroude</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>heycam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1986128</commentid>
    <comment_count>0</comment_count>
    <who name="Starli0n">s_theroude</who>
    <bug_when>2023-10-19 05:06:12 -0700</bug_when>
    <thetext>In a context of using a canvas, a display-p3 color stroke becomes invisible.

It happens after creating a line with a color.
Then, if the line width is changed but not the color,
a second stroke will be invisible.

The bug is not present for hexa colors.
If the color is changed between the two stoke, the bug is not present.

Here is a sample to easily reproduce the bug:
(The code needs to be copy/paste)


// 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;;
ctx.lineWidth = 2;

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

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987696</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-26 05:07:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/117528790&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>