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