summaryrefslogtreecommitdiffstats
path: root/dom/svg/SVGUseElement.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-05 01:47:58 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-05 01:47:58 +0200
commit246edb5332e3d1415a4949a76e09ff951d5e497d (patch)
treee99e88aa10d8ce3319d58c46d11984644b29e95c /dom/svg/SVGUseElement.cpp
parentd314fcbcc836ab355ce4268083d3dd8df6f33877 (diff)
downloadUXP-246edb5332e3d1415a4949a76e09ff951d5e497d.tar
UXP-246edb5332e3d1415a4949a76e09ff951d5e497d.tar.gz
UXP-246edb5332e3d1415a4949a76e09ff951d5e497d.tar.lz
UXP-246edb5332e3d1415a4949a76e09ff951d5e497d.tar.xz
UXP-246edb5332e3d1415a4949a76e09ff951d5e497d.zip
Part 3. Resolve local-ref in SVGUseElement::LookupHref by nsSVGEffects::GetBaseURLForLocalRef.
Diffstat (limited to 'dom/svg/SVGUseElement.cpp')
-rw-r--r--dom/svg/SVGUseElement.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/dom/svg/SVGUseElement.cpp b/dom/svg/SVGUseElement.cpp
index 4911e2cac..9212ab1aa 100644
--- a/dom/svg/SVGUseElement.cpp
+++ b/dom/svg/SVGUseElement.cpp
@@ -15,6 +15,7 @@
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
#include "nsIURI.h"
+#include "nsSVGEffects.h"
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Use)
@@ -418,11 +419,15 @@ SVGUseElement::LookupHref()
return;
}
+ nsCOMPtr<nsIURI> originURI =
+ mOriginal ? mOriginal->GetBaseURI() : GetBaseURI();
+ nsCOMPtr<nsIURI> baseURI = nsContentUtils::IsLocalRefURL(href)
+ ? nsSVGEffects::GetBaseURLForLocalRef(this, originURI)
+ : originURI;
+
nsCOMPtr<nsIURI> targetURI;
- nsCOMPtr<nsIURI> baseURI = mOriginal ? mOriginal->GetBaseURI() : GetBaseURI();
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), href,
GetComposedDoc(), baseURI);
-
mSource.Reset(this, targetURI);
}