taffy icon indicating copy to clipboard operation
taffy copied to clipboard

Add CSS calc

Open kokoISnoTarget opened this issue 1 year ago • 2 comments

Objective

Fixes: #225

Context

https://github.com/DioxusLabs/taffy/pull/232#issuecomment-1501163557 https://drafts.csswg.org/css-values/#funcdef-calc

Feedback wanted

Todo

  • [ ] Change RELEASES.md
  • [ ] Add testing
    • [x] Finish Parser for tests
    • [ ] Test on other systems because of fun pointer stuff:
      • [ ] 32bit systems
      • [ ] Little and Big-endian systems
      • [ ] Non x86 platforms (Arm and whatever)
    • [ ] Miri
  • [x] Add basic remaining CSS math functions
  • [ ] Documentation
  • [ ] Performance
    • [x] Don't be 50% slower (~7%)
  • [ ] Find out where freeing/dropping memory is appropriate.
  • [ ] Clean things up

kokoISnoTarget avatar Jun 21 '24 11:06 kokoISnoTarget

@kokoISnoTarget I've been reading some of your commits, and regarding the "union", I suspect you may actually want a newtype around a u32 (or u64 if you need 64 bits). You can then use type casts and bit manipulation operators to access the tag and the value(s).

nicoburns avatar Jul 02 '24 22:07 nicoburns

@nicoburns I'm not quite sure what the problem of my current approach is, but I appreciate the feedback.

kokoISnoTarget avatar Jul 03 '24 00:07 kokoISnoTarget