Chromium Code Reviews| 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..9785dfb2b0d1974d9aca2d2d0c87ff609079f843 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::createElementProxy(Document& document) const { |
|
esprehn
2016/10/25 01:18:42
ensureElementProxy, this returns the same value ev
fs
2016/10/25 15:00:53
Sure, done.
|
| + 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); |
| } |