| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 class Document; | 32 class Document; |
| 33 class KURL; | 33 class KURL; |
| 34 class StyleFetchedImage; | 34 class StyleFetchedImage; |
| 35 class StyleImage; | 35 class StyleImage; |
| 36 class LayoutObject; | 36 class LayoutObject; |
| 37 | 37 |
| 38 class CORE_EXPORT CSSImageValue : public CSSValue { | 38 class CORE_EXPORT CSSImageValue : public CSSValue { |
| 39 public: | 39 public: |
| 40 static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleFe
tchedImage* image = 0) | 40 static RawPtr<CSSImageValue> create(const KURL& url, StyleFetchedImage* imag
e = 0) |
| 41 { | 41 { |
| 42 return create(url.string(), url, image); | 42 return create(url.string(), url, image); |
| 43 } | 43 } |
| 44 static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& rawValue,
const KURL& url, StyleFetchedImage* image = 0) | 44 static RawPtr<CSSImageValue> create(const String& rawValue, const KURL& url,
StyleFetchedImage* image = 0) |
| 45 { | 45 { |
| 46 return create(AtomicString(rawValue), url, image); | 46 return create(AtomicString(rawValue), url, image); |
| 47 } | 47 } |
| 48 static PassRefPtrWillBeRawPtr<CSSImageValue> create(const AtomicString& rawV
alue, const KURL& url, StyleFetchedImage* image = 0) | 48 static RawPtr<CSSImageValue> create(const AtomicString& rawValue, const KURL
& url, StyleFetchedImage* image = 0) |
| 49 { | 49 { |
| 50 return adoptRefWillBeNoop(new CSSImageValue(rawValue, url, image)); | 50 return (new CSSImageValue(rawValue, url, image)); |
| 51 } | 51 } |
| 52 static PassRefPtrWillBeRawPtr<CSSImageValue> create(const AtomicString& abso
luteURL) | 52 static RawPtr<CSSImageValue> create(const AtomicString& absoluteURL) |
| 53 { | 53 { |
| 54 return adoptRefWillBeNoop(new CSSImageValue(absoluteURL)); | 54 return (new CSSImageValue(absoluteURL)); |
| 55 } | 55 } |
| 56 ~CSSImageValue(); | 56 ~CSSImageValue(); |
| 57 | 57 |
| 58 bool isCachePending() const { return m_isCachePending; } | 58 bool isCachePending() const { return m_isCachePending; } |
| 59 StyleFetchedImage* cachedImage() const { ASSERT(!isCachePending()); return m
_cachedImage.get(); } | 59 StyleFetchedImage* cachedImage() const { ASSERT(!isCachePending()); return m
_cachedImage.get(); } |
| 60 StyleFetchedImage* cacheImage(Document*, CrossOriginAttributeValue = CrossOr
iginAttributeNotSet); | 60 StyleFetchedImage* cacheImage(Document*, CrossOriginAttributeValue = CrossOr
iginAttributeNotSet); |
| 61 | 61 |
| 62 const String& url() const { return m_absoluteURL; } | 62 const String& url() const { return m_absoluteURL; } |
| 63 | 63 |
| 64 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | 64 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
| 65 const Referrer& referrer() const { return m_referrer; } | 65 const Referrer& referrer() const { return m_referrer; } |
| 66 | 66 |
| 67 void reResolveURL(const Document&); | 67 void reResolveURL(const Document&); |
| 68 | 68 |
| 69 String customCSSText() const; | 69 String customCSSText() const; |
| 70 | 70 |
| 71 bool hasFailedOrCanceledSubresources() const; | 71 bool hasFailedOrCanceledSubresources() const; |
| 72 | 72 |
| 73 bool equals(const CSSImageValue&) const; | 73 bool equals(const CSSImageValue&) const; |
| 74 | 74 |
| 75 bool knownToBeOpaque(const LayoutObject*) const; | 75 bool knownToBeOpaque(const LayoutObject*) const; |
| 76 | 76 |
| 77 PassRefPtrWillBeRawPtr<CSSImageValue> valueWithURLMadeAbsolute() | 77 RawPtr<CSSImageValue> valueWithURLMadeAbsolute() |
| 78 { | 78 { |
| 79 return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get())
; | 79 return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get())
; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void setInitiator(const AtomicString& name) { m_initiatorName = name; } | 82 void setInitiator(const AtomicString& name) { m_initiatorName = name; } |
| 83 | 83 |
| 84 DECLARE_TRACE_AFTER_DISPATCH(); | 84 DECLARE_TRACE_AFTER_DISPATCH(); |
| 85 void restoreCachedResourceIfNeeded(Document&) const; | 85 void restoreCachedResourceIfNeeded(Document&) const; |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 CSSImageValue(const AtomicString& rawValue, const KURL&, StyleFetchedImage*)
; | 88 CSSImageValue(const AtomicString& rawValue, const KURL&, StyleFetchedImage*)
; |
| 89 CSSImageValue(const AtomicString& absoluteURL); | 89 CSSImageValue(const AtomicString& absoluteURL); |
| 90 | 90 |
| 91 AtomicString m_relativeURL; | 91 AtomicString m_relativeURL; |
| 92 AtomicString m_absoluteURL; | 92 AtomicString m_absoluteURL; |
| 93 Referrer m_referrer; | 93 Referrer m_referrer; |
| 94 bool m_isCachePending; | 94 bool m_isCachePending; |
| 95 RefPtrWillBeMember<StyleFetchedImage> m_cachedImage; | 95 Member<StyleFetchedImage> m_cachedImage; |
| 96 AtomicString m_initiatorName; | 96 AtomicString m_initiatorName; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue()); | 99 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue()); |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| 102 | 102 |
| 103 #endif // CSSImageValue_h | 103 #endif // CSSImageValue_h |
| OLD | NEW |