Bug 1451672 - part 22: Rename HTMLEditor::InsertNodeIntoProperAncestor() to HTMLEditor::InsertNodeIntoProperAncestorWithTransaction() r=m_kato

MozReview-Commit-ID: 6O47YeSpud8

--HG--
extra : rebase_source : 27dfc30cb50dbd0cc31493ed087ffae8744b3017
This commit is contained in:
Masayuki Nakano 2018-04-16 23:53:46 +09:00
Родитель 043e93a8ba
Коммит cb6f42437a
3 изменённых файлов: 22 добавлений и 21 удалений

Просмотреть файл

@ -89,12 +89,12 @@ IsNamedAnchorTag(const nsString& s)
}
template EditorDOMPoint
HTMLEditor::InsertNodeIntoProperAncestor(
HTMLEditor::InsertNodeIntoProperAncestorWithTransaction(
nsIContent& aNode,
const EditorDOMPoint& aPointToInsert,
SplitAtEdges aSplitAtEdges);
template EditorDOMPoint
HTMLEditor::InsertNodeIntoProperAncestor(
HTMLEditor::InsertNodeIntoProperAncestorWithTransaction(
nsIContent& aNode,
const EditorRawDOMPoint& aPointToInsert,
SplitAtEdges aSplitAtEdges);
@ -1578,7 +1578,7 @@ HTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement,
}
EditorDOMPoint insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*element, pointToInsert, SplitAtEdges::eAllowToCreateEmptyContainer);
if (NS_WARN_IF(!insertedPoint.IsSet())) {
return NS_ERROR_FAILURE;
@ -1611,7 +1611,7 @@ HTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement,
template<typename PT, typename CT>
EditorDOMPoint
HTMLEditor::InsertNodeIntoProperAncestor(
HTMLEditor::InsertNodeIntoProperAncestorWithTransaction(
nsIContent& aNode,
const EditorDOMPointBase<PT, CT>& aPointToInsert,
SplitAtEdges aSplitAtEdges)

Просмотреть файл

@ -443,15 +443,15 @@ public:
nsresult OnInputLineBreak();
/**
* InsertNodeIntoProperAncestor() attempts to insert aNode into the document,
* at aPointToInsert. Checks with strict dtd to see if containment is
* allowed. If not allowed, will attempt to find a parent in the parent
* hierarchy of aPointToInsert.GetContainer() that will accept aNode as a
* child. If such a parent is found, will split the document tree from
* aPointToInsert up to parent, and then insert aNode. aPointToInsert is then
* adjusted to point to the actual location that aNode was inserted at.
* aSplitAtEdges specifies if the splitting process is allowed to result in
* empty nodes.
* InsertNodeIntoProperAncestorWithTransaction() attempts to insert aNode
* into the document, at aPointToInsert. Checks with strict dtd to see if
* containment is allowed. If not allowed, will attempt to find a parent
* in the parent hierarchy of aPointToInsert.GetContainer() that will accept
* aNode as a child. If such a parent is found, will split the document
* tree from aPointToInsert up to parent, and then insert aNode.
* aPointToInsert is then adjusted to point to the actual location that
* aNode was inserted at. aSplitAtEdges specifies if the splitting process
* is allowed to result in empty nodes.
*
* @param aNode Node to insert.
* @param aPointToInsert Insertion point.
@ -461,9 +461,10 @@ public:
*/
template<typename PT, typename CT>
EditorDOMPoint
InsertNodeIntoProperAncestor(nsIContent& aNode,
const EditorDOMPointBase<PT, CT>& aPointToInsert,
SplitAtEdges aSplitAtEdges);
InsertNodeIntoProperAncestorWithTransaction(
nsIContent& aNode,
const EditorDOMPointBase<PT, CT>& aPointToInsert,
SplitAtEdges aSplitAtEdges);
/**
* Use this to assure that selection is set after attribute nodes when

Просмотреть файл

@ -464,7 +464,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
firstChild;
firstChild = curNode->GetFirstChild()) {
EditorDOMPoint insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*firstChild, pointToInsert,
SplitAtEdges::eDoNotCreateEmptyContainer);
if (NS_WARN_IF(!insertedPoint.IsSet())) {
@ -506,7 +506,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
}
}
EditorDOMPoint insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*firstChild, pointToInsert,
SplitAtEdges::eDoNotCreateEmptyContainer);
if (NS_WARN_IF(!insertedPoint.IsSet())) {
@ -535,7 +535,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
firstChild;
firstChild = curNode->GetFirstChild()) {
EditorDOMPoint insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*firstChild, pointToInsert,
SplitAtEdges::eDoNotCreateEmptyContainer);
if (NS_WARN_IF(!insertedPoint.IsSet())) {
@ -554,7 +554,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
if (!bDidInsert || NS_FAILED(rv)) {
// Try to insert.
EditorDOMPoint insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*curNode->AsContent(), pointToInsert,
SplitAtEdges::eDoNotCreateEmptyContainer);
if (insertedPoint.IsSet()) {
@ -574,7 +574,7 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
}
nsCOMPtr<nsINode> oldParent = content->GetParentNode();
insertedPoint =
InsertNodeIntoProperAncestor(
InsertNodeIntoProperAncestorWithTransaction(
*content->GetParent(), pointToInsert,
SplitAtEdges::eDoNotCreateEmptyContainer);
if (insertedPoint.IsSet()) {