| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void SVGMPathElement::buildPendingResource() | 56 void SVGMPathElement::buildPendingResource() |
| 57 { | 57 { |
| 58 clearResourceReferences(); | 58 clearResourceReferences(); |
| 59 if (!inDocument()) | 59 if (!inDocument()) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 AtomicString id; | 62 AtomicString id; |
| 63 Element* target = SVGURIReference::targetElementFromIRIString(hrefString(),
document(), &id); | 63 Element* target = SVGURIReference::targetElementFromIRIString(hrefString(),
document(), &id); |
| 64 if (!target) { | 64 if (!target) { |
| 65 // Do not register as pending if we are already pending this resource. | 65 // Do not register as pending if we are already pending this resource. |
| 66 if (document().accessSVGExtensions()->isElementPendingResource(this, id)
) | 66 if (document().accessSVGExtensions().isElementPendingResource(this, id)) |
| 67 return; | 67 return; |
| 68 | 68 |
| 69 if (!id.isEmpty()) { | 69 if (!id.isEmpty()) { |
| 70 document().accessSVGExtensions()->addPendingResource(id, this); | 70 document().accessSVGExtensions().addPendingResource(id, this); |
| 71 ASSERT(hasPendingResources()); | 71 ASSERT(hasPendingResources()); |
| 72 } | 72 } |
| 73 } else if (target->isSVGElement()) { | 73 } else if (target->isSVGElement()) { |
| 74 // Register us with the target in the dependencies map. Any change of hr
efElement | 74 // Register us with the target in the dependencies map. Any change of hr
efElement |
| 75 // that leads to relayout/repainting now informs us, so we can react to
it. | 75 // that leads to relayout/repainting now informs us, so we can react to
it. |
| 76 document().accessSVGExtensions()->addElementReferencingTarget(this, toSV
GElement(target)); | 76 document().accessSVGExtensions().addElementReferencingTarget(this, toSVG
Element(target)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 targetPathChanged(); | 79 targetPathChanged(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void SVGMPathElement::clearResourceReferences() | 82 void SVGMPathElement::clearResourceReferences() |
| 83 { | 83 { |
| 84 document().accessSVGExtensions()->removeAllTargetReferencesForElement(this); | 84 document().accessSVGExtensions().removeAllTargetReferencesForElement(this); |
| 85 } | 85 } |
| 86 | 86 |
| 87 Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode*
rootParent) | 87 Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode*
rootParent) |
| 88 { | 88 { |
| 89 SVGElement::insertedInto(rootParent); | 89 SVGElement::insertedInto(rootParent); |
| 90 if (rootParent->inDocument()) | 90 if (rootParent->inDocument()) |
| 91 buildPendingResource(); | 91 buildPendingResource(); |
| 92 return InsertionDone; | 92 return InsertionDone; |
| 93 } | 93 } |
| 94 | 94 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 notifyParentOfPathChange(parentNode()); | 153 notifyParentOfPathChange(parentNode()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent) | 156 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent) |
| 157 { | 157 { |
| 158 if (parent && parent->hasTagName(SVGNames::animateMotionTag)) | 158 if (parent && parent->hasTagName(SVGNames::animateMotionTag)) |
| 159 toSVGAnimateMotionElement(parent)->updateAnimationPath(); | 159 toSVGAnimateMotionElement(parent)->updateAnimationPath(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace WebCore | 162 } // namespace WebCore |
| OLD | NEW |