| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 if (value->isImageGeneratorValue()) { | 44 if (value->isImageGeneratorValue()) { |
| 45 if (value->isGradientValue()) | 45 if (value->isGradientValue()) |
| 46 return generatedOrPendingFromValue(property, toCSSGradientValue(valu
e)->gradientWithStylesResolved(textLinkColors, currentColor).get()); | 46 return generatedOrPendingFromValue(property, toCSSGradientValue(valu
e)->gradientWithStylesResolved(textLinkColors, currentColor).get()); |
| 47 return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(va
lue)); | 47 return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(va
lue)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 if (value->isImageSetValue()) | 50 if (value->isImageSetValue()) |
| 51 return setOrPendingFromValue(property, toCSSImageSetValue(value)); | 51 return setOrPendingFromValue(property, toCSSImageSetValue(value)); |
| 52 | 52 |
| 53 if (value->isCursorImageValue()) | |
| 54 return cursorOrPendingFromValue(property, toCSSCursorImageValue(value)); | |
| 55 | |
| 56 return nullptr; | 53 return nullptr; |
| 57 } | 54 } |
| 58 | 55 |
| 59 PassRefPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPro
pertyID property, CSSImageGeneratorValue* value) | 56 PassRefPtr<StyleImage> ElementStyleResources::generatedOrPendingFromValue(CSSPro
pertyID property, CSSImageGeneratorValue* value) |
| 60 { | 57 { |
| 61 if (value->isPending()) { | 58 if (value->isPending()) { |
| 62 m_pendingImageProperties.set(property, value); | 59 m_pendingImageProperties.set(property, value); |
| 63 return StylePendingImage::create(value); | 60 return StylePendingImage::create(value); |
| 64 } | 61 } |
| 65 return StyleGeneratedImage::create(value); | 62 return StyleGeneratedImage::create(value); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 RefPtr<StyleImage> image = value->cachedOrPendingImage(); | 75 RefPtr<StyleImage> image = value->cachedOrPendingImage(); |
| 79 if (image) { | 76 if (image) { |
| 80 if (image->isPendingImage()) | 77 if (image->isPendingImage()) |
| 81 m_pendingImageProperties.set(property, value); | 78 m_pendingImageProperties.set(property, value); |
| 82 else | 79 else |
| 83 value->restoreCachedResourceIfNeeded(document); | 80 value->restoreCachedResourceIfNeeded(document); |
| 84 } | 81 } |
| 85 return image.release(); | 82 return image.release(); |
| 86 } | 83 } |
| 87 | 84 |
| 88 PassRefPtr<StyleImage> ElementStyleResources::cursorOrPendingFromValue(CSSProper
tyID property, CSSCursorImageValue* value) | |
| 89 { | |
| 90 RefPtr<StyleImage> image = value->cachedOrPendingImage(m_deviceScaleFactor); | |
| 91 if (image && image->isPendingImage()) | |
| 92 m_pendingImageProperties.set(property, value); | |
| 93 return image.release(); | |
| 94 } | |
| 95 | |
| 96 void ElementStyleResources::clearPendingImageProperties() | 85 void ElementStyleResources::clearPendingImageProperties() |
| 97 { | 86 { |
| 98 m_pendingImageProperties.clear(); | 87 m_pendingImageProperties.clear(); |
| 99 } | 88 } |
| 100 | 89 |
| 101 } | 90 } |
| OLD | NEW |