From b0457b955177d309861107364dbb959303a5e8b6 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Wed, 23 Mar 2022 20:28:55 +0000 Subject: [PATCH] Bug 1761007 - Fix sizing of WebRenderized SVG images. r=gfx-reviewers,aosmond The missing line is consistently called after ImageContainer::GetWidth/GetHeight (see TransformContextForPainting for example which would be the equivalent code path for the non-webrenderized case). This fixes the wptest /density-size-correction/density-corrected-image-svg.html when active svg images are enabled. Depends on D141846 Differential Revision: https://phabricator.services.mozilla.com/D141847 --- layout/svg/SVGImageFrame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layout/svg/SVGImageFrame.cpp b/layout/svg/SVGImageFrame.cpp index 3ecc3201d718..89bb92fe6056 100644 --- a/layout/svg/SVGImageFrame.cpp +++ b/layout/svg/SVGImageFrame.cpp @@ -508,6 +508,8 @@ bool SVGImageFrame::CreateWebRenderCommands( return true; } + mImageContainer->GetResolution().ApplyTo(nativeWidth, nativeHeight); + auto preserveAspectRatio = imgElem->mPreserveAspectRatio.GetAnimValue(); uint16_t align = preserveAspectRatio.GetAlign(); uint16_t meetOrSlice = preserveAspectRatio.GetMeetOrSlice();