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

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: Remove isExternal...; add additional test 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fe8395d9c685a788366f03faa7439430b2ec6fff 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -184,16 +184,21 @@ void SVGUseElement::collectStyleForPresentationAttribute(const QualifiedName& na
SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
}
+bool SVGUseElement::isStructurallyExternal() const
+{
+ return !m_elementIdentifierIsLocal;
+}
+
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;
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698