diff --git a/layout/reftests/svg/dynamic-use-06.svg b/layout/reftests/svg/dynamic-use-06.svg
new file mode 100644
index 00000000000..c2f6b05a89b
--- /dev/null
+++ b/layout/reftests/svg/dynamic-use-06.svg
@@ -0,0 +1,33 @@
+
+
diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list
index 1910c925e4d..b692e13ad87 100644
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -107,6 +107,7 @@ random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == dynamic-text-04.svg dyna
== dynamic-use-03.svg pass.svg
== dynamic-use-04.svg pass.svg
== dynamic-use-05.svg pass.svg
+== dynamic-use-06.svg pass.svg
random == dynamic-use-nested-01.svg dynamic-use-nested-01-ref.svg # bug 467498
== dynamic-use-remove-width.svg dynamic-use-remove-width-ref.svg
== linked-pattern-01.svg pass.svg
diff --git a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp
index b1c9f0dc7dc..908906b8922 100644
--- a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp
@@ -408,10 +408,16 @@ nsSVGForeignObjectFrame::NotifySVGChanged(PRUint32 aFlags)
}
} else if (aFlags & COORD_CONTEXT_CHANGED) {
- // Our coordinate context's width/height has changed. If we have a
- // percentage width/height our dimensions will change so we must reflow.
nsSVGForeignObjectElement *fO =
static_cast(mContent);
+ // Coordinate context changes affect mCanvasTM if we have a
+ // percentage 'x' or 'y'
+ if (fO->mLengthAttributes[nsSVGForeignObjectElement::X].IsPercentage() ||
+ fO->mLengthAttributes[nsSVGForeignObjectElement::Y].IsPercentage()) {
+ mCanvasTM = nsnull;
+ }
+ // Our coordinate context's width/height has changed. If we have a
+ // percentage width/height our dimensions will change so we must reflow.
if (fO->mLengthAttributes[nsSVGForeignObjectElement::WIDTH].IsPercentage() ||
fO->mLengthAttributes[nsSVGForeignObjectElement::HEIGHT].IsPercentage()) {
reflow = true;
diff --git a/layout/svg/base/src/nsSVGUseFrame.cpp b/layout/svg/base/src/nsSVGUseFrame.cpp
index 96e3263a0b5..698aedd43ee 100644
--- a/layout/svg/base/src/nsSVGUseFrame.cpp
+++ b/layout/svg/base/src/nsSVGUseFrame.cpp
@@ -87,6 +87,9 @@ public:
}
#endif
+ // nsISVGChildFrame interface:
+ virtual void NotifySVGChanged(PRUint32 aFlags);
+
// nsIAnonymousContentCreator
virtual nsresult CreateAnonymousContent(nsTArray& aElements);
virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
@@ -177,6 +180,26 @@ nsSVGUseFrame::IsLeaf() const
}
+//----------------------------------------------------------------------
+// nsISVGChildFrame methods
+
+void
+nsSVGUseFrame::NotifySVGChanged(PRUint32 aFlags)
+{
+ if (aFlags & COORD_CONTEXT_CHANGED &&
+ !(aFlags & TRANSFORM_CHANGED)) {
+ // Coordinate context changes affect mCanvasTM if we have a
+ // percentage 'x' or 'y'
+ nsSVGUseElement *use = static_cast(mContent);
+ if (use->mLengthAttributes[nsSVGUseElement::X].IsPercentage() ||
+ use->mLengthAttributes[nsSVGUseElement::Y].IsPercentage()) {
+ aFlags |= TRANSFORM_CHANGED;
+ }
+ }
+
+ nsSVGUseFrameBase::NotifySVGChanged(aFlags);
+}
+
//----------------------------------------------------------------------
// nsIAnonymousContentCreator methods: