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

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

Issue 2625873010: Resolve CSS url(...) non-<image> values against the correct base (Closed)
Patch Set: Rebase Created 3 years, 11 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/CSSValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueList.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/CSSValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSValue.cpp b/third_party/WebKit/Source/core/css/CSSValue.cpp
index 4401b1139785f9b9762d31e59493acb0af7729db..257b780be4f4014a7c4b12625a6359c9b9a9bd31 100644
--- a/third_party/WebKit/Source/core/css/CSSValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSValue.cpp
@@ -112,6 +112,28 @@ bool CSSValue::hasFailedOrCanceledSubresources() const {
return false;
}
+bool CSSValue::mayContainUrl() const {
+ if (isValueList())
+ return toCSSValueList(*this).mayContainUrl();
+ return isImageValue() || isURIValue();
+}
+
+void CSSValue::reResolveUrl(const Document& document) const {
+ // TODO(fs): Should handle all values that can contain URLs.
+ if (isImageValue()) {
+ toCSSImageValue(*this).reResolveURL(document);
+ return;
+ }
+ if (isURIValue()) {
+ toCSSURIValue(*this).reResolveUrl(document);
+ return;
+ }
+ if (isValueList()) {
+ toCSSValueList(*this).reResolveUrl(document);
+ return;
+ }
+}
+
template <class ChildClassType>
inline static bool compareCSSValues(const CSSValue& first,
const CSSValue& second) {
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698