diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 3595790c9e18..6cf9c721638d 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -7388,6 +7388,11 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL) else shell->SetCaretBidiLevel(levelAfter); } + + // The caret might have moved, so invalidate the desired X position + // for future usages of up-arrow or down-arrow + mFrameSelection->InvalidateDesiredX(); + return NS_OK; }