Bug 263711 - round(), mod(), and rem() do not work when there is a percentage for only one value
Summary: round(), mod(), and rem() do not work when there is a percentage for only one...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-26 00:38 PDT by Roman Komarov
Modified: 2024-03-06 05:21 PST (History)
7 users (show)

See Also:


Attachments
CodePen with the bug reproduced (1.34 KB, text/html)
2023-10-26 00:38 PDT, Roman Komarov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Komarov 2023-10-26 00:38:16 PDT
Created attachment 468349 [details]
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&label=master&aligned&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.
Comment 1 Radar WebKit Bug Importer 2023-10-26 15:42:28 PDT
<rdar://problem/117554926>