bool SVGDocumentExtensions::isElementPendingResources(Element* element) const
{
    // This algorithm takes time proportional to the number of pending resources and need not.
    // If performance becomes an issue we can keep a counted set of elements and answer the question efficiently.

    ASSERT(element);

    for (const auto& entry : m_pendingResources) {
        SVGPendingElements* elements = entry.value.get();
        ASSERT(elements);

        if (elements->contains(element))
            return true;
    }
    return false;
}
예제 #2
0
bool SVGDocumentExtensions::isElementPendingResources(SVGStyledElement* element) const
{
    // This algorithm takes time proportional to the number of pending resources and need not.
    // If performance becomes an issue we can keep a counted set of elements and answer the question efficiently.

    ASSERT(element);

    HashMap<AtomicString, SVGPendingElements*>::const_iterator end = m_pendingResources.end();
    for (HashMap<AtomicString, SVGPendingElements*>::const_iterator it = m_pendingResources.begin(); it != end; ++it) {
        SVGPendingElements* elements = it->value;
        ASSERT(elements);

        if (elements->contains(element))
            return true;
    }
    return false;
}