[MutationObservers] attributeFilter should be case sensitive at all times
[WebKit-https.git] / Source / WebCore / dom / MutationObserverRegistration.cpp
index b8eb59487470aa89cae94f5c69bb0d2a75a29414..9bd61c99710db856f83992fdee661ef9d07273ad 100644 (file)
@@ -63,7 +63,6 @@ void MutationObserverRegistration::resetObservation(MutationObserverOptions opti
     clearTransientRegistrations();
     m_options = options;
     m_attributeFilter = attributeFilter;
-    m_caseInsensitiveAttributeFilter.clear();
 }
 
 void MutationObserverRegistration::observedSubtreeNodeWillDetach(PassRefPtr<Node> node)
@@ -115,28 +114,7 @@ bool MutationObserverRegistration::shouldReceiveMutationFrom(Node* node, WebKitM
     if (type != WebKitMutationObserver::Attributes || !(m_options & WebKitMutationObserver::AttributeFilter))
         return true;
 
-    if (m_attributeFilter.contains(attributeName))
-        return true;
-
-    if (node->document()->isHTMLDocument() && node->isHTMLElement())
-        return caseInsensitiveAttributeFilter().contains(attributeName);
-
-    return false;
-}
-
-const HashSet<AtomicString>& MutationObserverRegistration::caseInsensitiveAttributeFilter()
-{
-    if (m_caseInsensitiveAttributeFilter)
-        return *m_caseInsensitiveAttributeFilter;
-
-    m_caseInsensitiveAttributeFilter = adoptPtr(new HashSet<AtomicString>());
-    for (HashSet<AtomicString>::const_iterator iter = m_attributeFilter.begin(); iter != m_attributeFilter.end(); ++iter) {
-        AtomicString attributeNameLower = iter->lower();
-        if ((*iter) != attributeNameLower)
-             m_caseInsensitiveAttributeFilter->add(attributeNameLower);
-    }
-
-    return *m_caseInsensitiveAttributeFilter;
+    return m_attributeFilter.contains(attributeName);
 }
 
 } // namespace WebCore