diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-05 01:47:58 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-05 01:47:58 +0200 |
commit | 246edb5332e3d1415a4949a76e09ff951d5e497d (patch) | |
tree | e99e88aa10d8ce3319d58c46d11984644b29e95c /dom | |
parent | d314fcbcc836ab355ce4268083d3dd8df6f33877 (diff) | |
download | UXP-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')
-rw-r--r-- | dom/svg/SVGUseElement.cpp | 9 |
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); } |