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

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

Issue 344883007: SVG: Move/rename reference management to SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove sed script from CL Created 6 years, 6 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 | « Source/core/svg/SVGTextPathElement.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 if (m_targetElementInstance) 302 if (m_targetElementInstance)
303 m_targetElementInstance = nullptr; 303 m_targetElementInstance = nullptr;
304 304
305 // FIXME: We should try to optimize this, to at least allow partial reclones . 305 // FIXME: We should try to optimize this, to at least allow partial reclones .
306 if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot()) 306 if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot())
307 shadowTreeRootElement->removeChildren(); 307 shadowTreeRootElement->removeChildren();
308 308
309 m_needsShadowTreeRecreation = false; 309 m_needsShadowTreeRecreation = false;
310 document().unscheduleUseShadowTreeUpdate(*this); 310 document().unscheduleUseShadowTreeUpdate(*this);
311 311
312 document().accessSVGExtensions().removeAllTargetReferencesForElement(this); 312 removeAllOutgoingReferences();
313 } 313 }
314 314
315 void SVGUseElement::buildPendingResource() 315 void SVGUseElement::buildPendingResource()
316 { 316 {
317 if (!referencedScope() || inUseShadowTree()) 317 if (!referencedScope() || inUseShadowTree())
318 return; 318 return;
319 clearResourceReferences(); 319 clearResourceReferences();
320 if (!inDocument()) 320 if (!inDocument())
321 return; 321 return;
322 322
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 { 470 {
471 ASSERT(target); 471 ASSERT(target);
472 ASSERT(targetInstance); 472 ASSERT(targetInstance);
473 473
474 // Spec: If the referenced object is itself a 'use', or if there are 'use' s ubelements within the referenced 474 // Spec: If the referenced object is itself a 'use', or if there are 'use' s ubelements within the referenced
475 // object, the instance tree will contain recursive expansion of the indirec t references to form a complete tree. 475 // object, the instance tree will contain recursive expansion of the indirec t references to form a complete tree.
476 if (isSVGUseElement(*target)) { 476 if (isSVGUseElement(*target)) {
477 // We only need to track first degree <use> dependencies. Indirect refer ences are handled 477 // We only need to track first degree <use> dependencies. Indirect refer ences are handled
478 // as the invalidation bubbles up the dependency chain. 478 // as the invalidation bubbles up the dependency chain.
479 if (!foundUse && !isStructurallyExternal()) { 479 if (!foundUse && !isStructurallyExternal()) {
480 document().accessSVGExtensions().addElementReferencingTarget(this, t arget); 480 addReferenceTo(target);
481 foundUse = true; 481 foundUse = true;
482 } 482 }
483 } else if (isDisallowedElement(target)) { 483 } else if (isDisallowedElement(target)) {
484 return false; 484 return false;
485 } 485 }
486 486
487 targetInstance->setCorrespondingElement(target); 487 targetInstance->setCorrespondingElement(target);
488 if (EventTargetData* data = target->eventTargetData()) 488 if (EventTargetData* data = target->eventTargetData())
489 data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(ta rgetInstance); 489 data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(ta rgetInstance);
490 490
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 m_resource->addClient(this); 767 m_resource->addClient(this);
768 } 768 }
769 769
770 void SVGUseElement::trace(Visitor* visitor) 770 void SVGUseElement::trace(Visitor* visitor)
771 { 771 {
772 visitor->trace(m_targetElementInstance); 772 visitor->trace(m_targetElementInstance);
773 SVGGraphicsElement::trace(visitor); 773 SVGGraphicsElement::trace(visitor);
774 } 774 }
775 775
776 } 776 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextPathElement.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698