Using simplifyCalculation() in resolvePx() to resolve CSSMathValues and CSSUnitValues according to spec.
Swithcing to using resolvePx() elsewhere, in stead of calling simplicyCalculation() directly.
This gives us one unified code path to resolving px values from CSSNumericValues.
resolvePx() now takes an info/context object that simplifyCalculation() can use to resolve relative units. Ritght now it supports percentageReference and fontSize, but can be extended with values so that we can resolve all relative units, such as viewport units.
The context object is now called info but could benefit from a more descriptive name. Suggestions are welcome :)
Using
simplifyCalculation()
inresolvePx()
to resolve CSSMathValues and CSSUnitValues according to spec. Swithcing to usingresolvePx()
elsewhere, in stead of callingsimplicyCalculation()
directly.This gives us one unified code path to resolving px values from CSSNumericValues.
resolvePx()
now takes an info/context object thatsimplifyCalculation()
can use to resolve relative units. Ritght now it supportspercentageReference
andfontSize
, but can be extended with values so that we can resolve all relative units, such as viewport units.The context object is now called
info
but could benefit from a more descriptive name. Suggestions are welcome :)