зеркало из https://github.com/mozilla/pjs.git
fix for bug 19130 - hitting escape during ime entry can leave editor without a caret. r=kin
This commit is contained in:
Родитель
d2b3fa8d6f
Коммит
c4212ffcdf
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче