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

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

Issue 2401343002: Tracking filter mutation via SVGElementProxy (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/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);
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSURIValue.h ('k') | third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698