mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Issue #1781 - Part 1: support calc() in stroke-dashoffset CSS
This adds basic calc() support to stroke-dashoffset. It does not provide CSS animation (yet, todo for part 2)
This commit is contained in:
parent
4bcb79066b
commit
15a322effa
3 changed files with 120 additions and 1 deletions
|
|
@ -833,6 +833,14 @@ SVGContentUtils::CoordToFloat(nsSVGElement *aContent,
|
|||
SVGSVGElement* ctx = aContent->GetCtx();
|
||||
return ctx ? aCoord.GetPercentValue() * ctx->GetLength(SVGContentUtils::XY) : 0.0f;
|
||||
}
|
||||
case eStyleUnit_Calc: {
|
||||
MOZ_ASSERT(aCoord.GetCalcValue(), "Invalid calc value");
|
||||
nsStyleCoord::Calc* calc = aCoord.GetCalcValue();
|
||||
SVGSVGElement* ctx = aContent->GetCtx();
|
||||
float len = nsPresContext::AppUnitsToFloatCSSPixels(calc->mLength);
|
||||
return ctx ? len + calc->mPercent * ctx->GetLength(SVGContentUtils::XY)
|
||||
: len;
|
||||
}
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue