зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1417796 - Refactor AccessibleCaretManager::GetFrameSelection() to eliminate a warning. r=mtseng
Fix warning: do not use 'else' after 'return' MozReview-Commit-ID: 1jebzioHvph --HG-- extra : rebase_source : 2dda2495c996eeb37e8421e0a96e97bb8e966905
This commit is contained in:
Родитель
a8daccc87e
Коммит
5eb302904c
|
@ -785,24 +785,24 @@ AccessibleCaretManager::GetFrameSelection() const
|
|||
MOZ_ASSERT(fm);
|
||||
|
||||
nsIContent* focusedContent = fm->GetFocusedContent();
|
||||
if (focusedContent) {
|
||||
nsIFrame* focusFrame = focusedContent->GetPrimaryFrame();
|
||||
if (!focusFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Prevent us from touching the nsFrameSelection associated with other
|
||||
// PresShell.
|
||||
RefPtr<nsFrameSelection> fs = focusFrame->GetFrameSelection();
|
||||
if (!fs || fs->GetShell() != mPresShell) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return fs.forget();
|
||||
} else {
|
||||
if (!focusedContent) {
|
||||
// For non-editable content
|
||||
return mPresShell->FrameSelection();
|
||||
}
|
||||
|
||||
nsIFrame* focusFrame = focusedContent->GetPrimaryFrame();
|
||||
if (!focusFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Prevent us from touching the nsFrameSelection associated with other
|
||||
// PresShell.
|
||||
RefPtr<nsFrameSelection> fs = focusFrame->GetFrameSelection();
|
||||
if (!fs || fs->GetShell() != mPresShell) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return fs.forget();
|
||||
}
|
||||
|
||||
nsAutoString
|
||||
|
|
Загрузка…
Ссылка в новой задаче