Commit f24e3e1b authored by oliver's avatar oliver

Reviewed by Adam.

        Fix for <rdar://problem/5339416> Candidate window does not
                appear in the correct location for japanese IME

        * WebView.cpp:
        (WebView::prepareCandidateWindow):
          We now use an exclusion zone so that the composition window never 
          overlaps the composition string
        (WebView::onIMERequestCharPosition):
          Correctly handle character offsets marked regions



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69077107
2007-07-17 Oliver Hunt <oliver@apple.com>
Reviewed by Adam.
Fix for <rdar://problem/5339416> Candidate window does not
appear in the correct location for japanese IME
* WebView.cpp:
(WebView::prepareCandidateWindow):
We now use an exclusion zone so that the composition window never
overlaps the composition string
(WebView::onIMERequestCharPosition):
Correctly handle character offsets marked regions
2007-07-16 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
......
......@@ -3704,13 +3704,13 @@ void WebView::prepareCandidateWindow(Frame* targetFrame, HIMC hInputContext)
caret = targetFrame->view()->contentsToWindow(caret);
CANDIDATEFORM form;
form.dwIndex = 0;
form.dwStyle = CFS_CANDIDATEPOS;
form.dwStyle = CFS_EXCLUDE;
form.ptCurrentPos.x = caret.x();
form.ptCurrentPos.y = caret.y() + caret.height();
form.rcArea.top = 0;
form.rcArea.bottom = 0;
form.rcArea.left = 0;
form.rcArea.right = 0;
form.rcArea.top = caret.y();
form.rcArea.bottom = caret.bottom();
form.rcArea.left = caret.x();
form.rcArea.right = caret.right();
IMMDict::dict().setCandidateWindow(hInputContext, &form);
}
......@@ -3912,11 +3912,13 @@ bool WebView::onIMENotify(WPARAM, LPARAM, LRESULT*)
}
bool WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* charPos, LRESULT* result)
{
{
IntRect caret;
if (RefPtr<Range> range = targetFrame->selectionController()->selection().toRange()) {
ASSERT(charPos->dwCharPos == 0 || targetFrame->markedTextRange());
if (RefPtr<Range> range = targetFrame->markedTextRange() ? targetFrame->markedTextRange() : targetFrame->selectionController()->selection().toRange()) {
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
tempRange->setStart(tempRange->startContainer(ec), tempRange->startOffset(ec) + charPos->dwCharPos, ec);
caret = targetFrame->firstRectForRange(tempRange.get());
}
caret = targetFrame->view()->contentsToWindow(caret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment