Remove getNodesInCommand debug method from Editing commands
These methods appear to be for debugging and nothing ever calls them. It's a bit
strange to want a hash set of every node all commands in the hierachy touched
as well since they're not ordered so the set doesn't really tell you what the
command did anyway.
Review URL: https://chromiumcodereview.appspot.com/23739003
git-svn-id: svn://svn.chromium.org/blink/trunk@157191 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/Source/core/editing/AppendNodeCommand.cpp b/Source/core/editing/AppendNodeCommand.cpp
index f72b893..e8047c9 100644
--- a/Source/core/editing/AppendNodeCommand.cpp
+++ b/Source/core/editing/AppendNodeCommand.cpp
@@ -59,12 +59,4 @@
m_node->remove(IGNORE_EXCEPTION);
}
-#ifndef NDEBUG
-void AppendNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_parent.get(), nodes);
- addNodeAndDescendants(m_node.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/AppendNodeCommand.h b/Source/core/editing/AppendNodeCommand.h
index 5587d67..1f7a5ae 100644
--- a/Source/core/editing/AppendNodeCommand.h
+++ b/Source/core/editing/AppendNodeCommand.h
@@ -43,10 +43,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<ContainerNode> m_parent;
RefPtr<Node> m_node;
};
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index 38528c9..0bbc54e 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -144,15 +144,6 @@
m_endingRootEditableElement = selection.rootEditableElement();
}
-#ifndef NDEBUG
-void EditCommandComposition::getNodesInCommand(HashSet<Node*>& nodes)
-{
- size_t size = m_commands.size();
- for (size_t i = 0; i < size; ++i)
- m_commands[i]->getNodesInCommand(nodes);
-}
-#endif
-
void applyCommand(PassRefPtr<CompositeEditCommand> command)
{
command->apply();
diff --git a/Source/core/editing/CompositeEditCommand.h b/Source/core/editing/CompositeEditCommand.h
index ec0d2d4..c738cb4 100644
--- a/Source/core/editing/CompositeEditCommand.h
+++ b/Source/core/editing/CompositeEditCommand.h
@@ -55,10 +55,6 @@
Element* startingRootEditableElement() const { return m_startingRootEditableElement.get(); }
Element* endingRootEditableElement() const { return m_endingRootEditableElement.get(); }
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&);
-#endif
-
private:
EditCommandComposition(Document*, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction);
diff --git a/Source/core/editing/DeleteFromTextNodeCommand.cpp b/Source/core/editing/DeleteFromTextNodeCommand.cpp
index 03fb87e0..6bc1612 100644
--- a/Source/core/editing/DeleteFromTextNodeCommand.cpp
+++ b/Source/core/editing/DeleteFromTextNodeCommand.cpp
@@ -69,11 +69,4 @@
m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION, DeprecatedAttachNow);
}
-#ifndef NDEBUG
-void DeleteFromTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_node.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/DeleteFromTextNodeCommand.h b/Source/core/editing/DeleteFromTextNodeCommand.h
index 688c117..192e8a9 100644
--- a/Source/core/editing/DeleteFromTextNodeCommand.h
+++ b/Source/core/editing/DeleteFromTextNodeCommand.h
@@ -45,10 +45,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Text> m_node;
unsigned m_offset;
unsigned m_count;
diff --git a/Source/core/editing/EditCommand.cpp b/Source/core/editing/EditCommand.cpp
index 824beaf..7fdf04e 100644
--- a/Source/core/editing/EditCommand.cpp
+++ b/Source/core/editing/EditCommand.cpp
@@ -110,12 +110,4 @@
doApply();
}
-#ifndef NDEBUG
-void SimpleEditCommand::addNodeAndDescendants(Node* startNode, HashSet<Node*>& nodes)
-{
- for (Node* node = startNode; node; node = NodeTraversal::next(node, startNode))
- nodes.add(node);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/EditCommand.h b/Source/core/editing/EditCommand.h
index 517259b..41d3edf 100644
--- a/Source/core/editing/EditCommand.h
+++ b/Source/core/editing/EditCommand.h
@@ -83,17 +83,9 @@
virtual void doUnapply() = 0;
virtual void doReapply(); // calls doApply()
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) = 0;
-#endif
-
protected:
explicit SimpleEditCommand(Document& document) : EditCommand(document) { }
-#ifndef NDEBUG
- void addNodeAndDescendants(Node*, HashSet<Node*>&);
-#endif
-
private:
virtual bool isSimpleEditCommand() const OVERRIDE { return true; }
};
diff --git a/Source/core/editing/InsertIntoTextNodeCommand.cpp b/Source/core/editing/InsertIntoTextNodeCommand.cpp
index d2ddc99..cf6ffd2 100644
--- a/Source/core/editing/InsertIntoTextNodeCommand.cpp
+++ b/Source/core/editing/InsertIntoTextNodeCommand.cpp
@@ -71,11 +71,4 @@
m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION, DeprecatedAttachNow);
}
-#ifndef NDEBUG
-void InsertIntoTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_node.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/InsertIntoTextNodeCommand.h b/Source/core/editing/InsertIntoTextNodeCommand.h
index d8eea7a..9764aa8 100644
--- a/Source/core/editing/InsertIntoTextNodeCommand.h
+++ b/Source/core/editing/InsertIntoTextNodeCommand.h
@@ -45,10 +45,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Text> m_node;
unsigned m_offset;
String m_text;
diff --git a/Source/core/editing/InsertNodeBeforeCommand.cpp b/Source/core/editing/InsertNodeBeforeCommand.cpp
index f6872e7..16ff925 100644
--- a/Source/core/editing/InsertNodeBeforeCommand.cpp
+++ b/Source/core/editing/InsertNodeBeforeCommand.cpp
@@ -64,12 +64,4 @@
m_insertChild->remove(IGNORE_EXCEPTION);
}
-#ifndef NDEBUG
-void InsertNodeBeforeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_insertChild.get(), nodes);
- addNodeAndDescendants(m_refChild.get(), nodes);
-}
-#endif
-
}
diff --git a/Source/core/editing/InsertNodeBeforeCommand.h b/Source/core/editing/InsertNodeBeforeCommand.h
index 8e4b440..6fc3b3c 100644
--- a/Source/core/editing/InsertNodeBeforeCommand.h
+++ b/Source/core/editing/InsertNodeBeforeCommand.h
@@ -44,10 +44,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Node> m_insertChild;
RefPtr<Node> m_refChild;
ShouldAssumeContentIsAlwaysEditable m_shouldAssumeContentIsAlwaysEditable;
diff --git a/Source/core/editing/MergeIdenticalElementsCommand.cpp b/Source/core/editing/MergeIdenticalElementsCommand.cpp
index e94a7fb..2ae2dbb 100644
--- a/Source/core/editing/MergeIdenticalElementsCommand.cpp
+++ b/Source/core/editing/MergeIdenticalElementsCommand.cpp
@@ -86,12 +86,4 @@
m_element1->appendChild(children[i].release(), es);
}
-#ifndef NDEBUG
-void MergeIdenticalElementsCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_element1.get(), nodes);
- addNodeAndDescendants(m_element2.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/MergeIdenticalElementsCommand.h b/Source/core/editing/MergeIdenticalElementsCommand.h
index 0b1003d..42dd8a8 100644
--- a/Source/core/editing/MergeIdenticalElementsCommand.h
+++ b/Source/core/editing/MergeIdenticalElementsCommand.h
@@ -43,10 +43,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Element> m_element1;
RefPtr<Element> m_element2;
RefPtr<Node> m_atChild;
diff --git a/Source/core/editing/RemoveCSSPropertyCommand.cpp b/Source/core/editing/RemoveCSSPropertyCommand.cpp
index dcc258b..6daa841 100644
--- a/Source/core/editing/RemoveCSSPropertyCommand.cpp
+++ b/Source/core/editing/RemoveCSSPropertyCommand.cpp
@@ -63,11 +63,4 @@
m_element->style()->setPropertyInternal(m_property, m_oldValue, m_important, IGNORE_EXCEPTION);
}
-#ifndef NDEBUG
-void RemoveCSSPropertyCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_element.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/RemoveCSSPropertyCommand.h b/Source/core/editing/RemoveCSSPropertyCommand.h
index d64a71b..85d6156 100644
--- a/Source/core/editing/RemoveCSSPropertyCommand.h
+++ b/Source/core/editing/RemoveCSSPropertyCommand.h
@@ -47,10 +47,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Element> m_element;
CSSPropertyID m_property;
String m_oldValue;
diff --git a/Source/core/editing/RemoveNodeCommand.cpp b/Source/core/editing/RemoveNodeCommand.cpp
index 8f269ef..0640559 100644
--- a/Source/core/editing/RemoveNodeCommand.cpp
+++ b/Source/core/editing/RemoveNodeCommand.cpp
@@ -65,13 +65,4 @@
parent->insertBefore(m_node.get(), refChild.get(), IGNORE_EXCEPTION);
}
-#ifndef NDEBUG
-void RemoveNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_parent.get(), nodes);
- addNodeAndDescendants(m_refChild.get(), nodes);
- addNodeAndDescendants(m_node.get(), nodes);
-}
-#endif
-
}
diff --git a/Source/core/editing/RemoveNodeCommand.h b/Source/core/editing/RemoveNodeCommand.h
index d34fe2e..5d15512 100644
--- a/Source/core/editing/RemoveNodeCommand.h
+++ b/Source/core/editing/RemoveNodeCommand.h
@@ -43,10 +43,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Node> m_node;
RefPtr<ContainerNode> m_parent;
RefPtr<Node> m_refChild;
diff --git a/Source/core/editing/ReplaceNodeWithSpanCommand.cpp b/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
index e09b6a1..6274c07 100644
--- a/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
@@ -81,12 +81,4 @@
swapInNodePreservingAttributesAndChildren(m_elementToReplace.get(), m_spanElement.get());
}
-#ifndef NDEBUG
-void ReplaceNodeWithSpanCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_elementToReplace.get(), nodes);
- addNodeAndDescendants(m_spanElement.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/ReplaceNodeWithSpanCommand.h b/Source/core/editing/ReplaceNodeWithSpanCommand.h
index 4282b2c..e9e8afe 100644
--- a/Source/core/editing/ReplaceNodeWithSpanCommand.h
+++ b/Source/core/editing/ReplaceNodeWithSpanCommand.h
@@ -53,10 +53,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<HTMLElement> m_elementToReplace;
RefPtr<HTMLElement> m_spanElement;
};
diff --git a/Source/core/editing/SetNodeAttributeCommand.cpp b/Source/core/editing/SetNodeAttributeCommand.cpp
index 1218e02..b4bd12f 100644
--- a/Source/core/editing/SetNodeAttributeCommand.cpp
+++ b/Source/core/editing/SetNodeAttributeCommand.cpp
@@ -54,11 +54,4 @@
m_oldValue = nullString;
}
-#ifndef NDEBUG
-void SetNodeAttributeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_element.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/SetNodeAttributeCommand.h b/Source/core/editing/SetNodeAttributeCommand.h
index 6c218c5..5716b61 100644
--- a/Source/core/editing/SetNodeAttributeCommand.h
+++ b/Source/core/editing/SetNodeAttributeCommand.h
@@ -44,10 +44,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Element> m_element;
QualifiedName m_attribute;
AtomicString m_value;
diff --git a/Source/core/editing/SetSelectionCommand.h b/Source/core/editing/SetSelectionCommand.h
index 2ba2014..b4f09af 100644
--- a/Source/core/editing/SetSelectionCommand.h
+++ b/Source/core/editing/SetSelectionCommand.h
@@ -44,10 +44,6 @@
virtual void doApply() OVERRIDE;
virtual void doUnapply() OVERRIDE;
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE { }
-#endif
-
FrameSelection::SetSelectionOptions m_options;
VisibleSelection m_selectionToSet;
};
diff --git a/Source/core/editing/SplitElementCommand.cpp b/Source/core/editing/SplitElementCommand.cpp
index 11ec640..e4227ca 100644
--- a/Source/core/editing/SplitElementCommand.cpp
+++ b/Source/core/editing/SplitElementCommand.cpp
@@ -107,13 +107,4 @@
executeApply();
}
-#ifndef NDEBUG
-void SplitElementCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_element1.get(), nodes);
- addNodeAndDescendants(m_element2.get(), nodes);
- addNodeAndDescendants(m_atChild.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/SplitElementCommand.h b/Source/core/editing/SplitElementCommand.h
index c873826..a87b5a2 100644
--- a/Source/core/editing/SplitElementCommand.h
+++ b/Source/core/editing/SplitElementCommand.h
@@ -45,10 +45,6 @@
virtual void doReapply() OVERRIDE;
void executeApply();
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Element> m_element1;
RefPtr<Element> m_element2;
RefPtr<Node> m_atChild;
diff --git a/Source/core/editing/SplitTextNodeCommand.cpp b/Source/core/editing/SplitTextNodeCommand.cpp
index 81f38af..1399154 100644
--- a/Source/core/editing/SplitTextNodeCommand.cpp
+++ b/Source/core/editing/SplitTextNodeCommand.cpp
@@ -103,12 +103,4 @@
m_text2->deleteData(0, m_offset, es, DeprecatedAttachNow);
}
-#ifndef NDEBUG
-void SplitTextNodeCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_text1.get(), nodes);
- addNodeAndDescendants(m_text2.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/SplitTextNodeCommand.h b/Source/core/editing/SplitTextNodeCommand.h
index 36503c1..27e0cb4 100644
--- a/Source/core/editing/SplitTextNodeCommand.h
+++ b/Source/core/editing/SplitTextNodeCommand.h
@@ -47,10 +47,6 @@
virtual void doReapply() OVERRIDE;
void insertText1AndTrimText2();
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Text> m_text1;
RefPtr<Text> m_text2;
unsigned m_offset;
diff --git a/Source/core/editing/WrapContentsInDummySpanCommand.cpp b/Source/core/editing/WrapContentsInDummySpanCommand.cpp
index 67b029f..dc52909 100644
--- a/Source/core/editing/WrapContentsInDummySpanCommand.cpp
+++ b/Source/core/editing/WrapContentsInDummySpanCommand.cpp
@@ -87,12 +87,4 @@
executeApply();
}
-#ifndef NDEBUG
-void WrapContentsInDummySpanCommand::getNodesInCommand(HashSet<Node*>& nodes)
-{
- addNodeAndDescendants(m_element.get(), nodes);
- addNodeAndDescendants(m_dummySpan.get(), nodes);
-}
-#endif
-
} // namespace WebCore
diff --git a/Source/core/editing/WrapContentsInDummySpanCommand.h b/Source/core/editing/WrapContentsInDummySpanCommand.h
index 514f305..be7f4b6 100644
--- a/Source/core/editing/WrapContentsInDummySpanCommand.h
+++ b/Source/core/editing/WrapContentsInDummySpanCommand.h
@@ -47,10 +47,6 @@
virtual void doReapply() OVERRIDE;
void executeApply();
-#ifndef NDEBUG
- virtual void getNodesInCommand(HashSet<Node*>&) OVERRIDE;
-#endif
-
RefPtr<Element> m_element;
RefPtr<HTMLElement> m_dummySpan;
};