<?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>245420</bug_id>
          
          <creation_ts>2022-09-20 04:07:30 -0700</creation_ts>
          <short_desc>Safari 16 fails to correctly apply strokeStyle to canvas paths</short_desc>
          <delta_ts>2022-09-20 18:36:49 -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 Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>iOS 16</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>245145</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Neave">paul.neave</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1899769</commentid>
    <comment_count>0</comment_count>
      <attachid>462469</attachid>
    <who name="Paul Neave">paul.neave</who>
    <bug_when>2022-09-20 04:07:30 -0700</bug_when>
    <thetext>Created attachment 462469
Demo HTML/JS

Major bug in Safari 16 (iOS and macOS) when drawing paths with strokeStyle in 2D canvas. 

The demo code below draws three small lines. One red, one blue, and the last one red.

In Safari 16, the third line is incorrectly colored blue.

```
&lt;html&gt;
&lt;body&gt;
&lt;canvas id=&quot;canvas&quot;&gt;&lt;/canvas&gt;
&lt;script&gt;

const canvas = document.getElementById(&apos;canvas&apos;);
const context = canvas.getContext(&apos;2d&apos;);

context.lineWidth = 6;

context.beginPath();
context.strokeStyle = &apos;red&apos;;
context.moveTo(30, 50);
context.lineTo(50, 50);
context.stroke();

context.beginPath();
context.strokeStyle = &apos;blue&apos;;
context.moveTo(60, 50);
context.lineTo(80, 50);
context.stroke();

context.beginPath();
context.strokeStyle = &apos;red&apos;;
context.moveTo(90, 50);
context.lineTo(110, 50);
context.stroke();

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

```

In all other browsers, including previous versions of Safari, the strokeStyle color is adhered to on a third call. In Safari 16, it does not update the color and it stays on the previous color.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899989</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-09-20 18:36:49 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 245145 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462469</attachid>
            <date>2022-09-20 04:07:30 -0700</date>
            <delta_ts>2022-09-20 04:07:30 -0700</delta_ts>
            <desc>Demo HTML/JS</desc>
            <filename>safari-canvas-strokestyle-bug.html</filename>
            <type>text/html</type>
            <size>555</size>
            <attacher name="Paul Neave">paul.neave</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5PgoJPGNhbnZhcyBpZD0iY2FudmFzIj48L2NhbnZhcz4KCTxzY3JpcHQ+Cgpj
b25zdCBjYW52YXMgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnY2FudmFzJyk7CmNvbnN0IGNv
bnRleHQgPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTsKCmNvbnRleHQubGluZVdpZHRoID0gNjsK
Cgpjb250ZXh0LmJlZ2luUGF0aCgpOwpjb250ZXh0LnN0cm9rZVN0eWxlID0gJ3JlZCc7CmNvbnRl
eHQubW92ZVRvKDMwLCA1MCk7CmNvbnRleHQubGluZVRvKDUwLCA1MCk7CmNvbnRleHQuc3Ryb2tl
KCk7CgoKY29udGV4dC5iZWdpblBhdGgoKTsKY29udGV4dC5zdHJva2VTdHlsZSA9ICdibHVlJzsK
Y29udGV4dC5tb3ZlVG8oNjAsIDUwKTsKY29udGV4dC5saW5lVG8oODAsIDUwKTsKY29udGV4dC5z
dHJva2UoKTsKCgpjb250ZXh0LmJlZ2luUGF0aCgpOwpjb250ZXh0LnN0cm9rZVN0eWxlID0gJ3Jl
ZCc7CmNvbnRleHQubW92ZVRvKDkwLCA1MCk7CmNvbnRleHQubGluZVRvKDExMCwgNTApOwpjb250
ZXh0LnN0cm9rZSgpOwoKCgk8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>