OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifferen
ce diff, const RenderStyle* newStyle) | 118 void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifferen
ce diff, const RenderStyle* newStyle) |
119 { | 119 { |
120 ASSERT(renderer); | 120 ASSERT(renderer); |
121 ASSERT(renderer->node()); | 121 ASSERT(renderer->node()); |
122 ASSERT(renderer->node()->isSVGElement()); | 122 ASSERT(renderer->node()->isSVGElement()); |
123 | 123 |
124 if (!diff.hasDifference() || !renderer->parent()) | 124 if (!diff.hasDifference() || !renderer->parent()) |
125 return; | 125 return; |
126 | 126 |
127 // In this case the proper SVGFE*Element will decide whether the modified CS
S properties require a relayout or repaint. | 127 // In this case the proper SVGFE*Element will decide whether the modified CS
S properties require a relayout or paintInvalidation. |
128 if (renderer->isSVGResourceFilterPrimitive() && !diff.needsLayout()) | 128 if (renderer->isSVGResourceFilterPrimitive() && !diff.needsLayout()) |
129 return; | 129 return; |
130 | 130 |
131 // Dynamic changes of CSS properties like 'clip-path' may require us to reco
mpute the associated resources for a renderer. | 131 // Dynamic changes of CSS properties like 'clip-path' may require us to reco
mpute the associated resources for a renderer. |
132 // FIXME: Avoid passing in a useless StyleDifference, but instead compare ol
dStyle/newStyle to see which resources changed | 132 // FIXME: Avoid passing in a useless StyleDifference, but instead compare ol
dStyle/newStyle to see which resources changed |
133 // to be able to selectively rebuild individual resources, instead of all of
them. | 133 // to be able to selectively rebuild individual resources, instead of all of
them. |
134 if (rendererCanHaveResources(renderer)) { | 134 if (rendererCanHaveResources(renderer)) { |
135 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); | 135 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); |
136 cache->removeResourcesFromRenderObject(renderer); | 136 cache->removeResourcesFromRenderObject(renderer); |
137 cache->addResourcesFromRenderObject(renderer, newStyle); | 137 cache->addResourcesFromRenderObject(renderer, newStyle); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. | 191 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. |
192 Element* resourceElement = resource->element(); | 192 Element* resourceElement = resource->element(); |
193 Element* clientElement = toElement(it->key->node()); | 193 Element* clientElement = toElement(it->key->node()); |
194 SVGDocumentExtensions& extensions = clientElement->document().accessSVGE
xtensions(); | 194 SVGDocumentExtensions& extensions = clientElement->document().accessSVGE
xtensions(); |
195 | 195 |
196 extensions.addPendingResource(resourceElement->fastGetAttribute(HTMLName
s::idAttr), clientElement); | 196 extensions.addPendingResource(resourceElement->fastGetAttribute(HTMLName
s::idAttr), clientElement); |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 } | 200 } |
OLD | NEW |