<?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>247771</bug_id>
          
          <creation_ts>2022-11-10 16:25:38 -0800</creation_ts>
          <short_desc>CSSOM serializes most shorthands without checking !important flag</short_desc>
          <delta_ts>2022-11-17 00:00:17 -0800</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>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=247769</see_also>
    
    <see_also>https://github.com/web-platform-tests/wpt/pull/36984</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="Oriol Brufau">obrufau</reporter>
          <assigned_to name="Oriol Brufau">obrufau</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1911701</commentid>
    <comment_count>0</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2022-11-10 16:25:38 -0800</bug_when>
    <thetext>From https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue

3. If important flags of all declarations in list are same, then return the serialization of list.
4. Return the empty string. 

Run this code:

var allCSSProps = new Set();
for (let obj = document.createElement(&quot;div&quot;).style; obj; obj = Reflect.getPrototypeOf(obj)) {
  for (let name of Object.getOwnPropertyNames(obj)) {
    let prop = name.replace(/[A-Z]/g, c =&gt; &quot;-&quot; + c.toLowerCase());
    if (CSS.supports(prop, &quot;initial&quot;)) {
      allCSSProps.add(prop);
    }
  }
}
var style = document.createElement(&quot;div&quot;).style;
var bad = [];
var good = [];
for (let prop of allCSSProps) {
  style.cssText = &quot;&quot;;
  style.setProperty(prop, &quot;initial&quot;);
  if (style.length &gt; 1) {
    style.setProperty(style[0], &quot;initial&quot;, &quot;important&quot;);
    if (style.getPropertyValue(prop) !== &quot;&quot;) {
      bad.push(prop);
    } else good.push(prop);
  }
}
bad;

Expected: empty array

Actual: [
  &quot;-epub-text-emphasis&quot;,
  &quot;-webkit-animation&quot;,
  &quot;-webkit-border-after&quot;,
  &quot;-webkit-border-before&quot;,
  &quot;-webkit-border-end&quot;,
  &quot;-webkit-border-start&quot;,
  &quot;-webkit-column-rule&quot;,
  &quot;-webkit-columns&quot;,
  &quot;-webkit-flex&quot;,
  &quot;-webkit-flex-flow&quot;,
  &quot;-webkit-mask&quot;,
  &quot;-webkit-mask-position&quot;,
  &quot;-webkit-perspective-origin&quot;,
  &quot;-webkit-text-decoration&quot;,
  &quot;-webkit-text-emphasis&quot;,
  &quot;-webkit-text-stroke&quot;,
  &quot;-webkit-transform-origin&quot;,
  &quot;-webkit-transition&quot;,
  &quot;animation&quot;,
  &quot;background&quot;,
  &quot;background-position&quot;,
  &quot;border-block-end&quot;,
  &quot;border-block-start&quot;,
  &quot;border-bottom&quot;,
  &quot;border-inline-end&quot;,
  &quot;border-inline-start&quot;,
  &quot;border-left&quot;,
  &quot;border-right&quot;,
  &quot;border-spacing&quot;,
  &quot;border-top&quot;,
  &quot;column-rule&quot;,
  &quot;columns&quot;,
  &quot;container&quot;,
  &quot;flex&quot;,
  &quot;flex-flow&quot;,
  &quot;font&quot;,
  &quot;font-synthesis&quot;,
  &quot;font-variant&quot;,
  &quot;grid-area&quot;,
  &quot;grid-column&quot;,
  &quot;grid-row&quot;,
  &quot;grid-template&quot;,
  &quot;list-style&quot;,
  &quot;marker&quot;,
  &quot;mask&quot;,
  &quot;mask-position&quot;,
  &quot;outline&quot;,
  &quot;perspective-origin&quot;,
  &quot;place-content&quot;,
  &quot;place-items&quot;,
  &quot;place-self&quot;,
  &quot;text-emphasis&quot;,
  &quot;transform-origin&quot;,
  &quot;transition&quot;
]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912688</commentid>
    <comment_count>1</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2022-11-15 12:59:43 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6523</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913113</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-16 23:59:51 -0800</bug_when>
    <thetext>Committed 256774@main (dc7aed5d4dc6): &lt;https://commits.webkit.org/256774@main&gt;

Reviewed commits have been landed. Closing PR #6523 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913114</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-17 00:00:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/102454608&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>