Bug 263711

Summary: round(), mod(), and rem() do not work when there is a percentage for only one value
Product: WebKit Reporter: Roman Komarov <kizmarh>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ana.tudor.lhnh, heycam, koivisto, nmouchtaris, ntim, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=259714
Attachments:
Description Flags
CodePen with the bug reproduced none

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>