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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 StyleImage* ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID proper
ty, const CSSCursorImageValue& value) | 98 StyleImage* ElementStyleResources::cursorOrPendingFromValue(CSSPropertyID proper
ty, const CSSCursorImageValue& value) |
99 { | 99 { |
100 if (value.isCachePending(m_deviceScaleFactor)) { | 100 if (value.isCachePending(m_deviceScaleFactor)) { |
101 m_pendingImageProperties.add(property); | 101 m_pendingImageProperties.add(property); |
102 return StylePendingImage::create(value); | 102 return StylePendingImage::create(value); |
103 } | 103 } |
104 return value.cachedImage(m_deviceScaleFactor); | 104 return value.cachedImage(m_deviceScaleFactor); |
105 } | 105 } |
106 | 106 |
107 void ElementStyleResources::addPendingSVGDocument(FilterOperation* filterOperati
on, CSSSVGDocumentValue* cssSVGDocumentValue) | 107 void ElementStyleResources::addPendingSVGDocument(FilterOperation* filterOperati
on, const CSSSVGDocumentValue* cssSVGDocumentValue) |
108 { | 108 { |
109 m_pendingSVGDocuments.set(filterOperation, cssSVGDocumentValue); | 109 m_pendingSVGDocuments.set(filterOperation, cssSVGDocumentValue); |
110 } | 110 } |
111 | 111 |
112 void ElementStyleResources::loadPendingSVGDocuments(ComputedStyle* computedStyle
) | 112 void ElementStyleResources::loadPendingSVGDocuments(ComputedStyle* computedStyle
) |
113 { | 113 { |
114 if (!computedStyle->hasFilter() || m_pendingSVGDocuments.isEmpty()) | 114 if (!computedStyle->hasFilter() || m_pendingSVGDocuments.isEmpty()) |
115 return; | 115 return; |
116 | 116 |
117 FilterOperations::FilterOperationVector& filterOperations = computedStyle->m
utableFilter().operations(); | 117 FilterOperations::FilterOperationVector& filterOperations = computedStyle->m
utableFilter().operations(); |
118 for (unsigned i = 0; i < filterOperations.size(); ++i) { | 118 for (unsigned i = 0; i < filterOperations.size(); ++i) { |
119 FilterOperation* filterOperation = filterOperations.at(i); | 119 FilterOperation* filterOperation = filterOperations.at(i); |
120 if (filterOperation->type() == FilterOperation::REFERENCE) { | 120 if (filterOperation->type() == FilterOperation::REFERENCE) { |
121 ReferenceFilterOperation* referenceFilter = toReferenceFilterOperati
on(filterOperation); | 121 ReferenceFilterOperation* referenceFilter = toReferenceFilterOperati
on(filterOperation); |
122 | 122 |
123 CSSSVGDocumentValue* value = m_pendingSVGDocuments.get(referenceFilt
er); | 123 const CSSSVGDocumentValue* value = m_pendingSVGDocuments.get(referen
ceFilter); |
124 if (!value) | 124 if (!value) |
125 continue; | 125 continue; |
126 DocumentResource* resource = value->load(m_document); | 126 DocumentResource* resource = value->load(m_document); |
127 if (!resource) | 127 if (!resource) |
128 continue; | 128 continue; |
129 | 129 |
130 // Stash the DocumentResource on the reference filter. | 130 // Stash the DocumentResource on the reference filter. |
131 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter
, new DocumentResourceReference(resource)); | 131 ReferenceFilterBuilder::setDocumentResourceReference(referenceFilter
, new DocumentResourceReference(resource)); |
132 } | 132 } |
133 } | 133 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 void ElementStyleResources::loadPendingResources(ComputedStyle* computedStyle) | 255 void ElementStyleResources::loadPendingResources(ComputedStyle* computedStyle) |
256 { | 256 { |
257 loadPendingImages(computedStyle); | 257 loadPendingImages(computedStyle); |
258 loadPendingSVGDocuments(computedStyle); | 258 loadPendingSVGDocuments(computedStyle); |
259 } | 259 } |
260 | 260 |
261 } // namespace blink | 261 } // namespace blink |
OLD | NEW |