Esempio n. 1
0
MutableElementAttributeData::MutableElementAttributeData(const ImmutableElementAttributeData& other)
    : ElementAttributeData(other, true)
{
    // An ImmutableElementAttributeData should never have a mutable inline StylePropertySet attached.
    ASSERT(!other.m_inlineStyle || !other.m_inlineStyle->isMutable());
    m_inlineStyle = other.m_inlineStyle;

    m_attributeVector.reserveCapacity(other.length());
    for (unsigned i = 0; i < other.length(); ++i)
        m_attributeVector.uncheckedAppend(other.immutableAttributeArray()[i]);
}
Esempio n. 2
0
MutableElementAttributeData::MutableElementAttributeData(const ImmutableElementAttributeData& other)
{
    const ElementAttributeData& baseOther = static_cast<const ElementAttributeData&>(other);

    m_inlineStyleDecl = baseOther.m_inlineStyleDecl;
    m_attributeStyle = baseOther.m_attributeStyle;
    m_classNames = baseOther.m_classNames;
    m_idForStyleResolution = baseOther.m_idForStyleResolution;

    // An ImmutableElementAttributeData should never have a mutable inline StylePropertySet attached.
    ASSERT(!baseOther.m_inlineStyleDecl || !baseOther.m_inlineStyleDecl->isMutable());

    m_attributeVector.reserveCapacity(baseOther.m_arraySize);
    for (unsigned i = 0; i < baseOther.m_arraySize; ++i)
        m_attributeVector.uncheckedAppend(other.immutableAttributeArray()[i]);
}