| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // canvas. Specifically: circle, ellipse, image, line, path, polygon, polyline, | 310 // canvas. Specifically: circle, ellipse, image, line, path, polygon, polyline, |
| 311 // rect, text and use. | 311 // rect, text and use. |
| 312 static bool isIntersectionOrEnclosureTarget(LayoutObject* layoutObject) { | 312 static bool isIntersectionOrEnclosureTarget(LayoutObject* layoutObject) { |
| 313 return layoutObject->isSVGShape() || layoutObject->isSVGText() || | 313 return layoutObject->isSVGShape() || layoutObject->isSVGText() || |
| 314 layoutObject->isSVGImage() || isSVGUseElement(*layoutObject->node()); | 314 layoutObject->isSVGImage() || isSVGUseElement(*layoutObject->node()); |
| 315 } | 315 } |
| 316 | 316 |
| 317 bool SVGSVGElement::checkIntersectionOrEnclosure( | 317 bool SVGSVGElement::checkIntersectionOrEnclosure( |
| 318 const SVGElement& element, | 318 const SVGElement& element, |
| 319 const FloatRect& rect, | 319 const FloatRect& rect, |
| 320 CheckIntersectionOrEnclosure mode) const { | 320 GeometryMatchingMode mode) const { |
| 321 LayoutObject* layoutObject = element.layoutObject(); | 321 LayoutObject* layoutObject = element.layoutObject(); |
| 322 ASSERT(!layoutObject || layoutObject->style()); | 322 ASSERT(!layoutObject || layoutObject->style()); |
| 323 if (!layoutObject || | 323 if (!layoutObject || |
| 324 layoutObject->style()->pointerEvents() == EPointerEvents::None) | 324 layoutObject->style()->pointerEvents() == EPointerEvents::None) |
| 325 return false; | 325 return false; |
| 326 | 326 |
| 327 if (!isIntersectionOrEnclosureTarget(layoutObject)) | 327 if (!isIntersectionOrEnclosureTarget(layoutObject)) |
| 328 return false; | 328 return false; |
| 329 | 329 |
| 330 AffineTransform ctm = toSVGGraphicsElement(element).computeCTM( | 330 AffineTransform ctm = toSVGGraphicsElement(element).computeCTM( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 344 ASSERT_NOT_REACHED(); | 344 ASSERT_NOT_REACHED(); |
| 345 break; | 345 break; |
| 346 } | 346 } |
| 347 | 347 |
| 348 return result; | 348 return result; |
| 349 } | 349 } |
| 350 | 350 |
| 351 StaticNodeList* SVGSVGElement::collectIntersectionOrEnclosureList( | 351 StaticNodeList* SVGSVGElement::collectIntersectionOrEnclosureList( |
| 352 const FloatRect& rect, | 352 const FloatRect& rect, |
| 353 SVGElement* referenceElement, | 353 SVGElement* referenceElement, |
| 354 CheckIntersectionOrEnclosure mode) const { | 354 GeometryMatchingMode mode) const { |
| 355 HeapVector<Member<Node>> nodes; | 355 HeapVector<Member<Node>> nodes; |
| 356 | 356 |
| 357 const SVGElement* root = this; | 357 const SVGElement* root = this; |
| 358 if (referenceElement) { | 358 if (referenceElement) { |
| 359 // Only the common subtree needs to be traversed. | 359 // Only the common subtree needs to be traversed. |
| 360 if (contains(referenceElement)) { | 360 if (contains(referenceElement)) { |
| 361 root = referenceElement; | 361 root = referenceElement; |
| 362 } else if (!isDescendantOf(referenceElement)) { | 362 } else if (!isDescendantOf(referenceElement)) { |
| 363 // No common subtree. | 363 // No common subtree. |
| 364 return StaticNodeList::adopt(nodes); | 364 return StaticNodeList::adopt(nodes); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 visitor->trace(m_width); | 760 visitor->trace(m_width); |
| 761 visitor->trace(m_height); | 761 visitor->trace(m_height); |
| 762 visitor->trace(m_translation); | 762 visitor->trace(m_translation); |
| 763 visitor->trace(m_timeContainer); | 763 visitor->trace(m_timeContainer); |
| 764 visitor->trace(m_viewSpec); | 764 visitor->trace(m_viewSpec); |
| 765 SVGGraphicsElement::trace(visitor); | 765 SVGGraphicsElement::trace(visitor); |
| 766 SVGFitToViewBox::trace(visitor); | 766 SVGFitToViewBox::trace(visitor); |
| 767 } | 767 } |
| 768 | 768 |
| 769 } // namespace blink | 769 } // namespace blink |
| OLD | NEW |