Simplify and clarify MutationObserverRegistration interface and usage
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Sep 2012 18:35:13 +0000 (18:35 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Sep 2012 18:35:13 +0000 (18:35 +0000)
commit6986e77fed92c39318d559f18f1d87a200ff8f30
tree003ab7824309ced19a211cbe1a56261556703b1b
parent859dc68250b2241d53b82e9f33ef81afd34e9ea2
Simplify and clarify MutationObserverRegistration interface and usage
https://bugs.webkit.org/show_bug.cgi?id=97742

Reviewed by Ojan Vafai.

Minor cleanups in MutationObserverRegistration: make const methods explicitly const,
use C++ templates to avoid duplicating logic, improve usage of raw pointers vs PassRefPtr,
remove the declaration of a no-longer-existing method.

No change in behavior.

* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach): Take a raw pointer because we don't always ref the node.
(WebCore::MutationObserverRegistration::shouldReceiveMutationFrom): Make this a const method.
* dom/MutationObserverRegistration.h:
(MutationObserverRegistration): Removed declaration of non-existent caseInsensitiveAttributeFilter method.
(WebCore::MutationObserverRegistration::hasTransientRegistrations): const method.
(WebCore::MutationObserverRegistration::isSubtree): Remove superfluous "inline" keyword.
(WebCore::MutationObserverRegistration::observer): const method.
* dom/Node.cpp:
(WebCore):
(WebCore::collectMatchingObserversForMutation): Add a templatized function to reduce duplicated code.
(WebCore::Node::getRegisteredMutationObserversOfType):
(WebCore::Node::registerMutationObserver): Take a raw pointer because we don't always ref the observer.
* dom/Node.h:
(Node): Remove old method, replaced by templatized static function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/MutationObserverRegistration.cpp
Source/WebCore/dom/MutationObserverRegistration.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h