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

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

Issue 2173453002: Resolve URL/target reference at a single point in SVGUseElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test touchups 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/SVGURIReference.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
index 973875962429bae6f0dfdeadcabeb3e537b8cf0e..64fd240732119346f16d22c97426f888d9ad5cff 100644
--- a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
@@ -66,28 +66,16 @@ AtomicString SVGURIReference::fragmentIdentifierFromIRIString(const String& urlS
return AtomicString(url.fragmentIdentifier());
}
-Element* SVGURIReference::targetElementFromIRIString(const String& urlString, const TreeScope& treeScope, AtomicString* fragmentIdentifier, Document* externalDocument)
+Element* SVGURIReference::targetElementFromIRIString(const String& urlString, const TreeScope& treeScope, AtomicString* fragmentIdentifier)
{
const Document& document = treeScope.document();
KURL url = document.completeURL(urlString);
- if (!url.hasFragmentIdentifier())
+ if (!url.hasFragmentIdentifier() || !equalIgnoringFragmentIdentifier(url, document.url()))
return nullptr;
-
AtomicString id(url.fragmentIdentifier());
if (fragmentIdentifier)
*fragmentIdentifier = id;
-
- if (externalDocument) {
- // Enforce that the referenced url matches the url of the document that we've loaded for it!
- ASSERT(equalIgnoringFragmentIdentifier(url, externalDocument->url()));
- return externalDocument->getElementById(id);
- }
-
- // Exit early if the referenced url is external, and we have no externalDocument given.
- if (!equalIgnoringFragmentIdentifier(url, document.url()))
- return nullptr;
-
return treeScope.getElementById(id);
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGURIReference.h ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698