taffy
taffy copied to clipboard
Add CSS calc
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
- [ ] Look into Strict Provenance / sptr
- [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 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 I'm not quite sure what the problem of my current approach is, but I appreciate the feedback.