<?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>248442</bug_id>
          
          <creation_ts>2022-11-28 16:16:44 -0800</creation_ts>
          <short_desc>cssText serialization in inline style for &quot;padding&quot;</short_desc>
          <delta_ts>2022-11-28 17:27:41 -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>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>185953</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>obrufau</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1915155</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-11-28 16:16:44 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink commit&apos;s, which can be merged or where we are failing some test cases, I came across another one:

Failing Test Case (not taken from patch but updated from source.chromium.org) - https://jsfiddle.net/r5u0c9wh/show

Blink Commit - https://chromium.googlesource.com/chromium/blink/+/1b84d2a68d373efab9a6e571274ffefdeefe6c58

Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/Source/WebCore/css/StyleProperties.cpp#L704

Just wanted to raise a bug, where this can be tracked for future fix purposes.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915170</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-11-28 17:07:07 -0800</bug_when>
    <thetext>I think we already fixed the !important issue, but CSS-wide keywords may still need extra work? Oriol, is there a bug on file for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915171</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-11-28 17:10:37 -0800</bug_when>
    <thetext>I don&apos;t have Trunk build locally so in STP158, we do fail &quot;padding&quot; test case from JSFiddle in Comment 0 w while the browsers (Chrome Canary 110 &amp; Firefox Nightly 109) pass all of them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915177</commentid>
    <comment_count>3</comment_count>
    <who name="Oriol Brufau">obrufau</who>
    <bug_when>2022-11-28 17:27:41 -0800</bug_when>
    <thetext>Yeah, !important was fixed in bug 247771, you can test with e.g. &apos;inherit&apos;:

  var {style} = document.createElement(&quot;div&quot;);
  style.cssText = &quot;padding: inherit; padding-top: inherit !important&quot;;
  style.cssText; // &quot;padding-right: inherit; padding-bottom: inherit; padding-left: inherit; padding-top: inherit !important;&quot;

The problem with &apos;initial&apos; is bug 185953, caused by this piece of code: https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/Source/WebCore/css/StyleProperties.cpp#L1759-L1760

It was a workaround for some other problem that I don&apos;t remember, probably that the serialization of several shorthands does not properly handle CSS-wide keywords (https://github.com/WebKit/WebKit/blob/b9824fc290ac9247e8a04f38632a8fdd4b9ec02d/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssom-getPropertyValue-common-checks-expected.txt) or that during parsing a shorthand can set omitted longhands to literally &apos;initial&apos; instead of  the actual initial value.

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

    </bug>

</bugzilla>