void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes) const { WillBeHeapHashSet<RawPtrWillBeMember<const SVGPatternElement>> processedPatterns; const SVGPatternElement* current = this; while (true) { setPatternAttributes(current, attributes); processedPatterns.add(current); // Respect xlink:href, take attributes from referenced element Node* refNode = SVGURIReference::targetElementFromIRIString(current->hrefString(), treeScope()); // Only consider attached SVG pattern elements. if (!isSVGPatternElement(refNode) || !refNode->layoutObject()) break; current = toSVGPatternElement(refNode); // Cycle detection if (processedPatterns.contains(current)) break; } }
void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes) const { HashSet<const SVGPatternElement*> processedPatterns; const SVGPatternElement* current = this; while (true) { setPatternAttributes(current, attributes); processedPatterns.add(current); // Respect xlink:href, take attributes from referenced element Node* refNode = SVGURIReference::targetElementFromIRIString(current->hrefString(), treeScope()); if (isSVGPatternElement(refNode)) { current = toSVGPatternElement(refNode); // Cycle detection if (processedPatterns.contains(current)) return; } else { return; } } ASSERT_NOT_REACHED(); }