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 b9a388f1b7d5c94ce06ec41eb843ea54496af926..c885a023d08dec32a07bec6b1c0dc73d4a851de5 100644 |
--- a/third_party/WebKit/Source/core/css/CSSURIValue.cpp |
+++ b/third_party/WebKit/Source/core/css/CSSURIValue.cpp |
@@ -5,21 +5,49 @@ |
#include "core/css/CSSURIValue.h" |
#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" |
namespace blink { |
-CSSURIValue::CSSURIValue(const String& str) |
+CSSURIValue::CSSURIValue(const String& urlString) |
: CSSValue(URIClass) |
- , m_string(str) { } |
+ , m_url(urlString) |
+ , m_loadRequested(false) |
+{ |
+} |
+ |
+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()); |
+ } |
+ return m_document; |
+} |
String CSSURIValue::customCSSText() const |
{ |
- return serializeURI(m_string); |
+ return serializeURI(m_url); |
+} |
+ |
+bool CSSURIValue::equals(const CSSURIValue& other) const |
+{ |
+ return m_url == other.m_url; |
} |
DEFINE_TRACE_AFTER_DISPATCH(CSSURIValue) |
{ |
+ visitor->trace(m_document); |
CSSValue::traceAfterDispatch(visitor); |
} |