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

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

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

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

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