mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
fix 76003. fix bidi rendering context state corrupting
check in for simon@softel.co.il r=dbaron@fas.harvard.edu sr=kin@netscape.com
This commit is contained in:
parent
aeaf1bf4a4
commit
6ffc96481f
@ -1016,12 +1016,24 @@ void nsCaret::DrawCaret()
|
||||
{
|
||||
if (bidiLevel != mKeyboardRTL)
|
||||
{
|
||||
/* if the caret bidi level and the keyboard language direction are not in
|
||||
* synch, the keyboard language must have been changed by the
|
||||
* user, and if the caret is in a boundary condition (between left-to-right and
|
||||
* right-to-left characters) it may have to change position to
|
||||
* reflect the location in which the next character typed will
|
||||
* appear. We will call |SelectionLanguageChange| and exit
|
||||
* without drawing the caret in the old position.
|
||||
*/
|
||||
mKeyboardRTL = bidiLevel;
|
||||
nsCOMPtr<nsISelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
||||
if (domSelection)
|
||||
{
|
||||
if (NS_SUCCEEDED(domSelection->SelectionLanguageChange(mKeyboardRTL)))
|
||||
{
|
||||
PRBool emptyClip;
|
||||
mRendContext->PopState(emptyClip);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If keyboard language is RTL, draw the hook on the left; if LTR, to the right
|
||||
|
@ -1016,12 +1016,24 @@ void nsCaret::DrawCaret()
|
||||
{
|
||||
if (bidiLevel != mKeyboardRTL)
|
||||
{
|
||||
/* if the caret bidi level and the keyboard language direction are not in
|
||||
* synch, the keyboard language must have been changed by the
|
||||
* user, and if the caret is in a boundary condition (between left-to-right and
|
||||
* right-to-left characters) it may have to change position to
|
||||
* reflect the location in which the next character typed will
|
||||
* appear. We will call |SelectionLanguageChange| and exit
|
||||
* without drawing the caret in the old position.
|
||||
*/
|
||||
mKeyboardRTL = bidiLevel;
|
||||
nsCOMPtr<nsISelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
||||
if (domSelection)
|
||||
{
|
||||
if (NS_SUCCEEDED(domSelection->SelectionLanguageChange(mKeyboardRTL)))
|
||||
{
|
||||
PRBool emptyClip;
|
||||
mRendContext->PopState(emptyClip);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If keyboard language is RTL, draw the hook on the left; if LTR, to the right
|
||||
|
Loading…
Reference in New Issue
Block a user