| 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, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 6 * Copyright (C) 2012 University of Szeged | 6 * Copyright (C) 2012 University of Szeged |
| 7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> |
| 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 } | 393 } |
| 394 | 394 |
| 395 void SVGUseElement::buildPendingResource() | 395 void SVGUseElement::buildPendingResource() |
| 396 { | 396 { |
| 397 if (!referencedDocument() || isInShadowTree()) | 397 if (!referencedDocument() || isInShadowTree()) |
| 398 return; | 398 return; |
| 399 clearResourceReferences(); | 399 clearResourceReferences(); |
| 400 if (!inDocument()) | 400 if (!inDocument()) |
| 401 return; | 401 return; |
| 402 | 402 |
| 403 String id; | 403 AtomicString id; |
| 404 Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentVal
ue(), document(), &id, externalDocument()); | 404 Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentVal
ue(), document(), &id, externalDocument()); |
| 405 if (!target || !target->inDocument()) { | 405 if (!target || !target->inDocument()) { |
| 406 // If we can't find the target of an external element, just give up. | 406 // If we can't find the target of an external element, just give up. |
| 407 // We can't observe if the target somewhen enters the external document,
nor should we do it. | 407 // We can't observe if the target somewhen enters the external document,
nor should we do it. |
| 408 if (externalDocument()) | 408 if (externalDocument()) |
| 409 return; | 409 return; |
| 410 if (id.isEmpty()) | 410 if (id.isEmpty()) |
| 411 return; | 411 return; |
| 412 | 412 |
| 413 referencedDocument()->accessSVGExtensions()->addPendingResource(id, this
); | 413 referencedDocument()->accessSVGExtensions()->addPendingResource(id, this
); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 | 819 |
| 820 void SVGUseElement::associateInstancesWithShadowTreeElements(Node* target, SVGEl
ementInstance* targetInstance) | 820 void SVGUseElement::associateInstancesWithShadowTreeElements(Node* target, SVGEl
ementInstance* targetInstance) |
| 821 { | 821 { |
| 822 if (!target || !targetInstance) | 822 if (!target || !targetInstance) |
| 823 return; | 823 return; |
| 824 | 824 |
| 825 SVGElement* originalElement = targetInstance->correspondingElement(); | 825 SVGElement* originalElement = targetInstance->correspondingElement(); |
| 826 | 826 |
| 827 if (originalElement->hasTagName(SVGNames::useTag)) { | 827 if (originalElement->hasTagName(SVGNames::useTag)) { |
| 828 // <use> gets replaced by <g> | 828 // <use> gets replaced by <g> |
| 829 ASSERT(target->nodeName() == SVGNames::gTag); | 829 ASSERT(AtomicString(target->nodeName()) == SVGNames::gTag); |
| 830 } else if (originalElement->hasTagName(SVGNames::symbolTag)) { | 830 } else if (originalElement->hasTagName(SVGNames::symbolTag)) { |
| 831 // <symbol> gets replaced by <svg> | 831 // <symbol> gets replaced by <svg> |
| 832 ASSERT(target->nodeName() == SVGNames::svgTag); | 832 ASSERT(AtomicString(target->nodeName()) == SVGNames::svgTag); |
| 833 } else | 833 } else { |
| 834 ASSERT(target->nodeName() == originalElement->nodeName()); | 834 ASSERT(AtomicString(target->nodeName()) == originalElement->nodeName()); |
| 835 } |
| 835 | 836 |
| 836 SVGElement* element = 0; | 837 SVGElement* element = 0; |
| 837 if (target->isSVGElement()) | 838 if (target->isSVGElement()) |
| 838 element = toSVGElement(target); | 839 element = toSVGElement(target); |
| 839 | 840 |
| 840 ASSERT(!targetInstance->shadowTreeElement()); | 841 ASSERT(!targetInstance->shadowTreeElement()); |
| 841 targetInstance->setShadowTreeElement(element); | 842 targetInstance->setShadowTreeElement(element); |
| 842 element->setCorrespondingElement(originalElement); | 843 element->setCorrespondingElement(originalElement); |
| 843 | 844 |
| 844 Node* node = target->firstChild(); | 845 Node* node = target->firstChild(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 | 990 |
| 990 if (m_resource) | 991 if (m_resource) |
| 991 m_resource->removeClient(this); | 992 m_resource->removeClient(this); |
| 992 | 993 |
| 993 m_resource = resource; | 994 m_resource = resource; |
| 994 if (m_resource) | 995 if (m_resource) |
| 995 m_resource->addClient(this); | 996 m_resource->addClient(this); |
| 996 } | 997 } |
| 997 | 998 |
| 998 } | 999 } |
| OLD | NEW |