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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (!isStructurallyExternal()) | 790 if (!isStructurallyExternal()) |
791 return; | 791 return; |
792 ASSERT(!m_haveFiredLoadEvent); | 792 ASSERT(!m_haveFiredLoadEvent); |
793 m_haveFiredLoadEvent = true; | 793 m_haveFiredLoadEvent = true; |
794 svgUseLoadEventSender().dispatchEventSoon(this); | 794 svgUseLoadEventSender().dispatchEventSoon(this); |
795 } | 795 } |
796 } | 796 } |
797 | 797 |
798 bool SVGUseElement::resourceIsStillLoading() const | 798 bool SVGUseElement::resourceIsStillLoading() const |
799 { | 799 { |
800 if (m_resource && m_resource->isLoading()) | 800 return m_resource && m_resource->isLoading(); |
801 return true; | |
802 return false; | |
803 } | 801 } |
804 | 802 |
805 bool SVGUseElement::instanceTreeIsLoading(const SVGElement* targetInstance) | 803 bool SVGUseElement::instanceTreeIsLoading(const SVGElement* targetInstance) |
806 { | 804 { |
807 for (const SVGElement* element = Traversal<SVGElement>::firstChild(*targetIn
stance); element; element = Traversal<SVGElement>::nextSibling(*element)) { | 805 for (const SVGElement* element = targetInstance; element; element = Traversa
l<SVGElement>::next(*element, targetInstance)) { |
808 if (const SVGUseElement* use = element->correspondingUseElement()) { | 806 if (isSVGUseElement(*element) && toSVGUseElement(*element).resourceIsSti
llLoading()) |
809 if (use->resourceIsStillLoading()) | |
810 return true; | |
811 } | |
812 if (element->hasChildren() && instanceTreeIsLoading(element)) | |
813 return true; | 807 return true; |
814 } | 808 } |
815 return false; | 809 return false; |
816 } | 810 } |
817 | 811 |
818 void SVGUseElement::setDocumentResource(ResourcePtr<DocumentResource> resource) | 812 void SVGUseElement::setDocumentResource(ResourcePtr<DocumentResource> resource) |
819 { | 813 { |
820 if (m_resource == resource) | 814 if (m_resource == resource) |
821 return; | 815 return; |
822 | 816 |
823 if (m_resource) | 817 if (m_resource) |
824 m_resource->removeClient(this); | 818 m_resource->removeClient(this); |
825 | 819 |
826 m_resource = resource; | 820 m_resource = resource; |
827 if (m_resource) | 821 if (m_resource) |
828 m_resource->addClient(this); | 822 m_resource->addClient(this); |
829 } | 823 } |
830 | 824 |
831 } | 825 } |
OLD | NEW |