Bug 1431336. r=smaug a=abillings

--HG--
extra : rebase_source : 883af4d45ba7c29e1e67d22fc00d4442a3434fcc
This commit is contained in:
Makoto Kato 2018-02-19 12:14:00 +09:00
parent 35b53a22df
commit 8a6cab48a9

View File

@ -868,7 +868,7 @@ TextInputListener::OnSelectionChange(Selection& aSelection,
mSelectionWasCollapsed = collapsed;
if (!weakFrame.IsAlive() ||
if (!weakFrame.IsAlive() || !mFrame ||
!nsContentUtils::IsFocusedContent(mFrame->GetContent())) {
return;
}
@ -1712,8 +1712,9 @@ nsTextEditorState::SetSelectionRange(uint32_t aStart, uint32_t aEnd,
props.SetEnd(aEnd);
props.SetDirection(aDirection);
} else {
WeakPtr<nsTextEditorState> self(this);
aRv = mBoundFrame->SetSelectionRange(aStart, aEnd, aDirection);
if (aRv.Failed()) {
if (aRv.Failed() || !self.get()) {
return;
}
rv = mBoundFrame->ScrollSelectionIntoView();