コード例 #1
0
MutableStylePropertySet::MutableStylePropertySet(const StylePropertySet& other)
    : StylePropertySet(other.cssParserMode())
{
    if (other.isMutable())
        m_propertyVector = static_cast<const MutableStylePropertySet&>(other).mutablePropertyVector();
    else {
        m_propertyVector.reserveInitialCapacity(other.propertyCount());
        for (unsigned i = 0; i < other.propertyCount(); ++i)
            m_propertyVector.uncheckedAppend(other.propertyAt(i).toCSSProperty());
    }
}
コード例 #2
0
void StylePropertySet::copyPropertiesFrom(const StylePropertySet& other)
{
    ASSERT(isMutable());

    if (other.isMutable()) {
        *m_mutablePropertyVector = *other.m_mutablePropertyVector;
        return;
    }

    ASSERT(m_mutablePropertyVector->isEmpty());
    m_mutablePropertyVector->reserveInitialCapacity(other.m_arraySize);
    for (unsigned i = 0; i < other.m_arraySize; ++i)
        m_mutablePropertyVector->uncheckedAppend(other.array()[i]);
}