Beispiel #1
0
static void destroyCounterNodeWithoutMapRemoval(const AtomicString& identifier, CounterNode* node)
{
    CounterNode* previous;
    for (RefPtr<CounterNode> child = node->lastDescendant(); child && child != node; child = previous) {
        previous = child->previousInPreOrder();
        child->parent()->removeChild(child.get(), identifier);
        ASSERT(counterMaps().get(child->renderer())->get(identifier.impl()) == child);
        counterMaps().get(child->renderer())->remove(identifier.impl());
        if (!child->renderer()->documentBeingDestroyed()) {
            RenderObjectChildList* children = child->renderer()->virtualChildren();
            if (children)
                children->invalidateCounters(child->renderer(), identifier);
        }
    }
    RenderObject* renderer = node->renderer();
    if (!renderer->documentBeingDestroyed()) {
        if (RenderObjectChildList* children = renderer->virtualChildren())
            children->invalidateCounters(renderer, identifier);
    }
    if (CounterNode* parent = node->parent())
        parent->removeChild(node, identifier);
}
Beispiel #2
0
void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject& object, bool needsLayout)
{
    ASSERT(object.node());

    if (needsLayout && !object.documentBeingDestroyed())
        object.setNeedsLayout();

    if (is<RenderElement>(object))
        removeFromCacheAndInvalidateDependencies(downcast<RenderElement>(object), needsLayout);

    // Invalidate resources in ancestor chain, if needed.
    auto current = object.parent();
    while (current) {
        removeFromCacheAndInvalidateDependencies(*current, needsLayout);

        if (is<RenderSVGResourceContainer>(*current)) {
            // This will process the rest of the ancestors.
            downcast<RenderSVGResourceContainer>(*current).removeAllClientsFromCache();
            break;
        }

        current = current->parent();
    }
}