| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/text/StringBuilder.h" | 34 #include "wtf/text/StringBuilder.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 static bool subimageIsPending(CSSValue* value) | 38 static bool subimageIsPending(CSSValue* value) |
| 39 { | 39 { |
| 40 if (value->isImageValue()) | 40 if (value->isImageValue()) |
| 41 return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage(); | 41 return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage(); |
| 42 | 42 |
| 43 if (value->isImageGeneratorValue()) | 43 if (value->isImageGeneratorValue()) |
| 44 return static_cast<CSSImageGeneratorValue*>(value)->isPending(); | 44 return toCSSImageGeneratorValue(value)->isPending(); |
| 45 | 45 |
| 46 ASSERT_NOT_REACHED(); | 46 ASSERT_NOT_REACHED(); |
| 47 | 47 |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 static bool subimageKnownToBeOpaque(CSSValue* value, const RenderObject* rendere
r) | 51 static bool subimageKnownToBeOpaque(CSSValue* value, const RenderObject* rendere
r) |
| 52 { | 52 { |
| 53 if (value->isImageValue()) | 53 if (value->isImageValue()) |
| 54 return toCSSImageValue(value)->knownToBeOpaque(renderer); | 54 return toCSSImageValue(value)->knownToBeOpaque(renderer); |
| 55 | 55 |
| 56 if (value->isImageGeneratorValue()) | 56 if (value->isImageGeneratorValue()) |
| 57 return static_cast<CSSImageGeneratorValue*>(value)->knownToBeOpaque(rend
erer); | 57 return toCSSImageGeneratorValue(value)->knownToBeOpaque(renderer); |
| 58 | 58 |
| 59 ASSERT_NOT_REACHED(); | 59 ASSERT_NOT_REACHED(); |
| 60 | 60 |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 static ImageResource* cachedImageForCSSValue(CSSValue* value, ResourceFetcher* f
etcher) | 64 static ImageResource* cachedImageForCSSValue(CSSValue* value, ResourceFetcher* f
etcher) |
| 65 { | 65 { |
| 66 if (!value) | 66 if (!value) |
| 67 return 0; | 67 return 0; |
| 68 | 68 |
| 69 if (value->isImageValue()) { | 69 if (value->isImageValue()) { |
| 70 StyleFetchedImage* styleImageResource = toCSSImageValue(value)->cachedIm
age(fetcher); | 70 StyleFetchedImage* styleImageResource = toCSSImageValue(value)->cachedIm
age(fetcher); |
| 71 if (!styleImageResource) | 71 if (!styleImageResource) |
| 72 return 0; | 72 return 0; |
| 73 | 73 |
| 74 return styleImageResource->cachedImage(); | 74 return styleImageResource->cachedImage(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (value->isImageGeneratorValue()) { | 77 if (value->isImageGeneratorValue()) { |
| 78 static_cast<CSSImageGeneratorValue*>(value)->loadSubimages(fetcher); | 78 toCSSImageGeneratorValue(value)->loadSubimages(fetcher); |
| 79 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradi
ents and canvas). | 79 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradi
ents and canvas). |
| 80 return 0; | 80 return 0; |
| 81 } | 81 } |
| 82 | 82 |
| 83 ASSERT_NOT_REACHED(); | 83 ASSERT_NOT_REACHED(); |
| 84 | 84 |
| 85 return 0; | 85 return 0; |
| 86 } | 86 } |
| 87 | 87 |
| 88 CSSCrossfadeValue::~CSSCrossfadeValue() | 88 CSSCrossfadeValue::~CSSCrossfadeValue() |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const | 215 bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const |
| 216 { | 216 { |
| 217 return compareCSSValuePtr(m_fromValue, other.m_fromValue) | 217 return compareCSSValuePtr(m_fromValue, other.m_fromValue) |
| 218 && compareCSSValuePtr(m_toValue, other.m_toValue) | 218 && compareCSSValuePtr(m_toValue, other.m_toValue) |
| 219 && compareCSSValuePtr(m_percentageValue, other.m_percentageValue); | 219 && compareCSSValuePtr(m_percentageValue, other.m_percentageValue); |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace WebCore | 222 } // namespace WebCore |
| OLD | NEW |