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

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

Issue 334713006: Use stricter typing for NodeLists throughout the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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/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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 result = rect.contains(mappedRepaintRect); 368 result = rect.contains(mappedRepaintRect);
369 break; 369 break;
370 default: 370 default:
371 ASSERT_NOT_REACHED(); 371 ASSERT_NOT_REACHED();
372 break; 372 break;
373 } 373 }
374 374
375 return result; 375 return result;
376 } 376 }
377 377
378 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::collectIntersectionOrEnclosureLi st(const FloatRect& rect, 378 PassRefPtrWillBeRawPtr<StaticNodeList> SVGSVGElement::collectIntersectionOrEnclo sureList(const FloatRect& rect,
379 SVGElement* referenceElement, CheckIntersectionOrEnclosure mode) const 379 SVGElement* referenceElement, CheckIntersectionOrEnclosure mode) const
380 { 380 {
381 WillBeHeapVector<RefPtrWillBeMember<Node> > nodes; 381 WillBeHeapVector<RefPtrWillBeMember<Node> > nodes;
382 382
383 const SVGElement* root = this; 383 const SVGElement* root = this;
384 if (referenceElement) { 384 if (referenceElement) {
385 // Only the common subtree needs to be traversed. 385 // Only the common subtree needs to be traversed.
386 if (contains(referenceElement)) { 386 if (contains(referenceElement)) {
387 root = referenceElement; 387 root = referenceElement;
388 } else if (!isDescendantOf(referenceElement)) { 388 } else if (!isDescendantOf(referenceElement)) {
389 // No common subtree. 389 // No common subtree.
390 return StaticNodeList::adopt(nodes); 390 return StaticNodeList::adopt(nodes);
391 } 391 }
392 } 392 }
393 393
394 for (SVGGraphicsElement* element = Traversal<SVGGraphicsElement>::firstWithi n(*root); element; 394 for (SVGGraphicsElement* element = Traversal<SVGGraphicsElement>::firstWithi n(*root); element;
395 element = Traversal<SVGGraphicsElement>::next(*element, root)) { 395 element = Traversal<SVGGraphicsElement>::next(*element, root)) {
396 if (checkIntersectionOrEnclosure(*element, rect, mode)) 396 if (checkIntersectionOrEnclosure(*element, rect, mode))
397 nodes.append(element); 397 nodes.append(element);
398 } 398 }
399 399
400 return StaticNodeList::adopt(nodes); 400 return StaticNodeList::adopt(nodes);
401 } 401 }
402 402
403 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::getIntersectionList(PassRefPtr<S VGRectTearOff> rect, SVGElement* referenceElement) const 403 PassRefPtrWillBeRawPtr<StaticNodeList> SVGSVGElement::getIntersectionList(PassRe fPtr<SVGRectTearOff> rect, SVGElement* referenceElement) const
404 { 404 {
405 document().updateLayoutIgnorePendingStylesheets(); 405 document().updateLayoutIgnorePendingStylesheets();
406 406
407 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckIntersection); 407 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckIntersection);
408 } 408 }
409 409
410 PassRefPtrWillBeRawPtr<NodeList> SVGSVGElement::getEnclosureList(PassRefPtr<SVGR ectTearOff> rect, SVGElement* referenceElement) const 410 PassRefPtrWillBeRawPtr<StaticNodeList> SVGSVGElement::getEnclosureList(PassRefPt r<SVGRectTearOff> rect, SVGElement* referenceElement) const
411 { 411 {
412 document().updateLayoutIgnorePendingStylesheets(); 412 document().updateLayoutIgnorePendingStylesheets();
413 413
414 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckEnclosure); 414 return collectIntersectionOrEnclosureList(rect->target()->value(), reference Element, CheckEnclosure);
415 } 415 }
416 416
417 bool SVGSVGElement::checkIntersection(SVGElement* element, PassRefPtr<SVGRectTea rOff> rect) const 417 bool SVGSVGElement::checkIntersection(SVGElement* element, PassRefPtr<SVGRectTea rOff> rect) const
418 { 418 {
419 ASSERT(element); 419 ASSERT(element);
420 document().updateLayoutIgnorePendingStylesheets(); 420 document().updateLayoutIgnorePendingStylesheets();
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 } 781 }
782 782
783 void SVGSVGElement::trace(Visitor* visitor) 783 void SVGSVGElement::trace(Visitor* visitor)
784 { 784 {
785 visitor->trace(m_timeContainer); 785 visitor->trace(m_timeContainer);
786 visitor->trace(m_viewSpec); 786 visitor->trace(m_viewSpec);
787 SVGGraphicsElement::trace(visitor); 787 SVGGraphicsElement::trace(visitor);
788 } 788 }
789 789
790 } 790 }
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