| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return imageSetValue->cachedImageSet(fetcher, deviceScaleFactor, options
); | 62 return imageSetValue->cachedImageSet(fetcher, deviceScaleFactor, options
); |
| 63 | 63 |
| 64 return nullptr; | 64 return nullptr; |
| 65 } | 65 } |
| 66 | 66 |
| 67 PassRefPtr<StyleImage> StyleResourceLoader::loadPendingImage(StylePendingImage*
pendingImage, float deviceScaleFactor) | 67 PassRefPtr<StyleImage> StyleResourceLoader::loadPendingImage(StylePendingImage*
pendingImage, float deviceScaleFactor) |
| 68 { | 68 { |
| 69 return doLoadPendingImage(m_fetcher, pendingImage, deviceScaleFactor, Resour
ceFetcher::defaultResourceOptions()); | 69 return doLoadPendingImage(m_fetcher, pendingImage, deviceScaleFactor, Resour
ceFetcher::defaultResourceOptions()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void StyleResourceLoader::loadPendingShapeImage(RenderStyle* renderStyle, ShapeV
alue* shapeValue, float deviceScaleFactor) | |
| 73 { | |
| 74 if (!shapeValue) | |
| 75 return; | |
| 76 | |
| 77 StyleImage* image = shapeValue->image(); | |
| 78 if (!image || !image->isPendingImage()) | |
| 79 return; | |
| 80 | |
| 81 ResourceLoaderOptions options = ResourceFetcher::defaultResourceOptions(); | |
| 82 options.allowCredentials = DoNotAllowStoredCredentials; | |
| 83 options.credentialsRequested = ClientDidNotRequestCredentials; | |
| 84 options.corsEnabled = IsCORSEnabled; | |
| 85 | |
| 86 shapeValue->setImage(doLoadPendingImage(m_fetcher, toStylePendingImage(image
), deviceScaleFactor, options)); | |
| 87 } | |
| 88 | |
| 89 void StyleResourceLoader::loadPendingImages(RenderStyle* style, ElementStyleReso
urces& elementStyleResources) | 72 void StyleResourceLoader::loadPendingImages(RenderStyle* style, ElementStyleReso
urces& elementStyleResources) |
| 90 { | 73 { |
| 91 if (elementStyleResources.pendingImageProperties().isEmpty()) | 74 if (elementStyleResources.pendingImageProperties().isEmpty()) |
| 92 return; | 75 return; |
| 93 | 76 |
| 94 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe
ndingImageProperties().end().keys(); | 77 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe
ndingImageProperties().end().keys(); |
| 95 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource
s.pendingImageProperties().begin().keys(); it != end; ++it) { | 78 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource
s.pendingImageProperties().begin().keys(); it != end; ++it) { |
| 96 CSSPropertyID currentProperty = *it; | 79 CSSPropertyID currentProperty = *it; |
| 97 | 80 |
| 98 switch (currentProperty) { | 81 switch (currentProperty) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 style->setMaskBoxImageSource(loadPendingImage(toStylePendingImag
e(style->maskBoxImageSource()), elementStyleResources.deviceScaleFactor())); | 126 style->setMaskBoxImageSource(loadPendingImage(toStylePendingImag
e(style->maskBoxImageSource()), elementStyleResources.deviceScaleFactor())); |
| 144 break; | 127 break; |
| 145 } | 128 } |
| 146 case CSSPropertyWebkitMaskImage: { | 129 case CSSPropertyWebkitMaskImage: { |
| 147 for (FillLayer* maskLayer = &style->accessMaskLayers(); maskLayer; m
askLayer = maskLayer->next()) { | 130 for (FillLayer* maskLayer = &style->accessMaskLayers(); maskLayer; m
askLayer = maskLayer->next()) { |
| 148 if (maskLayer->image() && maskLayer->image()->isPendingImage()) | 131 if (maskLayer->image() && maskLayer->image()->isPendingImage()) |
| 149 maskLayer->setImage(loadPendingImage(toStylePendingImage(mas
kLayer->image()), elementStyleResources.deviceScaleFactor())); | 132 maskLayer->setImage(loadPendingImage(toStylePendingImage(mas
kLayer->image()), elementStyleResources.deviceScaleFactor())); |
| 150 } | 133 } |
| 151 break; | 134 break; |
| 152 } | 135 } |
| 153 case CSSPropertyShapeOutside: | |
| 154 loadPendingShapeImage(style, style->shapeOutside(), elementStyleReso
urces.deviceScaleFactor()); | |
| 155 break; | |
| 156 default: | 136 default: |
| 157 ASSERT_NOT_REACHED(); | 137 ASSERT_NOT_REACHED(); |
| 158 } | 138 } |
| 159 } | 139 } |
| 160 | 140 |
| 161 elementStyleResources.clearPendingImageProperties(); | 141 elementStyleResources.clearPendingImageProperties(); |
| 162 } | 142 } |
| 163 | 143 |
| 164 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element
StyleResources& elementStyleResources) | 144 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element
StyleResources& elementStyleResources) |
| 165 { | 145 { |
| 166 // Start loading images referenced by this style. | 146 // Start loading images referenced by this style. |
| 167 loadPendingImages(renderStyle, elementStyleResources); | 147 loadPendingImages(renderStyle, elementStyleResources); |
| 168 } | 148 } |
| 169 | 149 |
| 170 } | 150 } |
| OLD | NEW |