Bug 117782

Summary: Simplify parsed CSS Calc expressions
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ahmad.saleem792, ap, betravis, bfulgham, kling, koivisto, nmouchtaris, simon.fraser, svillar, zalan
Priority: P2 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
All browser slightly differ from each other none

Description Ryosuke Niwa 2013-06-18 20:56:40 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/334d7594dadde64b65b18f2ed9947c1d433e783d

Add simplification of calc expressions at parse time.
Numbers and compatible units are merged and evaluated.
"calc(4px + 1in + 10%)" gets simplified to "calc(100px + 10%)"
Comment 1 Ahmad Saleem 2022-07-24 08:07:30 PDT
Created attachment 461176 [details]
All browser slightly differ from each other

I took the test case from Blink patch and changed it into following JSFiddle:

Link - https://jsfiddle.net/4058z76y/show

All browsers slightly differ from each other and I am not sure on web-spec and which browser is right so just wanted to share updated results and I pointed to some quick ones in Safari 15.6, where there are some obvious changes compared to Firefox Nightly 104.

It is just updated testing results. Thanks!
Comment 2 Ryosuke Niwa 2022-07-24 14:03:12 PDT
We merged new CSS parser from Blink so this is moot.
Comment 3 Ahmad Saleem 2022-07-24 14:05:18 PDT
But even still Safari differs from even Chrome as can been seen in the screenshot. Is it something, we update CSS Parser code time to time to get latest fixes and we haven't taken recent fixes yet?
Comment 4 Ryosuke Niwa 2022-07-24 14:08:25 PDT
Hm... okay. I guess we're missing some pieces then.
Comment 5 Ryosuke Niwa 2022-07-26 21:49:41 PDT

*** This bug has been marked as a duplicate of bug 111149 ***