StaticNodeList* SVGSVGElement::collectIntersectionOrEnclosureList( const FloatRect& rect, SVGElement* referenceElement, CheckIntersectionOrEnclosure mode) const { HeapVector<Member<Node>> nodes; const SVGElement* root = this; if (referenceElement) { // Only the common subtree needs to be traversed. if (contains(referenceElement)) { root = referenceElement; } else if (!isDescendantOf(referenceElement)) { // No common subtree. return StaticNodeList::adopt(nodes); } } for (SVGGraphicsElement& element : Traversal<SVGGraphicsElement>::descendantsOf(*root)) { if (checkIntersectionOrEnclosure(element, rect, mode)) nodes.append(&element); } return StaticNodeList::adopt(nodes); }
bool SVGSVGElement::checkEnclosure(SVGElement* element, PassRefPtrWillBeRawPtr<SVGRectTearOff> rect) const { ASSERT(element); document().updateLayoutIgnorePendingStylesheets(); return checkIntersectionOrEnclosure(*element, rect->target()->value(), CheckEnclosure); }
bool SVGSVGElement::checkIntersection(SVGElement* element, SVGRectTearOff* rect) const { ASSERT(element); document().updateStyleAndLayoutIgnorePendingStylesheets(); return checkIntersectionOrEnclosure(*element, rect->target()->value(), CheckIntersection); }