@@ -237,31 +237,23 @@ float SVGViewportElement::GetLength(uint8_t aCtxType) const {
237237// SVGElement methods
238238
239239/* virtual */
240- gfxMatrix SVGViewportElement::PrependLocalTransformsTo (
241- const gfxMatrix& aMatrix, SVGTransformTypes aWhich) const {
242- gfxMatrix childToUser;
243-
240+ gfxMatrix SVGViewportElement::ChildToUserSpaceTransform () const {
241+ auto viewBox = GetViewBoxTransform ();
244242 if (IsInner ()) {
245243 float x, y;
246244 const_cast <SVGViewportElement*>(this )->GetAnimatedLengthValues (&x, &y,
247245 nullptr );
248- childToUser = ThebesMatrix (GetViewBoxTransform ().PostTranslate (x, y));
249- } else if (IsRootSVGSVGElement ()) {
246+ return ThebesMatrix (viewBox.PostTranslate (x, y));
247+ }
248+ if (IsRootSVGSVGElement ()) {
250249 const auto * svg = static_cast <const SVGSVGElement*>(this );
251250 const SVGPoint& translate = svg->GetCurrentTranslate ();
252251 float scale = svg->CurrentScale ();
253- childToUser =
254- ThebesMatrix (GetViewBoxTransform ()
255- .PostScale (scale, scale)
256- .PostTranslate (translate.GetX (), translate.GetY ()));
257- } else {
258- // outer-<svg>, but inline in some other content:
259- childToUser = ThebesMatrix (GetViewBoxTransform ());
252+ return ThebesMatrix (viewBox.PostScale (scale, scale)
253+ .PostTranslate (translate.GetX (), translate.GetY ()));
260254 }
261-
262- MOZ_ASSERT (aWhich == eAllTransforms || aWhich == eChildToUserSpace,
263- " Unknown TransformTypes" );
264- return childToUser * aMatrix;
255+ // outer-<svg>, but inline in some other content:
256+ return ThebesMatrix (viewBox);
265257}
266258
267259/* virtual */
0 commit comments