void DescendantInvalidationSet::combine(const DescendantInvalidationSet& other)
{
    // No longer bother combining data structures, since the whole subtree is deemed invalid.
    if (wholeSubtreeInvalid())
        return;

    if (other.wholeSubtreeInvalid()) {
        setWholeSubtreeInvalid();
        return;
    }

    if (other.m_classes) {
        HashSet<AtomicString>::const_iterator end = other.m_classes->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_classes->begin(); it != end; ++it)
            addClass(*it);
    }

    if (other.m_ids) {
        HashSet<AtomicString>::const_iterator end = other.m_ids->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_ids->begin(); it != end; ++it)
            addId(*it);
    }

    if (other.m_tagNames) {
        HashSet<AtomicString>::const_iterator end = other.m_tagNames->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_tagNames->begin(); it != end; ++it)
            addTagName(*it);
    }
}
Example #2
0
void StyleInvalidator::RecursionData::pushInvalidationSet(const DescendantInvalidationSet& invalidationSet)
{
    ASSERT(!m_wholeSubtreeInvalid);
    if (invalidationSet.wholeSubtreeInvalid()) {
        m_wholeSubtreeInvalid = true;
        return;
    }
    m_invalidationSets.append(&invalidationSet);
    m_invalidateCustomPseudo = invalidationSet.customPseudoInvalid();
}
void StyleInvalidator::RecursionData::pushInvalidationSet(const DescendantInvalidationSet& invalidationSet)
{
    ASSERT(!m_wholeSubtreeInvalid);
    ASSERT(!invalidationSet.wholeSubtreeInvalid());
    ASSERT(!invalidationSet.isEmpty());
    if (invalidationSet.treeBoundaryCrossing())
        m_treeBoundaryCrossing = true;
    if (invalidationSet.insertionPointCrossing())
        m_insertionPointCrossing = true;
    m_invalidationSets.append(&invalidationSet);
    m_invalidateCustomPseudo = invalidationSet.customPseudoInvalid();
}
Example #4
0
bool RuleFeatureSet::classInvalidationRequiresSubtreeRecalc(const AtomicString& className)
{
    DescendantInvalidationSet* set = m_classInvalidationSets.get(className);
    return set && set->wholeSubtreeInvalid();
}