| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 DocumentResource* resource = value->load(m_fetcher); | 63 DocumentResource* resource = value->load(m_fetcher); |
| 64 if (!resource) | 64 if (!resource) |
| 65 continue; | 65 continue; |
| 66 | 66 |
| 67 // Stash the DocumentResource on the reference filter. | 67 // Stash the DocumentResource on the reference filter. |
| 68 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter
, adoptPtr(new DocumentResourceReference(resource))); | 68 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter
, adoptPtr(new DocumentResourceReference(resource))); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 static PassRefPtr<StyleImage> doLoadPendingImage(ResourceFetcher* fetcher, Style
PendingImage* pendingImage, float deviceScaleFactor, const ResourceLoaderOptions
& options, CORSEnabled corsEnabled) | 73 static PassRefPtr<StyleImage> doLoadPendingImage(ResourceFetcher* fetcher, Style
PendingImage* pendingImage, float deviceScaleFactor, const ResourceLoaderOptions
& options) |
| 74 { | 74 { |
| 75 if (CSSImageValue* imageValue = pendingImage->cssImageValue()) | 75 if (CSSImageValue* imageValue = pendingImage->cssImageValue()) |
| 76 return imageValue->cachedImage(fetcher, options, corsEnabled); | 76 return imageValue->cachedImage(fetcher, options); |
| 77 | 77 |
| 78 if (CSSImageGeneratorValue* imageGeneratorValue | 78 if (CSSImageGeneratorValue* imageGeneratorValue |
| 79 = pendingImage->cssImageGeneratorValue()) { | 79 = pendingImage->cssImageGeneratorValue()) { |
| 80 imageGeneratorValue->loadSubimages(fetcher); | 80 imageGeneratorValue->loadSubimages(fetcher); |
| 81 return StyleGeneratedImage::create(imageGeneratorValue); | 81 return StyleGeneratedImage::create(imageGeneratorValue); |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (CSSCursorImageValue* cursorImageValue | 84 if (CSSCursorImageValue* cursorImageValue |
| 85 = pendingImage->cssCursorImageValue()) | 85 = pendingImage->cssCursorImageValue()) |
| 86 return cursorImageValue->cachedImage(fetcher, deviceScaleFactor); | 86 return cursorImageValue->cachedImage(fetcher, deviceScaleFactor); |
| 87 | 87 |
| 88 if (CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue()) | 88 if (CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue()) |
| 89 return imageSetValue->cachedImageSet(fetcher, deviceScaleFactor, options
, corsEnabled); | 89 return imageSetValue->cachedImageSet(fetcher, deviceScaleFactor, options
); |
| 90 | 90 |
| 91 return 0; | 91 return 0; |
| 92 } | 92 } |
| 93 | 93 |
| 94 PassRefPtr<StyleImage> StyleResourceLoader::loadPendingImage(StylePendingImage*
pendingImage, float deviceScaleFactor) | 94 PassRefPtr<StyleImage> StyleResourceLoader::loadPendingImage(StylePendingImage*
pendingImage, float deviceScaleFactor) |
| 95 { | 95 { |
| 96 return doLoadPendingImage(m_fetcher, pendingImage, deviceScaleFactor, Resour
ceFetcher::defaultResourceOptions(), NotCORSEnabled); | 96 return doLoadPendingImage(m_fetcher, pendingImage, deviceScaleFactor, Resour
ceFetcher::defaultResourceOptions()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void StyleResourceLoader::loadPendingShapeImage(RenderStyle* renderStyle, ShapeV
alue* shapeValue, float deviceScaleFactor) | 99 void StyleResourceLoader::loadPendingShapeImage(RenderStyle* renderStyle, ShapeV
alue* shapeValue, float deviceScaleFactor) |
| 100 { | 100 { |
| 101 if (!shapeValue) | 101 if (!shapeValue) |
| 102 return; | 102 return; |
| 103 | 103 |
| 104 StyleImage* image = shapeValue->image(); | 104 StyleImage* image = shapeValue->image(); |
| 105 if (!image || !image->isPendingImage()) | 105 if (!image || !image->isPendingImage()) |
| 106 return; | 106 return; |
| 107 | 107 |
| 108 ResourceLoaderOptions options = ResourceFetcher::defaultResourceOptions(); | 108 ResourceLoaderOptions options = ResourceFetcher::defaultResourceOptions(); |
| 109 options.allowCredentials = DoNotAllowStoredCredentials; | 109 options.allowCredentials = DoNotAllowStoredCredentials; |
| 110 options.corsEnabled = IsCORSEnabled; |
| 110 | 111 |
| 111 shapeValue->setImage(doLoadPendingImage(m_fetcher, toStylePendingImage(image
), deviceScaleFactor, options, PotentiallyCORSEnabled)); | 112 shapeValue->setImage(doLoadPendingImage(m_fetcher, toStylePendingImage(image
), deviceScaleFactor, options)); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void StyleResourceLoader::loadPendingImages(RenderStyle* style, const ElementSty
leResources& elementStyleResources) | 115 void StyleResourceLoader::loadPendingImages(RenderStyle* style, const ElementSty
leResources& elementStyleResources) |
| 115 { | 116 { |
| 116 if (elementStyleResources.pendingImageProperties().isEmpty()) | 117 if (elementStyleResources.pendingImageProperties().isEmpty()) |
| 117 return; | 118 return; |
| 118 | 119 |
| 119 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe
ndingImageProperties().end().keys(); | 120 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe
ndingImageProperties().end().keys(); |
| 120 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource
s.pendingImageProperties().begin().keys(); it != end; ++it) { | 121 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource
s.pendingImageProperties().begin().keys(); it != end; ++it) { |
| 121 CSSPropertyID currentProperty = *it; | 122 CSSPropertyID currentProperty = *it; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element
StyleResources& elementStyleResources) | 201 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element
StyleResources& elementStyleResources) |
| 201 { | 202 { |
| 202 // Start loading images referenced by this style. | 203 // Start loading images referenced by this style. |
| 203 loadPendingImages(renderStyle, elementStyleResources); | 204 loadPendingImages(renderStyle, elementStyleResources); |
| 204 | 205 |
| 205 // Start loading the SVG Documents referenced by this style. | 206 // Start loading the SVG Documents referenced by this style. |
| 206 loadPendingSVGDocuments(renderStyle, elementStyleResources); | 207 loadPendingSVGDocuments(renderStyle, elementStyleResources); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } | 210 } |
| OLD | NEW |