Index: third_party/WebKit/Source/core/css/CSSURIValue.cpp |
diff --git a/third_party/WebKit/Source/core/css/CSSURIValue.cpp b/third_party/WebKit/Source/core/css/CSSURIValue.cpp |
index 6c47f36e3e887074207a487f90f227e82718cfcf..23ac0f5107e23c8c96e71581d75403799224b9e1 100644 |
--- a/third_party/WebKit/Source/core/css/CSSURIValue.cpp |
+++ b/third_party/WebKit/Source/core/css/CSSURIValue.cpp |
@@ -6,28 +6,28 @@ |
#include "core/css/CSSMarkup.h" |
#include "core/dom/Document.h" |
-#include "core/fetch/FetchInitiatorTypeNames.h" |
-#include "core/fetch/FetchRequest.h" |
-#include "core/fetch/ResourceFetcher.h" |
-#include "wtf/text/WTFString.h" |
+#include "core/svg/SVGElementProxy.h" |
+#include "core/svg/SVGURIReference.h" |
namespace blink { |
CSSURIValue::CSSURIValue(const String& urlString) |
- : CSSValue(URIClass), m_url(urlString), m_loadRequested(false) {} |
+ : CSSValue(URIClass), m_url(urlString) {} |
CSSURIValue::~CSSURIValue() {} |
-DocumentResource* CSSURIValue::load(Document& document) const { |
- if (!m_loadRequested) { |
- m_loadRequested = true; |
- |
- FetchRequest request(ResourceRequest(document.completeURL(m_url)), |
- FetchInitiatorTypeNames::css); |
- m_document = |
- DocumentResource::fetchSVGDocument(request, document.fetcher()); |
+SVGElementProxy& CSSURIValue::ensureElementProxy(Document& document) const { |
+ if (m_proxy) |
+ return *m_proxy; |
+ SVGURLReferenceResolver resolver(m_url, document); |
+ AtomicString fragmentId = resolver.fragmentIdentifier(); |
+ if (resolver.isLocal()) { |
+ m_proxy = SVGElementProxy::create(fragmentId); |
+ } else { |
+ m_proxy = |
+ SVGElementProxy::create(resolver.absoluteUrl().getString(), fragmentId); |
} |
- return m_document; |
+ return *m_proxy; |
} |
String CSSURIValue::customCSSText() const { |
@@ -39,7 +39,7 @@ bool CSSURIValue::equals(const CSSURIValue& other) const { |
} |
DEFINE_TRACE_AFTER_DISPATCH(CSSURIValue) { |
- visitor->trace(m_document); |
+ visitor->trace(m_proxy); |
CSSValue::traceAfterDispatch(visitor); |
} |