Bug 535041 Crash [@ nsContentUtils::IsInSameAnonymousTree] r=Olli
This commit is contained in:
@@ -414,6 +414,7 @@ nsINode::GetSelectionRootContent(nsIPresShell* aPresShell)
|
||||
if (!doc || doc->HasFlag(NODE_IS_EDITABLE) ||
|
||||
!HasFlag(NODE_IS_EDITABLE)) {
|
||||
nsIContent* editorRoot = GetEditorRootContent(editor);
|
||||
NS_ENSURE_TRUE(editorRoot, nsnull);
|
||||
return nsContentUtils::IsInSameAnonymousTree(this, editorRoot) ?
|
||||
editorRoot :
|
||||
GetRootForContentSubtree(static_cast<nsIContent*>(this));
|
||||
@@ -445,6 +446,7 @@ nsINode::GetSelectionRootContent(nsIPresShell* aPresShell)
|
||||
|
||||
// This node might be in another subtree, if so, we should find this subtree's
|
||||
// root. Otherwise, we can return the content simply.
|
||||
NS_ENSURE_TRUE(content, nsnull);
|
||||
return nsContentUtils::IsInSameAnonymousTree(this, content) ?
|
||||
content : GetRootForContentSubtree(static_cast<nsIContent*>(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user