| Index: third_party/WebKit/Source/core/dom/SynchronousMutationObserver.h
|
| diff --git a/third_party/WebKit/Source/core/dom/SynchronousMutationObserver.h b/third_party/WebKit/Source/core/dom/SynchronousMutationObserver.h
|
| index 7a4c3005f496d4541a94ecc57800b5486fdf1b25..16b57149442987d561e0d48a06f808b2747400e8 100644
|
| --- a/third_party/WebKit/Source/core/dom/SynchronousMutationObserver.h
|
| +++ b/third_party/WebKit/Source/core/dom/SynchronousMutationObserver.h
|
| @@ -14,42 +14,35 @@ namespace blink {
|
| class CharacterData;
|
| class ContainerNode;
|
| class Document;
|
| +class Element;
|
| +class Node;
|
| +class NodeWithIndex;
|
| class Text;
|
|
|
| // This class is a base class for classes which observe DOM tree mutation
|
| // synchronously. If you want to observe DOM tree mutation asynchronously see
|
| // MutationObserver Web API.
|
| -//
|
| -// TODO(yosin): Following classes should be derived from this class to
|
| -// simplify Document class.
|
| -// - DragCaretController
|
| -// - DocumentMarkerController
|
| -// - EventHandler
|
| -// - FrameCaret
|
| -// - InputMethodController
|
| -// - SelectionController
|
| -// - Range set
|
| -// - NodeIterator set
|
| class CORE_EXPORT SynchronousMutationObserver
|
| : public LifecycleObserver<Document, SynchronousMutationObserver> {
|
| public:
|
| - // TODO(yosin): We will have following member functions:
|
| - // - dataWillBeChanged(const CharacterData&);
|
| - // - didMoveTreeToNewDocument(const Node& root);
|
| - // - didInsertText(Node*, unsigned offset, unsigned length);
|
| - // - didRemoveText(Node*, unsigned offset, unsigned length);
|
| + // Called just after attribute is changed.
|
| + virtual void didChangeAttribute(const Element&);
|
|
|
| // Called after child nodes changed.
|
| virtual void didChangeChildren(const ContainerNode&);
|
|
|
| - // TODO(yosin): We should use |const Text& oldNode|.
|
| - // Called after characters in |oldNode| is appended at |offset| in
|
| - // |oldNdoe->previousSibling()|.
|
| - virtual void didMergeTextNodes(Text& oldNode, unsigned offset);
|
| + // Called after characters in |nodeToBeRemoved| is appended into |mergedNode|.
|
| + // |oldLength| holds length of |mergedNode| before merge.
|
| + virtual void didMergeTextNodes(const Text& mergedNode,
|
| + const NodeWithIndex& nodeToBeRemovedWithIndex,
|
| + unsigned oldLength);
|
|
|
| - // Called when |Text| node is split, next sibling |oldNode| contains
|
| - // characters after split point.
|
| - virtual void didSplitTextNode(const Text& oldNode);
|
| + // Called just after node tree is moved to new document.
|
| + virtual void didMoveTreeToNewDocument();
|
| +
|
| + // Called after |Text| node is split, |splitNode->nextSibling()| contains
|
| + // character after split offset.
|
| + virtual void didSplitTextNode(const Text& splitNode);
|
|
|
| // Called when |CharacterData| is updated at |offset|, |oldLength| is a
|
| // number of deleted character and |newLength| is a number of added
|
|
|