Bug 1411687 - part 0: Get rid of HTMLEditor::GetBlockNodeParent(nsIDOMNode*) r=m_kato

Currently, HTMLEditor::GetBlockNodeParent(nsIDOMNode*) is used only by
HTMLEditor::DoInsertHTMLWithContext() and there is a variable of nsINode*.

So, we don't need to keep it anymore.

MozReview-Commit-ID: LEWaiR5BEB9

--HG--
extra : rebase_source : 64ef772f3b7883bd4aae48dec737663e6036553b
This commit is contained in:
Masayuki Nakano 2017-10-26 22:37:45 +09:00
parent 1e17939ca3
commit bb82521595
3 changed files with 2 additions and 16 deletions

View File

@ -764,19 +764,6 @@ HTMLEditor::GetBlockNodeParent(nsINode* aNode)
return nullptr;
}
nsIDOMNode*
HTMLEditor::GetBlockNodeParent(nsIDOMNode* aNode)
{
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
if (!node) {
NS_NOTREACHED("null node passed to GetBlockNodeParent()");
return nullptr;
}
return GetAsDOMNode(GetBlockNodeParent(node));
}
/**
* Returns the node if it's a block, otherwise GetBlockNodeParent
*/

View File

@ -187,7 +187,6 @@ public:
// Block methods moved from EditorBase
static Element* GetBlockNodeParent(nsINode* aNode);
static nsIDOMNode* GetBlockNodeParent(nsIDOMNode* aNode);
static Element* GetBlock(nsINode& aNode);
void IsNextCharInNodeWhitespace(nsIContent* aContent,

View File

@ -426,8 +426,8 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
NS_ENSURE_STATE(parentNodeNode || !parentNode);
if (IsBlockNode(parentNodeNode)) {
parentBlock = parentNode;
} else {
parentBlock = GetBlockNodeParent(parentNode);
} else if (parentNodeNode) {
parentBlock = GetAsDOMNode(GetBlockNodeParent(parentNodeNode));
}
int32_t listCount = nodeList.Length();