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

Unified Diff: Source/core/dom/Element.cpp

Issue 1308953009: Move Image ownership out of CSSValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « Source/core/css/resolver/StyleResourceLoader.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index ba5c7821706e1435499ee6ffa341c677a4bd57d5..1fc9c291b0ba70c35771307da9dca4a96a9da3c6 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -3104,8 +3104,15 @@ static void reResolveURLsInInlineStyle(const Document& document, MutableStylePro
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);
+ if (property.value()->isImageValue()) {
+ const CSSImageValue& image = toCSSImageValue(*property.value());
+ String relativeUrl = image.relativeUrl();
+ String absoluteUrl = image.url();
+ if (document.completeURL(relativeUrl) == absoluteUrl)
+ continue;
+ style.removeProperty(property.id());
+ style.setProperty(property.id(), CSSImageValue::create(relativeUrl, absoluteUrl));
+ }
}
}
« no previous file with comments | « Source/core/css/resolver/StyleResourceLoader.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698