fix for bug 19130 - hitting escape during ime entry can leave editor without a caret. r=kin
git-svn-id: svn://10.0.0.236/trunk@55324 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c031503852
commit
c211707ae9
@ -225,6 +225,9 @@ nsHTMLEditRules::DidDoAction(nsIDOMSelection *aSelection,
|
||||
}
|
||||
// adjust selection
|
||||
res = AdjustSelection(aSelection,info->collapsedAction);
|
||||
if (NS_FAILED(res)) return res;
|
||||
// detect empty doc
|
||||
res = CreateBogusNodeIfNeeded(aSelection);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -1247,6 +1247,9 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsIDOMSelection *aSelection)
|
||||
nsAutoString val(nsEditor::kMOZEditorBogusNodeValue);
|
||||
newPElement->SetAttribute(att, val);
|
||||
}
|
||||
|
||||
// set selection
|
||||
aSelection->Collapse(bodyNode,0);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -225,6 +225,9 @@ nsHTMLEditRules::DidDoAction(nsIDOMSelection *aSelection,
|
||||
}
|
||||
// adjust selection
|
||||
res = AdjustSelection(aSelection,info->collapsedAction);
|
||||
if (NS_FAILED(res)) return res;
|
||||
// detect empty doc
|
||||
res = CreateBogusNodeIfNeeded(aSelection);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -1247,6 +1247,9 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsIDOMSelection *aSelection)
|
||||
nsAutoString val(nsEditor::kMOZEditorBogusNodeValue);
|
||||
newPElement->SetAttribute(att, val);
|
||||
}
|
||||
|
||||
// set selection
|
||||
aSelection->Collapse(bodyNode,0);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user