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

Unified Diff: third_party/WebKit/Source/core/css/CSSURIValue.cpp

Issue 2165833006: Merge CSSSVGDocumentValue with CSSURIValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup FilterInterpolationFunctions Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSURIValue.h ('k') | third_party/WebKit/Source/core/css/CSSValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSURIValue.h ('k') | third_party/WebKit/Source/core/css/CSSValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698