<?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>309611</bug_id>
          
          <creation_ts>2026-03-10 16:35:12 -0700</creation_ts>
          <short_desc>[Site Isolation] @prefers-color-scheme doesn&apos;t see color-scheme from parent frames and above</short_desc>
          <delta_ts>2026-05-04 13:31:24 -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>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=284973</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=311766</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=311812</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=312191</see_also>
    
    <see_also>https://github.com/web-platform-tests/wpt/pull/59497</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="Kiet Ho">kiet.ho</reporter>
          <assigned_to name="Kiet Ho">kiet.ho</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>clopez</cc>
    
    <cc>kiet.ho</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2188893</commentid>
    <comment_count>0</comment_count>
      <attachid>478621</attachid>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-03-10 16:35:12 -0700</bug_when>
    <thetext>Created attachment 478621
Test case 1

See the test case.

We have an &lt;iframe&gt; (iframe 1) with color-scheme: dark. The inside document has another &lt;iframe&gt; (iframe 2) without color-scheme. The innermost document has a box which its background-color depends on @prefers-color-scheme.
The color-scheme from iframe 1 should propagate through iframe 2 into the innermost document, so prefers-color-scheme should match &quot;dark&quot;. But in WebKit, it doesn&apos;t match to &quot;dark&quot;.
On Chrome 147.0.7719.3 (Official Build) dev (arm64) and Firefox 150.0a1 (2026-03-10) (aarch64), the box is dark blue, regardless of environment color scheme. In WebKit, the box is light blue instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2188894</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-03-10 16:35:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/172229372&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2188897</commentid>
    <comment_count>2</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-03-10 16:38:16 -0700</bug_when>
    <thetext>To add, this is found when investigating bug 284973.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2200451</commentid>
    <comment_count>3</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-04-14 17:50:12 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/62786</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205081</commentid>
    <comment_count>4</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-04-27 13:43:17 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/59497</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205398</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-28 10:35:23 -0700</bug_when>
    <thetext>Committed 312212@main (9e45d72ed9ea): &lt;https://commits.webkit.org/312212@main&gt;

Reviewed commits have been landed. Closing PR #62786 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207342</commentid>
    <comment_count>6</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2026-05-04 13:31:24 -0700</bug_when>
    <thetext>*** Bug 311812 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>478621</attachid>
            <date>2026-03-10 16:35:12 -0700</date>
            <delta_ts>2026-03-10 16:35:12 -0700</delta_ts>
            <desc>Test case 1</desc>
            <filename>prefers-color-scheme-nested-iframe.html</filename>
            <type>text/html</type>
            <size>488</size>
            <attacher name="Kiet Ho">kiet.ho</attacher>
            
              <data encoding="base64">PGlmcmFtZSBzdHlsZT1jb2xvci1zY2hlbWU6ZGFyayBzcmNkb2M9IgogIDxpZnJhbWUgc3JjZG9j
PScKICAgIDxzdHlsZT4KICAgICAgYm9keSB7IAogICAgICAgIGZvbnQtZmFtaWx5OiBzeXN0ZW0t
dWk7CiAgICAgIH0KICAgICAgZGl2IHsKICAgICAgICB3aWR0aDogMTAwcHg7CiAgICAgICAgaGVp
Z2h0OiAxMDBweDsKICAgICAgfQogICAgICAKICAgICAgQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNj
aGVtZTogZGFyaykgewogICAgICAgIGRpdiB7IGJhY2tncm91bmQtY29sb3I6IGRhcmtibHVlOyB9
CiAgICAgIH0KCiAgICAgIEBtZWRpYSAocHJlZmVycy1jb2xvci1zY2hlbWU6IGxpZ2h0KSB7CiAg
ICAgICAgZGl2IHsgYmFja2dyb3VuZC1jb2xvcjogbGlnaHRibHVlOyB9CiAgICAgIH0KICAgIDwv
c3R5bGU+CiAgICA8aDI+SW0gYW4gaWZyYW1lIGluIGFuIGlmcmFtZSE8L2gyPgogICAgPGRpdj48
L2Rpdj4KICAnPjwvaWZyYW1lPgoiPjwvaWZyYW1lPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>