| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann |
| 3 * <zimmermann@kde.org> | 3 * <zimmermann@kde.org> |
| 4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
| 5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 6 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // If the style changes because of a regular property change (not induced by | 104 // If the style changes because of a regular property change (not induced by |
| 105 // SMIL animations themselves) reset the "computed style without SMIL style | 105 // SMIL animations themselves) reset the "computed style without SMIL style |
| 106 // properties", so the base value change gets reflected. | 106 // properties", so the base value change gets reflected. |
| 107 if (change > NoChange || needsStyleRecalc()) | 107 if (change > NoChange || needsStyleRecalc()) |
| 108 svgRareData()->setNeedsOverrideComputedStyleUpdate(); | 108 svgRareData()->setNeedsOverrideComputedStyleUpdate(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void SVGElement::buildPendingResourcesIfNeeded() { | 111 void SVGElement::buildPendingResourcesIfNeeded() { |
| 112 if (!needsPendingResourceHandling() || !isConnected() || inUseShadowTree()) | 112 if (!needsPendingResourceHandling() || !isConnected() || inUseShadowTree()) |
| 113 return; | 113 return; |
| 114 | 114 treeScope().ensureSVGTreeScopedResources().notifyResourceAvailable( |
| 115 SVGTreeScopeResources& treeScopeResources = | 115 getIdAttribute()); |
| 116 treeScope().ensureSVGTreeScopedResources(); | |
| 117 AtomicString resourceId = getIdAttribute(); | |
| 118 if (!treeScopeResources.hasPendingResource(resourceId)) | |
| 119 return; | |
| 120 // Guaranteed by hasPendingResource. | |
| 121 DCHECK(!resourceId.isEmpty()); | |
| 122 | |
| 123 // Get pending elements for this id. | |
| 124 SVGTreeScopeResources::SVGPendingElements* pendingElements = | |
| 125 treeScopeResources.removePendingResource(resourceId); | |
| 126 if (!pendingElements || pendingElements->isEmpty()) | |
| 127 return; | |
| 128 | |
| 129 // Rebuild pending resources for each client of a pending resource that is | |
| 130 // being removed. | |
| 131 for (Element* clientElement : *pendingElements) { | |
| 132 DCHECK(clientElement->hasPendingResources()); | |
| 133 if (!clientElement->hasPendingResources()) | |
| 134 continue; | |
| 135 // TODO(fs): Ideally we'd always resolve pending resources async instead of | |
| 136 // inside insertedInto and svgAttributeChanged. For now we only do it for | |
| 137 // <use> since that would stamp out DOM. | |
| 138 if (isSVGUseElement(clientElement)) | |
| 139 toSVGUseElement(clientElement)->invalidateShadowTree(); | |
| 140 else | |
| 141 clientElement->buildPendingResource(); | |
| 142 treeScopeResources.clearHasPendingResourcesIfPossible(clientElement); | |
| 143 } | |
| 144 } | 116 } |
| 145 | 117 |
| 146 SVGElementRareData* SVGElement::ensureSVGRareData() { | 118 SVGElementRareData* SVGElement::ensureSVGRareData() { |
| 147 if (hasSVGRareData()) | 119 if (hasSVGRareData()) |
| 148 return svgRareData(); | 120 return svgRareData(); |
| 149 | 121 |
| 150 m_SVGRareData = new SVGElementRareData(this); | 122 m_SVGRareData = new SVGElementRareData(this); |
| 151 return m_SVGRareData.get(); | 123 return m_SVGRareData.get(); |
| 152 } | 124 } |
| 153 | 125 |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 visitor->trace(m_className); | 1274 visitor->trace(m_className); |
| 1303 Element::trace(visitor); | 1275 Element::trace(visitor); |
| 1304 } | 1276 } |
| 1305 | 1277 |
| 1306 const AtomicString& SVGElement::eventParameterName() { | 1278 const AtomicString& SVGElement::eventParameterName() { |
| 1307 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); | 1279 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); |
| 1308 return evtString; | 1280 return evtString; |
| 1309 } | 1281 } |
| 1310 | 1282 |
| 1311 } // namespace blink | 1283 } // namespace blink |
| OLD | NEW |