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

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

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.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
index 941d9f418491669af8856ede28ccf66fbc08783c..1f22221c0edf1d77c8640d4d86e77959bdf5268c 100644
--- a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
@@ -21,16 +21,17 @@
#include "core/svg/SVGURIReference.h"
#include "core/XLinkNames.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "core/svg/SVGElement.h"
#include "platform/weborigin/KURL.h"
namespace blink {
SVGURIReference::SVGURIReference(SVGElement* element)
- : m_href(SVGAnimatedString::create(element, XLinkNames::hrefAttr, SVGString::create()))
+ : m_href(SVGAnimatedHref::create(element))
{
ASSERT(element);
- element->addToPropertyMap(m_href);
+ m_href->addToPropertyMap(element);
}
DEFINE_TRACE(SVGURIReference)
@@ -40,7 +41,19 @@ DEFINE_TRACE(SVGURIReference)
bool SVGURIReference::isKnownAttribute(const QualifiedName& attrName)
{
- return attrName.matches(XLinkNames::hrefAttr);
+ return SVGAnimatedHref::isKnownAttribute(attrName);
+}
+
+const AtomicString& SVGURIReference::legacyHrefString(const SVGElement& element)
+{
+ if (element.hasAttribute(SVGNames::hrefAttr))
+ return element.getAttribute(SVGNames::hrefAttr);
+ return element.getAttribute(XLinkNames::hrefAttr);
+}
+
+KURL SVGURIReference::legacyHrefURL(const Document& document) const
+{
+ return document.completeURL(stripLeadingAndTrailingHTMLSpaces(hrefString()));
}
AtomicString SVGURIReference::fragmentIdentifierFromIRIString(const String& url, const TreeScope& treeScope)
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGURIReference.h ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698