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

Unified Diff: third_party/WebKit/Source/core/dom/Element.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
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index d5ea539ee3527b4a3f90bb8e3b32abb76b499bdf..a1efacec6a26704d58062c52dbf598e630cf3fc0 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -40,9 +40,9 @@
#include "core/animation/CustomCompositorAnimations.h"
#include "core/animation/css/CSSAnimations.h"
#include "core/css/CSSIdentifierValue.h"
-#include "core/css/CSSImageValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSStyleSheet.h"
+#include "core/css/CSSValue.h"
#include "core/css/PropertySetCSSStyleDeclaration.h"
#include "core/css/StylePropertySet.h"
#include "core/css/parser/CSSParser.h"
@@ -3606,9 +3606,7 @@ static bool needsURLResolutionForInlineStyle(const Element& element,
if (!style)
return false;
for (unsigned i = 0; i < style->propertyCount(); ++i) {
- // FIXME: Should handle all URL-based properties: CSSImageSetValue,
- // CSSCursorImageValue, etc.
- if (style->propertyAt(i).value().isImageValue())
+ if (style->propertyAt(i).value().mayContainUrl())
return true;
}
return false;
@@ -3617,11 +3615,9 @@ static bool needsURLResolutionForInlineStyle(const Element& element,
static void reResolveURLsInInlineStyle(const Document& document,
MutableStylePropertySet& style) {
for (unsigned i = 0; i < style.propertyCount(); ++i) {
- StylePropertySet::PropertyReference property = style.propertyAt(i);
- // FIXME: Should handle all URL-based properties: CSSImageSetValue,
- // CSSCursorImageValue, etc.
- if (property.value().isImageValue())
- toCSSImageValue(property.value()).reResolveURL(document);
+ const CSSValue& value = style.propertyAt(i).value();
+ if (value.mayContainUrl())
+ value.reResolveUrl(document);
}
}

Powered by Google App Engine
This is Rietveld 408576698