Lines Matching refs:attributes
34 inline unsigned attributeHash(const Vector<Attribute>& attributes)
36 return StringHasher::hashMemory(attributes.data(), attributes.size() * sizeof(Attribute));
39 inline bool hasSameAttributes(const Vector<Attribute>& attributes, ShareableElementData& elementData)
41 if (attributes.size() != elementData.length())
43 return !memcmp(attributes.data(), elementData.m_attributeArray, attributes.size() * sizeof(Attribute));
46 PassRef<ShareableElementData> DocumentSharedObjectPool::cachedShareableElementDataWithAttributes(const Vector<Attribute>& attributes)
48 ASSERT(!attributes.isEmpty());
50 auto& cachedData = m_shareableElementDataCache.add(attributeHash(attributes), nullptr).iterator->value;
53 if (cachedData && !hasSameAttributes(attributes, *cachedData))
54 return ShareableElementData::createWithAttributes(attributes);
57 cachedData = ShareableElementData::createWithAttributes(attributes);