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

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

Issue 1105873002: Avoid transiently creating disallowed elements when building <use> trees (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/custom/use-referencing-animation-crash-expected.txt ('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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 ASSERT(!m_targetElementInstance); 366 ASSERT(!m_targetElementInstance);
367 367
368 // <use> creates a "user agent" shadow root. Do not build the shadow/instanc e tree for <use> 368 // <use> creates a "user agent" shadow root. Do not build the shadow/instanc e tree for <use>
369 // elements living in a user agent shadow tree because they will get expande d in a second 369 // elements living in a user agent shadow tree because they will get expande d in a second
370 // pass -- see expandUseElementsInShadowTree(). 370 // pass -- see expandUseElementsInShadowTree().
371 if (inUseShadowTree()) 371 if (inUseShadowTree())
372 return; 372 return;
373 373
374 // Do not allow self-referencing. 374 // Do not allow self-referencing.
375 // 'target' may be null, if it's a non SVG namespaced element. 375 // 'target' may be null, if it's a non SVG namespaced element.
376 if (!target || target == this) 376 if (!target || target == this || isDisallowedElement(target))
377 return; 377 return;
378 378
379 // Set up root SVG element in shadow tree. 379 // Set up root SVG element in shadow tree.
380 RefPtrWillBeRawPtr<Element> newChild = target->cloneElementWithoutChildren() ; 380 RefPtrWillBeRawPtr<Element> newChild = target->cloneElementWithoutChildren() ;
381 m_targetElementInstance = toSVGElement(newChild.get()); 381 m_targetElementInstance = toSVGElement(newChild.get());
382 ShadowRoot* shadowTreeRootElement = userAgentShadowRoot(); 382 ShadowRoot* shadowTreeRootElement = userAgentShadowRoot();
383 shadowTreeRootElement->appendChild(newChild.release()); 383 shadowTreeRootElement->appendChild(newChild.release());
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
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 762
763 if (m_resource) 763 if (m_resource)
764 m_resource->removeClient(this); 764 m_resource->removeClient(this);
765 765
766 m_resource = resource; 766 m_resource = resource;
767 if (m_resource) 767 if (m_resource)
768 m_resource->addClient(this); 768 m_resource->addClient(this);
769 } 769 }
770 770
771 } 771 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/use-referencing-animation-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698