| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/cssom/CSSStyleImageValue.h" | 5 #include "core/css/cssom/CSSStyleImageValue.h" |
| 6 | 6 |
| 7 namespace blink { | 7 namespace blink { |
| 8 | 8 |
| 9 double CSSStyleImageValue::intrinsicWidth(bool& isNull) const { | 9 double CSSStyleImageValue::intrinsicWidth(bool& isNull) const { |
| 10 isNull = isCachePending(); | 10 isNull = isCachePending(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 int CSSStyleImageValue::sourceWidth() { | 47 int CSSStyleImageValue::sourceWidth() { |
| 48 bool notUsed; | 48 bool notUsed; |
| 49 return intrinsicWidth(notUsed); | 49 return intrinsicWidth(notUsed); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<Image> CSSStyleImageValue::image() const { | 52 PassRefPtr<Image> CSSStyleImageValue::image() const { |
| 53 if (isCachePending()) | 53 if (isCachePending()) |
| 54 return nullptr; | 54 return nullptr; |
| 55 // cachedImage can be null if image is StyleInvalidImage | 55 // cachedImage can be null if image is StyleInvalidImage |
| 56 ImageResource* cachedImage = m_imageValue->cachedImage()->cachedImage(); | 56 ImageResourceContent* cachedImage = |
| 57 m_imageValue->cachedImage()->cachedImage(); |
| 57 if (cachedImage) { | 58 if (cachedImage) { |
| 58 // getImage() returns the nullImage() if the image is not available yet | 59 // getImage() returns the nullImage() if the image is not available yet |
| 59 return cachedImage->getImage()->imageForDefaultFrame(); | 60 return cachedImage->getImage()->imageForDefaultFrame(); |
| 60 } | 61 } |
| 61 return nullptr; | 62 return nullptr; |
| 62 } | 63 } |
| 63 | 64 |
| 64 } // namespace blink | 65 } // namespace blink |
| OLD | NEW |