Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 1734983004: After expanding <symbol> in <use>, expand its siblings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/use-nested-sibling-symbols-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 689
690 RefPtrWillBeRawPtr<SVGElement> replacingElement(svgElement.get()); 690 RefPtrWillBeRawPtr<SVGElement> replacingElement(svgElement.get());
691 691
692 // Replace <symbol> with <svg>. 692 // Replace <symbol> with <svg>.
693 ASSERT(element->parentNode()); 693 ASSERT(element->parentNode());
694 element->parentNode()->replaceChild(svgElement.release(), element); 694 element->parentNode()->replaceChild(svgElement.release(), element);
695 695
696 // Expand the siblings because the *element* is replaced and we will 696 // Expand the siblings because the *element* is replaced and we will
697 // lose the sibling chain when we are back from recursion. 697 // lose the sibling chain when we are back from recursion.
698 element = replacingElement.get(); 698 element = replacingElement.get();
699 for (RefPtrWillBeRawPtr<SVGElement> sibling = Traversal<SVGElement>::nex tSibling(*element); sibling; sibling = Traversal<SVGElement>::nextSibling(*sibli ng))
700 expandSymbolElementsInShadowTree(sibling.get());
699 } 701 }
700 702
701 for (RefPtrWillBeRawPtr<SVGElement> child = Traversal<SVGElement>::firstChil d(*element); child; child = Traversal<SVGElement>::nextSibling(*child)) 703 for (RefPtrWillBeRawPtr<SVGElement> child = Traversal<SVGElement>::firstChil d(*element); child; child = Traversal<SVGElement>::nextSibling(*child))
702 expandSymbolElementsInShadowTree(child.get()); 704 expandSymbolElementsInShadowTree(child.get());
703 } 705 }
704 706
705 void SVGUseElement::invalidateShadowTree() 707 void SVGUseElement::invalidateShadowTree()
706 { 708 {
707 if (!inActiveDocument() || m_needsShadowTreeRecreation) 709 if (!inActiveDocument() || m_needsShadowTreeRecreation)
708 return; 710 return;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 835
834 if (m_resource) 836 if (m_resource)
835 m_resource->removeClient(this); 837 m_resource->removeClient(this);
836 838
837 m_resource = resource; 839 m_resource = resource;
838 if (m_resource) 840 if (m_resource)
839 m_resource->addClient(this); 841 m_resource->addClient(this);
840 } 842 }
841 843
842 } // namespace blink 844 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/use-nested-sibling-symbols-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698