mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 755310 - Use nsINode::Length() in nsEditor::CreateTxnForDeleteInsertionPoint; r=ehsan
This commit is contained in:
parent
b0334f9c09
commit
63c3854253
@ -4825,19 +4825,10 @@ nsEditor::CreateTxnForDeleteInsertionPoint(nsIDOMRange *aRange,
|
||||
|
||||
// determine if the insertion point is at the beginning, middle, or end of the node
|
||||
nsCOMPtr<nsIDOMCharacterData> nodeAsText = do_QueryInterface(node);
|
||||
nsCOMPtr<nsINode> inode = do_QueryInterface(node);
|
||||
MOZ_ASSERT(inode);
|
||||
|
||||
PRUint32 count=0;
|
||||
|
||||
if (nodeAsText)
|
||||
nodeAsText->GetLength(&count);
|
||||
else
|
||||
{
|
||||
// get the child list and count
|
||||
nsCOMPtr<nsIDOMNodeList>childList;
|
||||
result = node->GetChildNodes(getter_AddRefs(childList));
|
||||
if ((NS_SUCCEEDED(result)) && childList)
|
||||
childList->GetLength(&count);
|
||||
}
|
||||
PRUint32 count = inode->Length();
|
||||
|
||||
bool isFirst = (0 == offset);
|
||||
bool isLast = (count == (PRUint32)offset);
|
||||
|
Loading…
Reference in New Issue
Block a user