| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/dom/ElementTraversal.h" | 36 #include "core/dom/ElementTraversal.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
| 38 #include "core/events/Event.h" | 38 #include "core/events/Event.h" |
| 39 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 40 #include "core/html/HTMLElement.h" | 40 #include "core/html/HTMLElement.h" |
| 41 #include "core/rendering/RenderObject.h" | 41 #include "core/rendering/RenderObject.h" |
| 42 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 42 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
| 43 #include "core/svg/SVGCursorElement.h" | 43 #include "core/svg/SVGCursorElement.h" |
| 44 #include "core/svg/SVGDocumentExtensions.h" | 44 #include "core/svg/SVGDocumentExtensions.h" |
| 45 #include "core/svg/SVGElementInstance.h" | |
| 46 #include "core/svg/SVGElementRareData.h" | 45 #include "core/svg/SVGElementRareData.h" |
| 47 #include "core/svg/SVGGraphicsElement.h" | 46 #include "core/svg/SVGGraphicsElement.h" |
| 48 #include "core/svg/SVGSVGElement.h" | 47 #include "core/svg/SVGSVGElement.h" |
| 49 #include "core/svg/SVGTitleElement.h" | 48 #include "core/svg/SVGTitleElement.h" |
| 50 #include "core/svg/SVGUseElement.h" | 49 #include "core/svg/SVGUseElement.h" |
| 51 | 50 |
| 52 #include "wtf/TemporaryChange.h" | 51 #include "wtf/TemporaryChange.h" |
| 53 | 52 |
| 54 namespace WebCore { | 53 namespace WebCore { |
| 55 | 54 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 return 0; | 520 return 0; |
| 522 } | 521 } |
| 523 | 522 |
| 524 SVGDocumentExtensions& SVGElement::accessDocumentSVGExtensions() | 523 SVGDocumentExtensions& SVGElement::accessDocumentSVGExtensions() |
| 525 { | 524 { |
| 526 // This function is provided for use by SVGAnimatedProperty to avoid | 525 // This function is provided for use by SVGAnimatedProperty to avoid |
| 527 // global inclusion of core/dom/Document.h in SVG code. | 526 // global inclusion of core/dom/Document.h in SVG code. |
| 528 return document().accessSVGExtensions(); | 527 return document().accessSVGExtensions(); |
| 529 } | 528 } |
| 530 | 529 |
| 531 void SVGElement::mapInstanceToElement(SVGElementInstance* instance) | 530 void SVGElement::mapInstanceToElement(SVGElement* instance) |
| 532 { | 531 { |
| 533 ASSERT(instance); | 532 ASSERT(instance); |
| 533 ASSERT(instance->inUseShadowTree()); |
| 534 | 534 |
| 535 HashSet<SVGElement*>& instances = ensureSVGRareData()->elementInstances(); | 535 HashSet<SVGElement*>& instances = ensureSVGRareData()->elementInstances(); |
| 536 ASSERT(!instances.contains(instance->shadowTreeElement())); | 536 ASSERT(!instances.contains(instance)); |
| 537 | 537 |
| 538 instances.add(instance->shadowTreeElement()); | 538 instances.add(instance); |
| 539 } | 539 } |
| 540 | 540 |
| 541 void SVGElement::removeInstanceMapping(SVGElementInstance* instance) | 541 void SVGElement::removeInstanceMapping(SVGElement* instance) |
| 542 { | 542 { |
| 543 ASSERT(instance); | 543 ASSERT(instance); |
| 544 ASSERT(instance->inUseShadowTree()); |
| 544 ASSERT(hasSVGRareData()); | 545 ASSERT(hasSVGRareData()); |
| 545 | 546 |
| 546 if (!instance->shadowTreeElement()) | 547 HashSet<SVGElement*>& instances = svgRareData()->elementInstances(); |
| 547 return; | 548 ASSERT(instances.contains(instance)); |
| 548 | 549 |
| 549 HashSet<SVGElement*>& instances = svgRareData()->elementInstances(); | 550 instances.remove(instance); |
| 550 ASSERT(instances.contains(instance->shadowTreeElement())); | |
| 551 | |
| 552 instances.remove(instance->shadowTreeElement()); | |
| 553 } | 551 } |
| 554 | 552 |
| 555 const HashSet<SVGElement*>& SVGElement::instancesForElement() const | 553 const HashSet<SVGElement*>& SVGElement::instancesForElement() const |
| 556 { | 554 { |
| 557 if (!hasSVGRareData()) { | 555 if (!hasSVGRareData()) { |
| 558 DEFINE_STATIC_LOCAL(HashSet<SVGElement*>, emptyInstances, ()); | 556 DEFINE_STATIC_LOCAL(HashSet<SVGElement*>, emptyInstances, ()); |
| 559 return emptyInstances; | 557 return emptyInstances; |
| 560 } | 558 } |
| 561 return svgRareData()->elementInstances(); | 559 return svgRareData()->elementInstances(); |
| 562 } | 560 } |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 animatableAttributes.add(SVGNames::zAttr); | 1170 animatableAttributes.add(SVGNames::zAttr); |
| 1173 } | 1171 } |
| 1174 | 1172 |
| 1175 if (name == classAttr) | 1173 if (name == classAttr) |
| 1176 return true; | 1174 return true; |
| 1177 | 1175 |
| 1178 return animatableAttributes.contains(name); | 1176 return animatableAttributes.contains(name); |
| 1179 } | 1177 } |
| 1180 #endif | 1178 #endif |
| 1181 } | 1179 } |
| OLD | NEW |