<?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>263711</bug_id>
          
          <creation_ts>2023-10-26 00:38:16 -0700</creation_ts>
          <short_desc>round(), mod(), and rem() do not work when there is a percentage for only one value</short_desc>
          <delta_ts>2024-08-31 08:20:43 -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>Safari Technology Preview</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=259714</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="Roman Komarov">kizmarh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ana.tudor.lhnh</cc>
    
    <cc>heycam</cc>
    
    <cc>koivisto</cc>
    
    <cc>nmouchtaris</cc>
    
    <cc>ntim</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1987679</commentid>
    <comment_count>0</comment_count>
      <attachid>468349</attachid>
    <who name="Roman Komarov">kizmarh</who>
    <bug_when>2023-10-26 00:38:16 -0700</bug_when>
    <thetext>Created attachment 468349
CodePen with the bug reproduced

I noticed a bug in Safari (regular and TP) in how it handles mixed units for round(), mod() and rem() that include a %, but only when it does include it for one value (only A or B, not both as in the above tests).

First reduced in this CodePen: https://codepen.io/kizu/pen/BaMaYwE?editors=1100 (all elements should have the same width with the green part visible on the right), decided to submit it as my first WPT test: https://github.com/web-platform-tests/wpt/pull/42676 (merged)

Can be seen as failing here: https://wpt.fyi/results/css/css-values/round-mod-rem-computed.html?label=experimental&amp;label=master&amp;aligned&amp;q=css%2Fcss-values%2Fround-mod-rem-computed.html

Current workaround: add 0% to the other part so both contain px and %.

Adding the saved CodePen html as an attachment as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987851</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-26 15:42:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/117554926&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2056795</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2024-08-31 08:20:43 -0700</bug_when>
    <thetext>This is fixed in ToT (was fixed as part of the calc() re-write - https://bugs.webkit.org/show_bug.cgi?id=278244)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>468349</attachid>
            <date>2023-10-26 00:38:16 -0700</date>
            <delta_ts>2023-10-26 00:38:16 -0700</delta_ts>
            <desc>CodePen with the bug reproduced</desc>
            <filename>CodePen - Round with variables.html</filename>
            <type>text/html</type>
            <size>1369</size>
            <attacher name="Roman Komarov">kizmarh</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjwhLS0gc2F2ZWQgZnJvbSB1cmw9KDAwNjYpaHR0cHM6Ly9jZHBuLmlv
L3Blbi9kZWJ1Zy9CYU1hWXdFP2F1dGhlbnRpY2F0aW9uX2hhc2g9d1FyUG9Xam9ManlNIC0tPgo8
aHRtbCBsYW5nPSJlbiI+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBl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ICAgICAxMDAlICsgMHB4LAogICAgICAgIDIwMHB4
CiAgICAgICk7CiAgIj48L2Rpdj4KCiAgPGRpdiBzdHlsZT0iCiAgICBiYWNrZ3JvdW5kOiBwaW5r
OwogICAgd2lkdGg6CiAgICAgIHJvdW5kKAogICAgICAgIGRvd24sCiAgICAgICAgMTAwJSArIHZh
cigtLWZvbywgMHB4KSwKICAgICAgICAyMDBweAogICAgICApOwogICI+PC9kaXY+CgogIDxkaXYg
c3R5bGU9IgogICAgYmFja2dyb3VuZDogcGluazsKICAgIHdpZHRoOgogICAgICByb3VuZCgKICAg
ICAgICBkb3duLAogICAgICAgIDEwMCUgKyB2YXIoLS1mb28sIDBweCksCiAgICAgICAgMjAwcHgg
KyAwJQogICAgICApOwogICI+PC9kaXY+CjwvZGl2PgogIAogIAogIAoKCgo8L2JvZHk+PC9odG1s
Pg==
</data>

          </attachment>
      

    </bug>

</bugzilla>