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

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

Issue 1087653004: [svg] Update the <use> shadowtree if a referenced element is removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « LayoutTests/svg/custom/use-remove-referenced-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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 // Clone the target subtree into the shadow tree, not handling <use> and <sy mbol> yet. 385 // Clone the target subtree into the shadow tree, not handling <use> and <sy mbol> yet.
386 386
387 // SVG specification does not say a word about <use> & cycles. My view on th is is: just ignore it! 387 // SVG specification does not say a word about <use> & cycles. My view on th is is: just ignore it!
388 // Non-appearing <use> content is easier to debug, then half-appearing conte nt. 388 // Non-appearing <use> content is easier to debug, then half-appearing conte nt.
389 if (!buildShadowTree(target, m_targetElementInstance.get(), false)) { 389 if (!buildShadowTree(target, m_targetElementInstance.get(), false)) {
390 clearResourceReferences(); 390 clearResourceReferences();
391 return; 391 return;
392 } 392 }
393 393
394 // Add a reference such that if the target is removed we tear down the
395 // corresponding shadowtree.
396 addReferenceTo(target);
pdr. 2015/04/17 04:57:25 It's been a while since I've been in SVGUseElement
397
394 if (instanceTreeIsLoading(m_targetElementInstance.get())) 398 if (instanceTreeIsLoading(m_targetElementInstance.get()))
395 return; 399 return;
396 400
397 // Assure shadow tree building was successfull 401 // Assure shadow tree building was successfull
398 ASSERT(m_targetElementInstance); 402 ASSERT(m_targetElementInstance);
399 ASSERT(m_targetElementInstance->correspondingUseElement() == this); 403 ASSERT(m_targetElementInstance->correspondingUseElement() == this);
400 ASSERT(m_targetElementInstance->correspondingElement() == target); 404 ASSERT(m_targetElementInstance->correspondingElement() == target);
401 405
402 // Expand all <use> elements in the shadow tree. 406 // Expand all <use> elements in the shadow tree.
403 // Expand means: replace the actual <use> element by what it references. 407 // Expand means: replace the actual <use> element by what it references.
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 766
763 if (m_resource) 767 if (m_resource)
764 m_resource->removeClient(this); 768 m_resource->removeClient(this);
765 769
766 m_resource = resource; 770 m_resource = resource;
767 if (m_resource) 771 if (m_resource)
768 m_resource->addClient(this); 772 m_resource->addClient(this);
769 } 773 }
770 774
771 } 775 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/use-remove-referenced-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698