From 9d6972ff7418cc04eca795aec215777db5a4efb9 Mon Sep 17 00:00:00 2001 From: longsonr Date: Wed, 16 Apr 2025 14:05:19 +0000 Subject: [PATCH] Bug 1960687 - clear cached path on zoom r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D245684 --- layout/svg/SVGGeometryFrame.cpp | 3 +- .../svg/path/reftests/path-zoom-ref.html | 22 +++++++++++++ .../tests/svg/path/reftests/path-zoom.html | 33 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 testing/web-platform/tests/svg/path/reftests/path-zoom-ref.html create mode 100644 testing/web-platform/tests/svg/path/reftests/path-zoom.html diff --git a/layout/svg/SVGGeometryFrame.cpp b/layout/svg/SVGGeometryFrame.cpp index 64e93e49c28e..29cb1816e153 100644 --- a/layout/svg/SVGGeometryFrame.cpp +++ b/layout/svg/SVGGeometryFrame.cpp @@ -121,7 +121,8 @@ void SVGGeometryFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { NotifySVGChanged(TRANSFORM_CHANGED); } - if (element->IsGeometryChangedViaCSS(*Style(), *aOldComputedStyle)) { + if (element->IsGeometryChangedViaCSS(*Style(), *aOldComputedStyle) || + aOldComputedStyle->EffectiveZoom() != Style()->EffectiveZoom()) { element->ClearAnyCachedPath(); SVGObserverUtils::InvalidateRenderingObservers(this); } diff --git a/testing/web-platform/tests/svg/path/reftests/path-zoom-ref.html b/testing/web-platform/tests/svg/path/reftests/path-zoom-ref.html new file mode 100644 index 000000000000..4b09749e2c2b --- /dev/null +++ b/testing/web-platform/tests/svg/path/reftests/path-zoom-ref.html @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/reftests/path-zoom.html b/testing/web-platform/tests/svg/path/reftests/path-zoom.html new file mode 100644 index 000000000000..281124334a2f --- /dev/null +++ b/testing/web-platform/tests/svg/path/reftests/path-zoom.html @@ -0,0 +1,33 @@ + + +Test of dynamic zoom on path. + + + + + + + + + + + +