diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index 7a21c310d40..9df3e0d1d21 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -1734,9 +1734,9 @@ nsEditor::QueryComposition(nsTextEventReply* aReply) if (NS_SUCCEEDED(result) && caretP) { if (aReply) { - caretP->GetWindowRelativeCoordinates( - aReply->mCursorPosition, - aReply->mCursorIsCollapsed, selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); } } return result; diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index b841561a8ee..7a04d04c922 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -2835,7 +2835,9 @@ nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivat nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/base/nsPlaintextEditor.cpp b/mozilla/editor/base/nsPlaintextEditor.cpp index 762ed7275f5..9f1187dc8c2 100644 --- a/mozilla/editor/base/nsPlaintextEditor.cpp +++ b/mozilla/editor/base/nsPlaintextEditor.cpp @@ -1620,7 +1620,9 @@ nsPlaintextEditor::SetCompositionString(const nsString& aCompositionString, nsIP nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index 7a21c310d40..9df3e0d1d21 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -1734,9 +1734,9 @@ nsEditor::QueryComposition(nsTextEventReply* aReply) if (NS_SUCCEEDED(result) && caretP) { if (aReply) { - caretP->GetWindowRelativeCoordinates( - aReply->mCursorPosition, - aReply->mCursorIsCollapsed, selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); } } return result; diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index b841561a8ee..7a04d04c922 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -2835,7 +2835,9 @@ nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivat nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + result = caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty()) diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index 762ed7275f5..9f1187dc8c2 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -1620,7 +1620,9 @@ nsPlaintextEditor::SetCompositionString(const nsString& aCompositionString, nsIP nsCOMPtr ps = do_QueryReferent(mPresShellWeak); if (!ps) return NS_ERROR_NOT_INITIALIZED; ps->GetCaret(getter_AddRefs(caretP)); - caretP->GetWindowRelativeCoordinates(aReply->mCursorPosition,aReply->mCursorIsCollapsed,selection); + caretP->SetCaretDOMSelection(selection); + caretP->GetCaretCoordinates(nsICaret::eTopLevelWindowCoordinates, selection, + &(aReply->mCursorPosition), &(aReply->mCursorIsCollapsed)); // second part of 23558 fix: if (aCompositionString.IsEmpty())