<?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>225206</bug_id>
          
          <creation_ts>2021-04-29 13:26:23 -0700</creation_ts>
          <short_desc>CSS shorthand should serialize as empty string when longhands have variables</short_desc>
          <delta_ts>2022-07-28 15:01:01 -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>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>230389</dup_id>
          <see_also>https://bugs.chromium.org/p/chromium/issues/detail?id=616341</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oriol Brufau">obrufau</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>justin</cc>
    
    <cc>koivisto</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1755514</commentid>
    <comment_count>0</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2021-04-29 13:26:23 -0700</bug_when>
    <thetext>Run this code:

```js
document.body.style.cssText = `
  --t: 1px 2px;
  --r: 3px;
  --b: 4px;
  --l: ;
  margin-top: var(--t);
  margin-right: var(--r);
  margin-bottom: var(--b);
  margin-left: var(--l);
`;
getComputedStyle(document.body).margin; // &quot;0px 3px 4px 0px&quot;
document.body.style.margin; // BAD: &quot;var(--t) var(--r) var(--b) var(--l)&quot;
document.body.style.margin += &quot;&quot;;
getComputedStyle(document.body).margin; // &quot;1px 2px 3px 4px&quot;
```

The margin shorthand shouldn&apos;t be serialized concatenating the var() notations, because that can have a different meaning!

It should be serialized as empty string instead.

The specs are not much clear about this (https://github.com/w3c/csswg-drafts/issues/6253), but Chromium and Firefox do the reasonable thing and serialize as empty string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757601</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-05-06 13:27:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/77622517&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1781759</commentid>
    <comment_count>2</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2021-08-03 15:20:56 -0700</bug_when>
    <thetext>Chromium was fixed in https://crbug.com/616341</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1793697</commentid>
    <comment_count>3</comment_count>
    <who name="Justin Halsall">justin</who>
    <bug_when>2021-09-15 07:26:20 -0700</bug_when>
    <thetext>Another example of reproducing this bug: https://jsfiddle.net/9gft8hkr/5/ 

(from: https://bugs.chromium.org/p/chromium/issues/detail?id=1218159#c12)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1793712</commentid>
    <comment_count>4</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2021-09-15 08:33:54 -0700</bug_when>
    <thetext>No, your expectations in https://jsfiddle.net/9gft8hkr/5/ are wrong. Chromium and Firefox are correct. WebKit is wrong but it&apos;s unrelated to this issue, it&apos;s bug 225209 and something else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887461</commentid>
    <comment_count>5</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2022-07-28 15:01:01 -0700</bug_when>
    <thetext>This was fixed as part of bug 230389.
Kinda strange that this seems to only have a test in css-logical, nothing in css-variables or cssom, but oh well.

*** This bug has been marked as a duplicate of bug 230389 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>