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

Unified Diff: Source/core/css/CSSImageValue.h

Issue 164803002: Handle CSSImageValue URLs in inline styles in templates correctly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed template usage Created 6 years, 10 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: Source/core/css/CSSImageValue.h
diff --git a/Source/core/css/CSSImageValue.h b/Source/core/css/CSSImageValue.h
index 18e57f4f26ea6bc966d17ce7052c557c395f9934..2bc8cf06739ab7d42cd3059f5430e7f995ed9850 100644
--- a/Source/core/css/CSSImageValue.h
+++ b/Source/core/css/CSSImageValue.h
@@ -27,6 +27,7 @@
namespace WebCore {
+class Document;
class Element;
class KURL;
class StyleFetchedImage;
@@ -35,13 +36,13 @@ class RenderObject;
class CSSImageValue : public CSSValue {
public:
- static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url)
+ static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleImage* image = 0)
{
- return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url));
+ return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url, url, image));
}
- static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleImage* image)
+ static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleImage* image = 0)
{
- return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url, image));
+ return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(rawValue, url, image));
}
~CSSImageValue();
@@ -50,7 +51,9 @@ public:
// Returns a StyleFetchedImage if the image is cached already, otherwise a StylePendingImage.
StyleImage* cachedOrPendingImage();
- const String& url() { return m_url; }
+ const String& url() { return m_absoluteURL; }
+
+ void reResolveURL(const Document&);
String customCSSText() const;
@@ -67,10 +70,10 @@ public:
void traceAfterDispatch(Visitor*);
private:
- explicit CSSImageValue(const KURL&);
- CSSImageValue(const KURL&, StyleImage*);
+ CSSImageValue(const String& rawValue, const KURL&, StyleImage*);
- String m_url;
+ String m_relativeURL;
+ String m_absoluteURL;
RefPtr<StyleImage> m_image;
bool m_accessedImage;
AtomicString m_initiatorName;
« no previous file with comments | « LayoutTests/fast/css/resolve-inline-style-url-on-adopt-expected.html ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698