<?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>283489</bug_id>
          
          <creation_ts>2024-11-21 07:42:21 -0800</creation_ts>
          <short_desc>Dark mode does not work in SVGImages</short_desc>
          <delta_ts>2026-04-01 01:25:57 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=199134</see_also>
          <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="Oliver Williams">oliverwilliams345</reporter>
          <assigned_to name="Said Abou-Hallawa">sabouhallawa</assigned_to>
          <cc>dev</cc>
    
    <cc>karlcow</cc>
    
    <cc>nileshprajapati</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2076698</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2024-11-21 07:42:21 -0800</bug_when>
    <thetext>If you have an SVG file with the following markup: 

&lt;svg id=&quot;cloud&quot; style=&quot;color-scheme: light dark;&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; fill=&quot;light-dark(red, blue)&quot; viewBox=&quot;0 0 16 16&quot;&gt;
  &lt;path d=&quot;M4.158 12.025a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m-3.5 1.5a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 1 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m.747-8.498a5.001 5.001 0 0 0-9.499-1.004A3.5 3.5 0 1 0 3.5 11H13a3 3 0 0 0 .405-5.973&quot;/&gt;
&lt;/svg&gt;

In Firefox and Chrome, it will have a blue fill in dark mode and a red fill in light mode, even if the SVG is referenced using the HTML &lt;img&gt; tag: &lt;img src=&quot;cloud.svg&quot;&gt;

In Safari, the fill of the SVG is always red regardless of the users chosen color scheme.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2076699</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2024-11-21 08:06:29 -0800</bug_when>
    <thetext>A similar issue has also been raised previously: https://bugs.webkit.org/show_bug.cgi?id=199134</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077405</commentid>
    <comment_count>2</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2024-11-24 09:36:01 -0800</bug_when>
    <thetext>This issue only affects Safari and means that it is difficult for me to implement an icon system on my website. 
Hopefully this can also be fixed of the sake of light/dark favicons once Safari adds support for SVG favicons.

I also wanted to make clear that this issue effects both SVGs used as &lt;img&gt; and also SVG referenced using &lt;use&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078064</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-28 07:43:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/140661763&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078068</commentid>
    <comment_count>4</comment_count>
    <who name="Nilesh Prajapati">nileshprajapati</who>
    <bug_when>2024-11-28 08:26:50 -0800</bug_when>
    <thetext>WebKit position: SVG favicons https://github.com/WebKit/standards-positions/issues/367</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2103307</commentid>
    <comment_count>5</comment_count>
      <attachid>474571</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-03-14 09:45:02 -0700</bug_when>
    <thetext>Created attachment 474571
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2105498</commentid>
    <comment_count>6</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-03-23 23:37:52 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/42918</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2105682</commentid>
    <comment_count>7</comment_count>
    <who name="Taher">taher_ali</who>
    <bug_when>2025-03-24 14:38:51 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/42955</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2106761</commentid>
    <comment_count>8</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2025-03-28 02:40:34 -0700</bug_when>
    <thetext>Related to this: Canvas and CanvasText are not currently effected by the users chosen system preference, even when style=&quot;color-scheme: light dark&quot;  is included on the SVG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2163273</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-12-04 09:19:12 -0800</bug_when>
    <thetext>Committed 303920@main (702c47ccd924): &lt;https://commits.webkit.org/303920@main&gt;

Reviewed commits have been landed. Closing PR #42918 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181732</commentid>
    <comment_count>10</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2026-02-14 07:28:30 -0800</bug_when>
    <thetext>I do not understand why this issue has been marked as resolved fixed. From my testing in Safari Technology Preview 237 this issue is not fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181743</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-02-14 10:17:49 -0800</bug_when>
    <thetext>In the test case, &quot;inline SVG&quot; is fixed, but&quot; &lt;img&gt; src&quot; and &quot;CSS background-image&quot; are not. Does that match what you&apos;re seeing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181745</commentid>
    <comment_count>12</comment_count>
    <who name="Oliver Williams">oliverwilliams345</who>
    <bug_when>2026-02-14 10:28:00 -0800</bug_when>
    <thetext>Yes that matches what I’m seeing.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>474571</attachid>
            <date>2025-03-14 09:45:02 -0700</date>
            <delta_ts>2025-03-14 09:45:02 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test-svg-light-dark.html</filename>
            <type>text/html</type>
            <size>2528</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgc3ZnLCBpbWcsIGRpdiB7CiAgICAgICAgd2lkdGg6IDIwMHB4OwogICAgICAg
IGhlaWdodDogMjAwcHg7CiAgICB9ICAKICAgIGRpdiB7CiAgICAgICAgZGlzcGxheTogaW5saW5l
LWJsb2NrOwogICAgICAgIGJhY2tncm91bmQtaW1hZ2U6IHVybCgiZGF0YTppbWFnZS9zdmcreG1s
O2NoYXJzZXQ9dXRmOCwgXAogICAgICAgICAgICAlM0Nzdmcgc3R5bGU9J2NvbG9yLXNjaGVtZTog
bGlnaHQgZGFyazsnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgZmlsbD0nbGln
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