<?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>201637</bug_id>
          
          <creation_ts>2019-09-10 03:42:23 -0700</creation_ts>
          <short_desc>WebKit incorrectly ignores percentages during calc() serialization</short_desc>
          <delta_ts>2022-07-01 13:45:28 -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>CONFIGURATION CHANGED</resolution>
          
          
          <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="Emilio Cobos Álvarez (:emilio)">emilio</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1569491</commentid>
    <comment_count>0</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2019-09-10 03:42:23 -0700</bug_when>
    <thetext>Chrome also has this bug, see https://bugs.chromium.org/p/chromium/issues/detail?id=1002430

1. Open data:text/html,&lt;div style=&quot;background-position: calc(0% + 0px) calc(0% + 0px)&quot;&gt;&lt;/div&gt;
2. Run on the terminal: getComputedStyle(document.querySelector(&quot;div&quot;)).backgroundPosition

Expected: calc(0% + 0px) calc(0% + 0px)
Actual: 0px 0px

Per https://drafts.csswg.org/css-values-4/#calc-computed-value:

&gt; Where percentages are not resolved at computed-value time, they are not resolved in math functions, e.g. calc(100% - 100% + 1px) resolves to calc(0% + 1px), not to 1px. If there are special rules for computing percentages in a value (e.g. the height property), they apply whenever a math function contains percentages.

See also https://github.com/w3c/csswg-drafts/issues/3482, and https://bugzilla.mozilla.org/show_bug.cgi?id=1574913 which is where this came up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880126</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-01 13:45:28 -0700</bug_when>
    <thetext>Safari, Chrome, and Firefox all agree on the output:

&quot;0% 0%&quot;

I believe this now works properly. Please REOPEN if I am misunderstanding the issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>