Bug 535632 Crash [@ nsEditor::GetIndexOf] r=Olli

This commit is contained in:
Masayuki Nakano 2009-12-30 17:17:44 +09:00
Родитель e3b3c7d3b1
Коммит c29d6d178f
3 изменённых файлов: 9 добавлений и 3 удалений

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

@ -4025,12 +4025,16 @@ nsEditor::IsTextNode(nsIDOMNode *aNode)
PRInt32
nsEditor::GetIndexOf(nsIDOMNode *parent, nsIDOMNode *child)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(parent);
nsCOMPtr<nsINode> parentNode = do_QueryInterface(parent);
NS_PRECONDITION(parentNode, "null parentNode in nsEditor::GetIndexOf");
NS_PRECONDITION(parentNode->IsNodeOfType(nsINode::eCONTENT) ||
parentNode->IsNodeOfType(nsINode::eDOCUMENT),
"The parent node must be an element node or a document node");
nsCOMPtr<nsIContent> cChild = do_QueryInterface(child);
NS_PRECONDITION(content, "null content in nsEditor::GetIndexOf");
NS_PRECONDITION(cChild, "null content in nsEditor::GetIndexOf");
return content->IndexOf(cChild);
return parentNode->IndexOf(cChild);
}

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

@ -0,0 +1 @@
<body xmlns="http://www.w3.org/1999/xhtml" style="margin: 200px;" contenteditable="true" onload="document.execCommand('outdent', false, null);" />

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

@ -12,3 +12,4 @@ load 448329-3.html
load 456727-1.html
load 456727-2.html
load 467647-1.html
load 535632-1.xhtml