Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2174833002: Make fragment-only URLs always be document-local references (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index ca7d9571a75eccc6cc91bcecf7002f44c747269f..da6e03c65f057c4feb091c871a877def9c085c6b 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -186,14 +186,14 @@ void SVGUseElement::collectStyleForPresentationAttribute(const QualifiedName& na
void SVGUseElement::updateTargetReference()
{
- KURL resolvedUrl = document().completeURL(hrefString());
- m_elementIdentifier = AtomicString(resolvedUrl.fragmentIdentifier());
- m_elementIdentifierIsLocal = resolvedUrl.isNull()
- || equalIgnoringFragmentIdentifier(resolvedUrl, document().url());
+ SVGURLReferenceResolver resolver(hrefString(), document());
+ m_elementIdentifier = resolver.fragmentIdentifier();
+ m_elementIdentifierIsLocal = resolver.isLocal();
if (m_elementIdentifierIsLocal) {
setDocumentResource(nullptr);
return;
}
+ KURL resolvedUrl = resolver.absoluteUrl();
if (m_elementIdentifier.isEmpty()
|| (m_resource && equalIgnoringFragmentIdentifier(resolvedUrl, m_resource->url())))
return;

Powered by Google App Engine
This is Rietveld 408576698