Exemplo n.º 1
0
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
        Element* refElement = SVGURIReference::targetElementFromIRIString(current->href(), document());
        if (is<SVGPatternElement>(refElement)) {
            current = downcast<SVGPatternElement>(refElement);

            // Cycle detection
            if (processedPatterns.contains(current))
                return;
        } else
            return;
    }
    ASSERT_NOT_REACHED();
}
Exemplo n.º 2
0
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;
    }
}
Exemplo n.º 3
0
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();
}