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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return m_image.get(); | 64 return m_image.get(); |
65 } | 65 } |
66 | 66 |
67 StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader) | 67 StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader) |
68 { | 68 { |
69 ASSERT(loader); | 69 ASSERT(loader); |
70 | 70 |
71 if (!m_accessedImage) { | 71 if (!m_accessedImage) { |
72 m_accessedImage = true; | 72 m_accessedImage = true; |
73 | 73 |
74 CachedResourceRequest request(ResourceRequest(loader->document()->comple
teURL(m_url))); | 74 CachedResourceRequest request(ResourceRequest(loader->document()->comple
teURL(m_url)), m_initiatorName.isEmpty() ? cachedResourceRequestInitiators().css
: m_initiatorName); |
75 if (m_initiatorName.isEmpty()) | |
76 request.setInitiator(cachedResourceRequestInitiators().css); | |
77 else | |
78 request.setInitiator(m_initiatorName); | |
79 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage
(request)) | 75 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage
(request)) |
80 m_image = StyleCachedImage::create(cachedImage.get()); | 76 m_image = StyleCachedImage::create(cachedImage.get()); |
81 } | 77 } |
82 | 78 |
83 return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*
>(m_image.get()) : 0; | 79 return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*
>(m_image.get()) : 0; |
84 } | 80 } |
85 | 81 |
86 bool CSSImageValue::hasFailedOrCanceledSubresources() const | 82 bool CSSImageValue::hasFailedOrCanceledSubresources() const |
87 { | 83 { |
88 if (!m_image || !m_image->isCachedImage()) | 84 if (!m_image || !m_image->isCachedImage()) |
(...skipping 28 matching lines...) Expand all Loading... |
117 info.addMember(m_url, "url"); | 113 info.addMember(m_url, "url"); |
118 // No need to report m_image as it is counted as part of RenderArena. | 114 // No need to report m_image as it is counted as part of RenderArena. |
119 } | 115 } |
120 | 116 |
121 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const | 117 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const |
122 { | 118 { |
123 return m_image ? m_image->knownToBeOpaque(renderer) : false; | 119 return m_image ? m_image->knownToBeOpaque(renderer) : false; |
124 } | 120 } |
125 | 121 |
126 } // namespace WebCore | 122 } // namespace WebCore |
OLD | NEW |