1212#include " nsISVGChildFrame.h"
1313#include " nsRenderingContext.h"
1414#include " nsSVGContainerFrame.h"
15+ #include " nsSVGEffects.h"
1516#include " nsSVGIntegrationUtils.h"
1617#include " mozilla/dom/SVGSVGElement.h"
1718
@@ -172,7 +173,7 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
172173
173174 if (aAttribute == nsGkAtoms::width ||
174175 aAttribute == nsGkAtoms::height) {
175- nsSVGUtils::InvalidateBounds (this , false );
176+ nsSVGEffects::InvalidateRenderingObservers (this );
176177 nsSVGUtils::ScheduleReflowSVG (this );
177178
178179 if (content->HasViewBoxOrSyntheticViewBox ()) {
@@ -197,16 +198,21 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
197198 // make sure our cached transform matrix gets (lazily) updated
198199 mCanvasTM = nullptr ;
199200
200- nsSVGUtils::InvalidateBounds (this , false );
201- nsSVGUtils::ScheduleReflowSVG (this );
202-
203201 nsSVGUtils::NotifyChildrenOfSVGChange (
204202 this , aAttribute == nsGkAtoms::viewBox ?
205203 TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED );
206204
207- if (aAttribute == nsGkAtoms::viewBox ||
208- (aAttribute == nsGkAtoms::preserveAspectRatio &&
209- content->HasViewBoxOrSyntheticViewBox ())) {
205+ if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
206+ nsSVGEffects::InvalidateRenderingObservers (this );
207+ nsSVGUtils::ScheduleReflowSVG (this );
208+ } else if (aAttribute == nsGkAtoms::transform) {
209+ nsSVGUtils::InvalidateBounds (this , false );
210+ nsSVGUtils::ScheduleReflowSVG (this );
211+ } else if (aAttribute == nsGkAtoms::viewBox ||
212+ (aAttribute == nsGkAtoms::preserveAspectRatio &&
213+ content->HasViewBoxOrSyntheticViewBox ())) {
214+ nsSVGUtils::InvalidateBounds (this , false );
215+ nsSVGUtils::ScheduleReflowSVG (this );
210216 content->ChildrenOnlyTransformChanged ();
211217 }
212218 }
0 commit comments