Bug 343532. Fix crasher when calling FindNextNode on the root node. r+sr=mscott
git-svn-id: svn://10.0.0.236/trunk@201598 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -124,6 +124,10 @@ FindNextNode(nsIDOMNode* aNode, nsIDOMNode* aRoot,
|
||||
aNode->GetFirstChild(getter_AddRefs(next));
|
||||
if (next)
|
||||
return next;
|
||||
|
||||
// Don't look at siblings or otherwise outside of aRoot
|
||||
if (aNode == aRoot)
|
||||
return nsnull;
|
||||
|
||||
aNode->GetNextSibling(getter_AddRefs(next));
|
||||
if (next)
|
||||
@@ -605,7 +609,7 @@ mozInlineSpellWordUtil::BuildSoftText()
|
||||
|
||||
CheckLeavingBreakElementClosure closure = { mCSSView, PR_FALSE };
|
||||
node = FindNextNode(node, mRootNode, CheckLeavingBreakElement, &closure);
|
||||
if (closure.mLeftBreakElement || IsBreakElement(mCSSView, node)) {
|
||||
if (closure.mLeftBreakElement || (node && IsBreakElement(mCSSView, node))) {
|
||||
// We left, or are entering, a break element (e.g., block). Maybe we can
|
||||
// stop now.
|
||||
if (seenSoftEnd)
|
||||
|
||||
Reference in New Issue
Block a user