API tweaks for Taffy calc()
integration
#104
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
LengthPercentage::unpack
and theUnpack
type it returns public. Used to access the address of the boxedCalcLengthPercentage
value so that it can be passed into Taffy.OpaqueElement::from_non_null_ptr
. This is used to avoid Undefined Behaviour when constructing anOpaqueElement
from an index which is unlikely to be a valid memory address. Technically not related tocalc()
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.