| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/SynchronousMutationNotifier.h" | 5 #include "core/dom/SynchronousMutationNotifier.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/SynchronousMutationObserver.h" | 8 #include "core/dom/SynchronousMutationObserver.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 SynchronousMutationNotifier::SynchronousMutationNotifier() = default; | 12 SynchronousMutationNotifier::SynchronousMutationNotifier() = default; |
| 13 | 13 |
| 14 void SynchronousMutationNotifier::notifyChangeChildren( | 14 void SynchronousMutationNotifier::notifyChangeChildren( |
| 15 const ContainerNode& container) { | 15 const ContainerNode& container) { |
| 16 for (SynchronousMutationObserver* observer : m_observers) | 16 for (SynchronousMutationObserver* observer : m_observers) |
| 17 observer->didChangeChildren(container); | 17 observer->didChangeChildren(container); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void SynchronousMutationNotifier::notifyMergeTextNodes(Text& node, | 20 void SynchronousMutationNotifier::notifyMergeTextNodes( |
| 21 unsigned offset) { | 21 const Text& node, |
| 22 const NodeWithIndex& nodeToBeRemovedWithIndex, |
| 23 unsigned oldLength) { |
| 22 for (SynchronousMutationObserver* observer : m_observers) | 24 for (SynchronousMutationObserver* observer : m_observers) |
| 23 observer->didMergeTextNodes(node, offset); | 25 observer->didMergeTextNodes(node, nodeToBeRemovedWithIndex, oldLength); |
| 24 } | 26 } |
| 25 | 27 |
| 26 void SynchronousMutationNotifier::notifyMoveTreeToNewDocument( | 28 void SynchronousMutationNotifier::notifyMoveTreeToNewDocument( |
| 27 const Node& root) { | 29 const Node& root) { |
| 28 for (SynchronousMutationObserver* observer : m_observers) | 30 for (SynchronousMutationObserver* observer : m_observers) |
| 29 observer->didMoveTreeToNewDocument(root); | 31 observer->didMoveTreeToNewDocument(root); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void SynchronousMutationNotifier::notifySplitTextNode(const Text& node) { | 34 void SynchronousMutationNotifier::notifySplitTextNode(const Text& node) { |
| 33 for (SynchronousMutationObserver* observer : m_observers) | 35 for (SynchronousMutationObserver* observer : m_observers) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 50 for (SynchronousMutationObserver* observer : m_observers) | 52 for (SynchronousMutationObserver* observer : m_observers) |
| 51 observer->nodeChildrenWillBeRemoved(container); | 53 observer->nodeChildrenWillBeRemoved(container); |
| 52 } | 54 } |
| 53 | 55 |
| 54 void SynchronousMutationNotifier::notifyNodeWillBeRemoved(Node& node) { | 56 void SynchronousMutationNotifier::notifyNodeWillBeRemoved(Node& node) { |
| 55 for (SynchronousMutationObserver* observer : m_observers) | 57 for (SynchronousMutationObserver* observer : m_observers) |
| 56 observer->nodeWillBeRemoved(node); | 58 observer->nodeWillBeRemoved(node); |
| 57 } | 59 } |
| 58 | 60 |
| 59 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |