| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |