| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 StyleImage* CSSImageValue::cachedOrPendingImage() | 55 StyleImage* CSSImageValue::cachedOrPendingImage() |
| 56 { | 56 { |
| 57 if (!m_image) | 57 if (!m_image) |
| 58 m_image = StylePendingImage::create(this); | 58 m_image = StylePendingImage::create(this); |
| 59 | 59 |
| 60 return m_image.get(); | 60 return m_image.get(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 StyleFetchedImage* CSSImageValue::cachedImage(ResourceFetcher* loader, const Res
ourceLoaderOptions& options) | 63 StyleFetchedImage* CSSImageValue::cachedImage(ResourceFetcher* fetcher, const Re
sourceLoaderOptions& options, CORSEnabled corsEnabled) |
| 64 { | 64 { |
| 65 ASSERT(loader); | 65 ASSERT(fetcher); |
| 66 | 66 |
| 67 if (!m_accessedImage) { | 67 if (!m_accessedImage) { |
| 68 m_accessedImage = true; | 68 m_accessedImage = true; |
| 69 | 69 |
| 70 FetchRequest request(ResourceRequest(loader->document()->completeURL(m_u
rl)), m_initiatorName.isEmpty() ? FetchInitiatorTypeNames::css : m_initiatorName
, options); | 70 FetchRequest request(ResourceRequest(fetcher->document()->completeURL(m_
url)), m_initiatorName.isEmpty() ? FetchInitiatorTypeNames::css : m_initiatorNam
e, options); |
| 71 | 71 |
| 72 if (options.requestOriginPolicy == PotentiallyCrossOriginEnabled) | 72 if (corsEnabled == PotentiallyCORSEnabled) |
| 73 updateRequestForAccessControl(request.mutableResourceRequest(), load
er->document()->securityOrigin(), options.allowCredentials); | 73 updateRequestForAccessControl(request.mutableResourceRequest(), fetc
her->document()->securityOrigin(), options.allowCredentials); |
| 74 | 74 |
| 75 if (ResourcePtr<ImageResource> cachedImage = loader->fetchImage(request)
) | 75 if (ResourcePtr<ImageResource> cachedImage = fetcher->fetchImage(request
)) |
| 76 m_image = StyleFetchedImage::create(cachedImage.get()); | 76 m_image = StyleFetchedImage::create(cachedImage.get()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image
) : 0; | 79 return (m_image && m_image->isImageResource()) ? toStyleFetchedImage(m_image
) : 0; |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool CSSImageValue::hasFailedOrCanceledSubresources() const | 82 bool CSSImageValue::hasFailedOrCanceledSubresources() const |
| 83 { | 83 { |
| 84 if (!m_image || !m_image->isImageResource()) | 84 if (!m_image || !m_image->isImageResource()) |
| 85 return false; | 85 return false; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 105 uriValue->setCSSOMSafe(); | 105 uriValue->setCSSOMSafe(); |
| 106 return uriValue.release(); | 106 return uriValue.release(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const | 109 bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const |
| 110 { | 110 { |
| 111 return m_image ? m_image->knownToBeOpaque(renderer) : false; | 111 return m_image ? m_image->knownToBeOpaque(renderer) : false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace WebCore | 114 } // namespace WebCore |
| OLD | NEW |