| 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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 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 28 matching lines...) Expand all Loading... |
| 39 , m_absoluteURL(url.string()) | 39 , m_absoluteURL(url.string()) |
| 40 , m_isCachePending(!image) | 40 , m_isCachePending(!image) |
| 41 , m_cachedImage(image) | 41 , m_cachedImage(image) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 CSSImageValue::~CSSImageValue() | 45 CSSImageValue::~CSSImageValue() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 StyleFetchedImage* CSSImageValue::cachedImage() const |
| 50 { |
| 51 ASSERT(!isCachePending()); |
| 52 return m_cachedImage.get(); |
| 53 } |
| 54 |
| 49 StyleFetchedImage* CSSImageValue::cacheImage(Document* document, const ResourceL
oaderOptions& options) | 55 StyleFetchedImage* CSSImageValue::cacheImage(Document* document, const ResourceL
oaderOptions& options) |
| 50 { | 56 { |
| 51 ASSERT(document); | 57 ASSERT(document); |
| 52 | 58 |
| 53 if (m_isCachePending) { | 59 if (m_isCachePending) { |
| 54 m_isCachePending = false; | 60 m_isCachePending = false; |
| 55 | 61 |
| 56 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE
mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options); | 62 FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isE
mpty() ? FetchInitiatorTypeNames::css : m_initiatorName, options); |
| 57 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat
eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); | 63 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat
eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); |
| 58 | 64 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 String CSSImageValue::customCSSText() const | 106 String CSSImageValue::customCSSText() const |
| 101 { | 107 { |
| 102 return serializeURI(m_relativeURL); | 108 return serializeURI(m_relativeURL); |
| 103 } | 109 } |
| 104 | 110 |
| 105 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const | 111 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const |
| 106 { | 112 { |
| 107 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false; | 113 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false; |
| 108 } | 114 } |
| 109 | 115 |
| 116 PassRefPtrWillBeRawPtr<CSSImageValue> CSSImageValue::valueWithURLMadeAbsolute() |
| 117 { |
| 118 return create(KURL(ParsedURLString, m_absoluteURL), m_cachedImage.get()); |
| 119 } |
| 120 |
| 110 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) | 121 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) |
| 111 { | 122 { |
| 112 visitor->trace(m_cachedImage); | 123 visitor->trace(m_cachedImage); |
| 113 CSSValue::traceAfterDispatch(visitor); | 124 CSSValue::traceAfterDispatch(visitor); |
| 114 } | 125 } |
| 115 | 126 |
| 116 void CSSImageValue::reResolveURL(const Document& document) | 127 void CSSImageValue::reResolveURL(const Document& document) |
| 117 { | 128 { |
| 118 KURL url = document.completeURL(m_relativeURL); | 129 KURL url = document.completeURL(m_relativeURL); |
| 119 AtomicString urlString(url.string()); | 130 AtomicString urlString(url.string()); |
| 120 if (urlString == m_absoluteURL) | 131 if (urlString == m_absoluteURL) |
| 121 return; | 132 return; |
| 122 m_absoluteURL = urlString; | 133 m_absoluteURL = urlString; |
| 123 m_isCachePending = true; | 134 m_isCachePending = true; |
| 124 m_cachedImage.clear(); | 135 m_cachedImage.clear(); |
| 125 } | 136 } |
| 126 | 137 |
| 127 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |