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

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

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/SVGURIReference.h
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.h b/third_party/WebKit/Source/core/svg/SVGURIReference.h
index 97248ec0c9c9b00a9e88cd16a08ff514fdc8050e..4f2b706858d99fe0e38a627a800034ebac8bb33b 100644
--- a/third_party/WebKit/Source/core/svg/SVGURIReference.h
+++ b/third_party/WebKit/Source/core/svg/SVGURIReference.h
@@ -74,6 +74,24 @@ private:
Member<SVGAnimatedHref> m_href;
};
+// Helper class used to resolve fragment references. Handles the 'local url
+// flag' per https://drafts.csswg.org/css-values/#local-urls .
pdr. 2016/07/22 19:18:28 Can you add a test (maybe like http/tests/misc/inp
fs 2016/07/22 21:15:03 Done.
+class SVGURLReferenceResolver {
pdr. 2016/07/22 19:18:28 I'm wondering if this belongs in SVG or somewhere
pdr. 2016/07/22 20:02:31 Answering my own question, image maps don't use th
fs 2016/07/22 21:15:02 The spec is for CSS values, and subsequently refer
+ STACK_ALLOCATED();
+public:
+ SVGURLReferenceResolver(const String& urlString, const Document&);
+
+ bool isLocal() const;
pdr. 2016/07/22 19:18:28 Can you update isExternalURIReference to use this
fs 2016/07/22 21:15:02 Yes, that's a good point. isExternalURIReference o
+ KURL absoluteUrl() const;
+ AtomicString fragmentIdentifier() const;
+
+private:
+ const String& m_relativeUrl;
+ Member<const Document> m_document;
+ mutable KURL m_absoluteUrl;
+ bool m_isLocal;
+};
+
} // namespace blink
#endif // SVGURIReference_h

Powered by Google App Engine
This is Rietveld 408576698