<?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>224485</bug_id>
          
          <creation_ts>2021-04-13 06:34:08 -0700</creation_ts>
          <short_desc>Web Inspector: Forced color scheme should reset on page refresh</short_desc>
          <delta_ts>2023-06-07 03:44:15 -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>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <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="Razvan Caliman">rcaliman</reporter>
          <assigned_to name="Razvan Caliman">rcaliman</assigned_to>
          <cc>bburg</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yurys</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1749669</commentid>
    <comment_count>0</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2021-04-13 06:34:08 -0700</bug_when>
    <thetext>&lt;rdar://76227216&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1749674</commentid>
    <comment_count>1</comment_count>
      <attachid>425871</attachid>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2021-04-13 07:11:48 -0700</bug_when>
    <thetext>Created attachment 425871
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1749803</commentid>
    <comment_count>2</comment_count>
      <attachid>425871</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2021-04-13 12:38:05 -0700</bug_when>
    <thetext>Comment on attachment 425871
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1749828</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-04-13 13:09:41 -0700</bug_when>
    <thetext>Committed r275904 (236468@main): &lt;https://commits.webkit.org/236468@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425871.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754423</commentid>
    <comment_count>4</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2021-04-26 16:12:35 -0700</bug_when>
    <thetext>(In reply to EWS from comment #3)
&gt; Committed r275904 (236468@main): &lt;https://commits.webkit.org/236468@main&gt;
&gt; 

This change regresses current behavior: there is no way to override color scheme preference in the early stage of page load as there is inherent delay between navigation commit and when the front-end can set the override back. Basically this code will always give wrong result if run early during page load:

// Send Page.setForcedAppearance with &quot;appearance&quot;:&quot;Light&quot;
// navigate to a page with the following code in its inline script:
console.log(matchMedia(&apos;(prefers-color-scheme: light)&apos;).matches);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1960248</commentid>
    <comment_count>5</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2023-06-07 03:44:15 -0700</bug_when>
    <thetext>(In reply to Yury Semikhatsky from comment #4)
&gt; This change regresses current behavior: there is no way to override color
&gt; scheme preference in the early stage of page load as there is inherent delay
&gt; between navigation commit and when the front-end can set the override back.
&gt; Basically this code will always give wrong result if run early during page
&gt; load:
&gt; 
&gt; // Send Page.setForcedAppearance with &quot;appearance&quot;:&quot;Light&quot;
&gt; // navigate to a page with the following code in its inline script:
&gt; console.log(matchMedia(&apos;(prefers-color-scheme: light)&apos;).matches);

This has been addressed in the patch for Bug 254457.
The color scheme override will persist on page refresh.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>425871</attachid>
            <date>2021-04-13 07:11:48 -0700</date>
            <delta_ts>2021-04-13 13:09:41 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-224485-20210413161147.patch</filename>
            <type>text/plain</type>
            <size>1354</size>
            <attacher name="Razvan Caliman">rcaliman</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCA0MTk5YzU4M2RjMGNjZjIwMmNhNjUzZjgzNmZkNDJkMDNkOTcyMjM5Li5k
Nzg5ZWJlMjNjOGIyYjAzMTkxMzY3OWEzMGNhOGFkZDgyYWZmMGUyIDEwMDY0NAotLS0gYS9Tb3Vy
Y2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0x
LDMgKzEsMTcgQEAKKzIwMjEtMDQtMTMgIFJhenZhbiBDYWxpbWFuICA8cmNhbGltYW5AYXBwbGUu
Y29tPgorCisgICAgICAgIFdlYiBJbnNwZWN0b3I6IEZvcmNlZCBjb2xvciBzY2hlbWUgc2hvdWxk
IHJlc2V0IG9uIHBhZ2UgcmVmcmVzaAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9z
aG93X2J1Zy5jZ2k/aWQ9MjI0NDg1CisgICAgICAgIDxyZGFyOi8vNzYyMjcyMTY+CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgUmVzZXQgdGhlIGZvcmNl
ZCBjb2xvciBzY2hlbWUgb24gcGFnZSByZWxvYWQgdG8ga2VlcCBpbiBzeW5jIHdpdGggV2ViIElu
c3BlY3RvcgorICAgICAgICBiZWhhdmlvciBmb3Igb3RoZXI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