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

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

Issue 1681553002: Add support for 'href' (w/o XLink NS) for various SVG elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; update comment Created 4 years, 10 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 b676bd33a1b6a394bf5786108b4f210598539907..4653189df74101d1862cfa08e07e2a1298d1bae9 100644
--- a/third_party/WebKit/Source/core/svg/SVGURIReference.h
+++ b/third_party/WebKit/Source/core/svg/SVGURIReference.h
@@ -23,7 +23,7 @@
#include "core/CoreExport.h"
#include "core/dom/Document.h"
-#include "core/svg/SVGAnimatedString.h"
+#include "core/svg/SVGAnimatedHref.h"
#include "platform/heap/Handle.h"
namespace blink {
@@ -36,6 +36,15 @@ public:
bool isKnownAttribute(const QualifiedName&);
+ // Use this for accesses to 'href' or 'xlink:href' (in that order) for
+ // elements where both are allowed and don't necessarily inherit from
+ // SVGURIReference.
+ static const AtomicString& legacyHrefString(const SVGElement&);
+
+ // Like above, but for elements that inherit from SVGURIReference. Resolves
+ // against the base URL of the passed Document.
+ KURL legacyHrefURL(const Document&) const;
+
static AtomicString fragmentIdentifierFromIRIString(const String&, const TreeScope&);
static Element* targetElementFromIRIString(const String&, const TreeScope&, AtomicString* = 0, Document* = 0);
@@ -54,7 +63,7 @@ public:
const String& hrefString() const { return m_href->currentValue()->value(); }
// JS API
- SVGAnimatedString* href() const { return m_href.get(); }
+ SVGAnimatedHref* href() const { return m_href.get(); }
DECLARE_VIRTUAL_TRACE();
@@ -62,7 +71,7 @@ protected:
explicit SVGURIReference(SVGElement*);
private:
- RefPtrWillBeMember<SVGAnimatedString> m_href;
+ RefPtrWillBeMember<SVGAnimatedHref> m_href;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGURIReference.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698