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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 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 | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/testing/Internals.h » ('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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 result = rect.contains(mappedRepaintRect); 367 result = rect.contains(mappedRepaintRect);
368 break; 368 break;
369 default: 369 default:
370 ASSERT_NOT_REACHED(); 370 ASSERT_NOT_REACHED();
371 break; 371 break;
372 } 372 }
373 373
374 return result; 374 return result;
375 } 375 }
376 376
377 PassRefPtr<NodeList> SVGSVGElement::collectIntersectionOrEnclosureList(const Flo atRect& rect, 377 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::collectIntersectionOrEnclosureLi st(const FloatRect& rect,
378 SVGElement* referenceElement, CheckIntersectionOrEnclosure mode) const 378 SVGElement* referenceElement, CheckIntersectionOrEnclosure mode) const
379 { 379 {
380 Vector<RefPtr<Node> > nodes; 380 Vector<RefPtr<Node> > nodes;
381 381
382 const SVGElement* root = this; 382 const SVGElement* root = this;
383 if (referenceElement) { 383 if (referenceElement) {
384 // Only the common subtree needs to be traversed. 384 // Only the common subtree needs to be traversed.
385 if (contains(referenceElement)) { 385 if (contains(referenceElement)) {
386 root = referenceElement; 386 root = referenceElement;
387 } else if (!isDescendantOf(referenceElement)) { 387 } else if (!isDescendantOf(referenceElement)) {
388 // No common subtree. 388 // No common subtree.
389 return StaticNodeList::adopt(nodes); 389 return StaticNodeList::adopt(nodes);
390 } 390 }
391 } 391 }
392 392
393 for (SVGGraphicsElement* element = Traversal<SVGGraphicsElement>::firstWithi n(*root); element; 393 for (SVGGraphicsElement* element = Traversal<SVGGraphicsElement>::firstWithi n(*root); element;
394 element = Traversal<SVGGraphicsElement>::next(*element, root)) { 394 element = Traversal<SVGGraphicsElement>::next(*element, root)) {
395 if (checkIntersectionOrEnclosure(*element, rect, mode)) 395 if (checkIntersectionOrEnclosure(*element, rect, mode))
396 nodes.append(element); 396 nodes.append(element);
397 } 397 }
398 398
399 return StaticNodeList::adopt(nodes); 399 return StaticNodeList::adopt(nodes);
400 } 400 }
401 401
402 PassRefPtr<NodeList> SVGSVGElement::getIntersectionList(PassRefPtr<SVGRectTearOf f> rect, SVGElement* referenceElement) const 402 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::getIntersectionList(PassRefPtr<S VGRectTearOff> rect, SVGElement* referenceElement) const
403 { 403 {
404 document().updateLayoutIgnorePendingStylesheets(); 404 document().updateLayoutIgnorePendingStylesheets();
405 405
406 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckIntersection); 406 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckIntersection);
407 } 407 }
408 408
409 PassRefPtr<NodeList> SVGSVGElement::getEnclosureList(PassRefPtr<SVGRectTearOff> rect, SVGElement* referenceElement) const 409 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::getEnclosureList(PassRefPtr<SVGR ectTearOff> rect, SVGElement* referenceElement) const
410 { 410 {
411 document().updateLayoutIgnorePendingStylesheets(); 411 document().updateLayoutIgnorePendingStylesheets();
412 412
413 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckEnclosure); 413 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckEnclosure);
414 } 414 }
415 415
416 bool SVGSVGElement::checkIntersection(SVGElement* element, PassRefPtr<SVGRectTea rOff> rect) const 416 bool SVGSVGElement::checkIntersection(SVGElement* element, PassRefPtr<SVGRectTea rOff> rect) const
417 { 417 {
418 ASSERT(element); 418 ASSERT(element);
419 document().updateLayoutIgnorePendingStylesheets(); 419 document().updateLayoutIgnorePendingStylesheets();
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp atchWindowLoadEvent. 773 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp atchWindowLoadEvent.
774 if (isOutermostSVGSVGElement()) 774 if (isOutermostSVGSVGElement())
775 return; 775 return;
776 776
777 // finishParsingChildren() is called when the close tag is reached for an el ement (e.g. </svg>) 777 // finishParsingChildren() is called when the close tag is reached for an el ement (e.g. </svg>)
778 // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish 778 // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
779 sendSVGLoadEventIfPossible(); 779 sendSVGLoadEventIfPossible();
780 } 780 }
781 781
782 } 782 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698