Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API tweaks for Taffy calc() integration #104

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

nicoburns
Copy link
Collaborator

Submitted upstream as https://bugzilla.mozilla.org/show_bug.cgi?id=1939791, but don't want to wait for sync before posting Servo PR.

Changes made:

  • Make LengthPercentage::unpack and the Unpack type it returns public. Used to access the address of the boxed CalcLengthPercentage value so that it can be passed into Taffy.
  • Add OpaqueElement::from_non_null_ptr. This is used to avoid Undefined Behaviour when constructing an OpaqueElement from an index which is unlikely to be a valid memory address. Technically not related to calc() but it's a small change, and I've bundled them when submitting upstream.

This will help enable support for calc() values for CSS Grid containers/items in Servo.

Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
@nicoburns nicoburns added the enhancement New feature or request label Jan 6, 2025
@nicoburns nicoburns added this pull request to the merge queue Jan 7, 2025
Merged via the queue into servo:main with commit 95ee4c3 Jan 7, 2025
3 checks passed
@nicoburns nicoburns deleted the grid-calc branch January 7, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants