<?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>238874</bug_id>
          
          <creation_ts>2022-04-06 10:14:39 -0700</creation_ts>
          <short_desc>[cssom] &quot;set a CSS declaration&quot; is broken for deferred properties</short_desc>
          <delta_ts>2024-07-23 11:24:06 -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>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=226461</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>238350</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oriol Brufau">obrufau</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>karlcow</cc>
    
    <cc>m_dubet</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1858888</commentid>
    <comment_count>0</comment_count>
      <attachid>456830</attachid>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2022-04-06 10:14:39 -0700</bug_when>
    <thetext>Created attachment 456830
testcase

Run this testcase:

    &lt;!DOCTYPE html&gt;
    &lt;div id=&quot;target&quot;&gt;&lt;/div&gt;
    &lt;script&gt;
    var cs = getComputedStyle(target);

    target.style.boxShadow = &quot;0 0 0 100px blue&quot;;
    console.log(target.style.cssText); // box-shadow: blue 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(0, 0, 255) 0px 0px 0px 100px

    target.style.webkitBoxShadow = &quot;0 0 0 100px red&quot;;
    console.log(target.style.cssText); // box-shadow: blue 0px 0px 0px 100px; -webkit-box-shadow: red 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(255, 0, 0) 0px 0px 0px 100px

    target.style.boxShadow = &quot;0 0 0 100px green&quot;;
    console.log(target.style.cssText); // box-shadow: green 0px 0px 0px 100px; -webkit-box-shadow: red 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(0, 128, 0) 0px 0px 0px 100px
    &lt;/script&gt;

Expected: green shadow.
Actual: red shadow.

box-shadow and -webkit-box-shadow are implemented as longhands that share a computed value.
During the CSS cascade, they are deferred and applied in parse order, so that the last one wins.
But CSSOM is broken, as seen above.
When you set boxShadow=&quot;0 0 0 100px green&quot;, it just updates the old value in place, without taking into account that it will be overridden by -webkit-box-shadow that appears later.

This needs the same fix that bug 226461 did for properties in a logical property group.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1861155</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-04-13 10:15:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/91698692&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047847</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-23 11:23:53 -0700</bug_when>
    <thetext>It is still broken in Safari Technology Preview 199, while Chrome Canary 128 and Firefox Nightly 130 are matching each other and show &apos;green&apos; for attached test case instead of &apos;red&apos; (as in Safari).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>456830</attachid>
            <date>2022-04-06 10:14:39 -0700</date>
            <delta_ts>2022-04-06 10:14:39 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>deferred-cssom.html</filename>
            <type>text/html</type>
            <size>737</size>
            <attacher name="Oriol Brufau">obrufau</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxkaXYgaWQ9InRhcmdldCI+PC9kaXY+CjxzY3JpcHQ+CnZhciBjcyA9
IGdldENvbXB1dGVkU3R5bGUodGFyZ2V0KTsKCnRhcmdldC5zdHlsZS5ib3hTaGFkb3cgPSAiMCAw
IDAgMTAwcHggYmx1ZSI7CmNvbnNvbGUubG9nKHRhcmdldC5zdHlsZS5jc3NUZXh0KTsgLy8gYm94
LXNoYWRvdzogZ3JlZW4gMHB4IDBweCAwcHggMTAwcHg7CmNvbnNvbGUubG9nKGNzLmJveFNoYWRv
dyk7IC8vIHJnYigwLCAxMjgsIDApIDBweCAwcHggMHB4IDEwMHB4Cgp0YXJnZXQuc3R5bGUud2Vi
a2l0Qm94U2hhZG93ID0gIjAgMCAwIDEwMHB4IHJlZCI7CmNvbnNvbGUubG9nKHRhcmdldC5zdHls
ZS5jc3NUZXh0KTsgLy8gYm94LXNoYWRvdzogZ3JlZW4gMHB4IDBweCAwcHggMTAwcHg7IC13ZWJr
aXQtYm94LXNoYWRvdzogcmVkIDBweCAwcHggMHB4IDEwMHB4Owpjb25zb2xlLmxvZyhjcy5ib3hT
aGFkb3cpOyAvLyByZ2IoMjU1LCAwLCAwKSAwcHggMHB4IDBweCAxMDBweAoKdGFyZ2V0LnN0eWxl
LmJveFNoYWRvdyA9ICIwIDAgMCAxMDBweCBncmVlbiI7CmNvbnNvbGUubG9nKHRhcmdldC5zdHls
ZS5jc3NUZXh0KTsgLy8gYm94LXNoYWRvdzogZ3JlZW4gMHB4IDBweCAwcHggMTAwcHg7IC13ZWJr
aXQtYm94LXNoYWRvdzogcmVkIDBweCAwcHggMHB4IDEwMHB4Owpjb25zb2xlLmxvZyhjcy5ib3hT
aGFkb3cpOyAvLyByZ2IoMCwgMTI4LCAwKSAwcHggMHB4IDBweCAxMDBweAo8L3NjcmlwdD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>