| Index: Source/core/css/analyzer/DescendantInvalidationSet.cpp
|
| diff --git a/Source/core/css/analyzer/DescendantInvalidationSet.cpp b/Source/core/css/analyzer/DescendantInvalidationSet.cpp
|
| index 5dd11f92160fc624e143f06eb62e2d4edac98780..7b46598300aeaaf8be3b127e8ca4703e5c43301b 100644
|
| --- a/Source/core/css/analyzer/DescendantInvalidationSet.cpp
|
| +++ b/Source/core/css/analyzer/DescendantInvalidationSet.cpp
|
| @@ -69,6 +69,12 @@ void DescendantInvalidationSet::combine(const DescendantInvalidationSet& other)
|
| for (HashSet<AtomicString>::const_iterator it = other.m_tagNames->begin(); it != end; ++it)
|
| addTagName(*it);
|
| }
|
| +
|
| + if (other.m_attributes) {
|
| + HashSet<AtomicString>::const_iterator end = other.m_attributes->end();
|
| + for (HashSet<AtomicString>::const_iterator it = other.m_attributes->begin(); it != end; ++it)
|
| + addAttribute(*it);
|
| + }
|
| }
|
|
|
| HashSet<AtomicString>& DescendantInvalidationSet::ensureClassSet()
|
| @@ -92,6 +98,13 @@ HashSet<AtomicString>& DescendantInvalidationSet::ensureTagNameSet()
|
| return *m_tagNames;
|
| }
|
|
|
| +HashSet<AtomicString>& DescendantInvalidationSet::ensureAttributeSet()
|
| +{
|
| + if (!m_attributes)
|
| + m_attributes = adoptPtr(new HashSet<AtomicString>);
|
| + return *m_attributes;
|
| +}
|
| +
|
| void DescendantInvalidationSet::addClass(const AtomicString& className)
|
| {
|
| if (wholeSubtreeInvalid())
|
| @@ -113,6 +126,13 @@ void DescendantInvalidationSet::addTagName(const AtomicString& tagName)
|
| ensureTagNameSet().add(tagName);
|
| }
|
|
|
| +void DescendantInvalidationSet::addAttribute(const AtomicString& attribute)
|
| +{
|
| + if (wholeSubtreeInvalid())
|
| + return;
|
| + ensureAttributeSet().add(attribute);
|
| +}
|
| +
|
| void DescendantInvalidationSet::getClasses(Vector<AtomicString>& classes) const
|
| {
|
| if (!m_classes)
|
| @@ -121,6 +141,14 @@ void DescendantInvalidationSet::getClasses(Vector<AtomicString>& classes) const
|
| classes.append(*it);
|
| }
|
|
|
| +void DescendantInvalidationSet::getAttributes(Vector<AtomicString>& attributes) const
|
| +{
|
| + if (!m_attributes)
|
| + return;
|
| + for (HashSet<AtomicString>::const_iterator it = m_attributes->begin(); it != m_attributes->end(); ++it)
|
| + attributes.append(*it);
|
| +}
|
| +
|
| void DescendantInvalidationSet::setWholeSubtreeInvalid()
|
| {
|
| if (m_allDescendantsMightBeInvalid)
|
| @@ -130,6 +158,7 @@ void DescendantInvalidationSet::setWholeSubtreeInvalid()
|
| m_classes = nullptr;
|
| m_ids = nullptr;
|
| m_tagNames = nullptr;
|
| + m_attributes = nullptr;
|
| }
|
|
|
| } // namespace WebCore
|
|
|