Esempio n. 1
0
inline bool hasSameAttributes(const Vector<Attribute>& attributes,
                              ShareableElementData& elementData) {
  if (attributes.size() != elementData.attributes().size())
    return false;
  return !memcmp(attributes.data(), elementData.m_attributeArray,
                 attributes.size() * sizeof(Attribute));
}
Esempio n. 2
0
UniqueElementData::UniqueElementData(const ShareableElementData& other)
    : ElementData(other, true)
{
    // An ShareableElementData should never have a mutable inline StylePropertySet attached.
    ASSERT(!other.m_inlineStyle || !other.m_inlineStyle->isMutable());
    m_inlineStyle = other.m_inlineStyle;

    unsigned length = other.attributes().size();
    m_attributeVector.reserveCapacity(length);
    for (unsigned i = 0; i < length; ++i)
        m_attributeVector.uncheckedAppend(other.m_attributeArray[i]);
}