mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
bug 804927 - fix text control frame and accessibility issues. r=ehsan,tbsaunde
This commit is contained in:
parent
cd349de7a0
commit
5d7d9f4189
@ -1497,6 +1497,14 @@ HyperTextAccessible::GetEditor() const
|
|||||||
nsresult
|
nsresult
|
||||||
HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
|
HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
|
||||||
{
|
{
|
||||||
|
// Before setting the selection range, we need to ensure that the editor
|
||||||
|
// is initialized. (See bug 804927.)
|
||||||
|
// Otherwise, it's possible that lazy editor initialization will override
|
||||||
|
// the selection we set here and leave the caret at the end of the text.
|
||||||
|
// By calling GetEditor here, we ensure that editor initialization is
|
||||||
|
// completed before we set the selection.
|
||||||
|
nsCOMPtr<nsIEditor> editor = GetEditor();
|
||||||
|
|
||||||
bool isFocusable = InteractiveState() & states::FOCUSABLE;
|
bool isFocusable = InteractiveState() & states::FOCUSABLE;
|
||||||
|
|
||||||
// If accessible is focusable then focus it before setting the selection to
|
// If accessible is focusable then focus it before setting the selection to
|
||||||
|
@ -1198,7 +1198,7 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
|
|||||||
preDestroyer.Init(newEditor);
|
preDestroyer.Init(newEditor);
|
||||||
|
|
||||||
// Make sure we clear out the non-breaking space before we initialize the editor
|
// Make sure we clear out the non-breaking space before we initialize the editor
|
||||||
rv = mBoundFrame->UpdateValueDisplay(false, true);
|
rv = mBoundFrame->UpdateValueDisplay(true, true);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
} else {
|
} else {
|
||||||
if (aValue || !mEditorInitialized) {
|
if (aValue || !mEditorInitialized) {
|
||||||
|
Loading…
Reference in New Issue
Block a user