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: RESOLVED FIXED    
Severity: Normal CC: ana.tudor.lhnh, heycam, koivisto, nmouchtaris, ntim, sam, 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

Roman Komarov
Reported 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.
Attachments
CodePen with the bug reproduced (1.34 KB, text/html)
2023-10-26 00:38 PDT, Roman Komarov
no flags
Radar WebKit Bug Importer
Comment 1 2023-10-26 15:42:28 PDT
Sam Weinig
Comment 2 2024-08-31 08:20:43 PDT
This is fixed in ToT (was fixed as part of the calc() re-write - https://bugs.webkit.org/show_bug.cgi?id=278244)
Note You need to log in before you can comment on or make changes to this bug.