Changeset 75000 in webkit


Ignore:
Timestamp:
Jan 4, 2011 1:27:04 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-04 Zhe Su <suzhe@chromium.org>

Reviewed by Kenneth Russell.

  1. Remove entry for editing/input/ime-composition-clearpreedit.html test.
  2. Improve fast/events/ime-composition-events-001.html to cover more cases. And fix test expectations of chromium port. https://bugs.webkit.org/show_bug.cgi?id=51693
  • fast/events/ime-composition-events-001-expected.txt:
  • fast/events/ime-composition-events-001.html:
  • platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt: Removed.
  • platform/chromium-win/fast/events/ime-composition-events-001-expected.txt: Removed.
  • platform/chromium/fast/events/ime-composition-events-001-expected.txt: Added.
  • platform/chromium/test_expectations.txt:
  • platform/qt/fast/events/ime-composition-events-001-expected.txt: Added.

2011-01-04 Zhe Su <suzhe@chromium.org>

Reviewed by Kenneth Russell.

Fix insertText, setMarkedText and unmarkText methods of
TextInputController to call corresponding methods of WebKit::WebView
rather than WebKit::WebFrame. This change matches the behavior of
chromium browser.
insertText corresponds to WebView::confirmComposition(text)
setMarkedText corresponds to WebView::setComposition(...)
unmarkText corresponds to WebView::confirmComposition()
https://bugs.webkit.org/show_bug.cgi?id=51693

  • DumpRenderTree/chromium/TextInputController.cpp: (TextInputController::insertText): (TextInputController::setMarkedText): (TextInputController::unmarkText):

2011-01-04 Zhe Su <suzhe@chromium.org>

Reviewed by Kenneth Russell.

Changes:

  1. Add WebKit::WebWidget::confirmComposition(const WebString& text) This new method corresponds to Editor::confirmComposition(text) and Editor::insertText(text). It'll be used by both DumpRenderTree's TextInputController and chromium browser.
  2. Fix WebFrameImpl::insertText It should call Editor::confirmComposition(text) rather than Editor::insertText(text) if there is an ongoing composition. It matches the behavior of WebKit Mac port.
  3. Fix WebFrameImpl::setMarkedText Editor::confirmComposition(text) shouldn't be called in this method, which incorrectly inserts the text.

https://bugs.webkit.org/show_bug.cgi?id=51693

  • public/WebWidget.h:
  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::insertText): (WebKit::WebFrameImpl::setMarkedText):
  • src/WebPopupMenuImpl.cpp: (WebKit::WebPopupMenuImpl::confirmComposition):
  • src/WebPopupMenuImpl.h:
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::confirmComposition):
  • src/WebViewImpl.h:
  • tests/PopupMenuTest.cpp: (WebKit::TestWebWidget::confirmComposition):

2011-01-04 Zhe Su <suzhe@chromium.org>

Reviewed by Kenneth Russell.

Fix test LayoutTests/fast/events/ime-composition-events-001.html.

https://bugs.webkit.org/show_bug.cgi?id=51693

  • Api/qwebpage.cpp: (QWebPagePrivate::inputMethodEvent): Calls editor->insertText() to insert the commit string when no composition text is available.
Location:
trunk
Files:
2 deleted
16 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74995 r75000  
     12011-01-04  Zhe Su  <suzhe@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        1. Remove entry for editing/input/ime-composition-clearpreedit.html test.
     6        2. Improve fast/events/ime-composition-events-001.html to cover more
     7           cases. And fix test expectations of chromium port.
     8        https://bugs.webkit.org/show_bug.cgi?id=51693
     9
     10        * fast/events/ime-composition-events-001-expected.txt:
     11        * fast/events/ime-composition-events-001.html:
     12        * platform/chromium-mac/fast/events/ime-composition-events-001-expected.txt: Removed.
     13        * platform/chromium-win/fast/events/ime-composition-events-001-expected.txt: Removed.
     14        * platform/chromium/fast/events/ime-composition-events-001-expected.txt: Added.
     15        * platform/chromium/test_expectations.txt:
     16        * platform/qt/fast/events/ime-composition-events-001-expected.txt: Added.
     17
    1182010-12-31  Antti Koivisto  <antti@apple.com>
    219
  • trunk/LayoutTests/fast/events/ime-composition-events-001-expected.txt

    r50968 r75000  
    1313SUCCESS: INPUT - compositionupdate - "7"
    1414SUCCESS: INPUT - compositionend - ""
     15SUCCESS: INPUT - textInput - "8"
     16SUCCESS: INPUT - compositionstart - "9"
     17SUCCESS: INPUT - compositionend - "9"
     18SUCCESS: INPUT - textInput - "9"
  • trunk/LayoutTests/fast/events/ime-composition-events-001.html

    r50968 r75000  
    4848    textInputController.setMarkedText('7', 0, 1);
    4949    textInputController.setMarkedText('', 0, 0);
     50
     51    // Case 3: Insert a text without composition.
     52    textInputController.insertText('8');
     53
     54    // Case 4: Compose a text and commit it by removing the mark.
     55    // Only Mac and Chromium ports support unmarkText.
     56    if (textInputController.unmarkText) {
     57        textInputController.setMarkedText('9', 0, 1);
     58        textInputController.unmarkText();
     59    }
    5060}
    5161</script>
  • trunk/LayoutTests/platform/chromium/fast/events/ime-composition-events-001-expected.txt

    r74999 r75000  
    1313SUCCESS: INPUT - compositionupdate - "7"
    1414SUCCESS: INPUT - compositionend - ""
     15SUCCESS: INPUT - textInput - "8"
     16SUCCESS: INPUT - compositionstart - "9"
     17SUCCESS: INPUT - compositionend - "9"
     18SUCCESS: INPUT - textInput - "9"
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r74939 r75000  
    30443044BUGWK51536 : fast/css/box-shadow.html = FAIL TIMEOUT
    30453045
    3046 BUGCR67960 : editing/input/ime-composition-clearpreedit.html = TEXT
    3047 
    30483046// WebKit roll 74667:74679
    30493047BUGCR68067 LINUX DEBUG : fast/canvas/webgl/tex-image-with-format-and-type.html = TEXT PASS
  • trunk/LayoutTests/platform/qt/fast/events/ime-composition-events-001-expected.txt

    r74999 r75000  
    1313SUCCESS: INPUT - compositionupdate - "7"
    1414SUCCESS: INPUT - compositionend - ""
     15SUCCESS: INPUT - textInput - "8"
  • trunk/Tools/ChangeLog

    r74974 r75000  
     12011-01-04  Zhe Su  <suzhe@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Fix insertText, setMarkedText and unmarkText methods of
     6        TextInputController to call corresponding methods of WebKit::WebView
     7        rather than WebKit::WebFrame. This change matches the behavior of
     8        chromium browser.
     9        insertText corresponds to WebView::confirmComposition(text)
     10        setMarkedText corresponds to WebView::setComposition(...)
     11        unmarkText corresponds to WebView::confirmComposition()
     12        https://bugs.webkit.org/show_bug.cgi?id=51693
     13
     14        * DumpRenderTree/chromium/TextInputController.cpp:
     15        (TextInputController::insertText):
     16        (TextInputController::setMarkedText):
     17        (TextInputController::unmarkText):
     18
    1192011-01-04  Dihan Wickremasuriya  <dihan.wickremasuriya@nokia.com>
    220
  • trunk/Tools/DumpRenderTree/chromium/TextInputController.cpp

    r70786 r75000  
    8080    result->setNull();
    8181
    82     WebFrame* mainFrame = getMainFrame();
    83     if (!mainFrame)
    84         return;
    8582    if (arguments.size() < 1 || !arguments[0].isString())
    8683        return;
    8784
    88     if (mainFrame->hasMarkedText()) {
    89         mainFrame->unmarkText();
    90         mainFrame->replaceSelection(WebString());
    91     }
    92     mainFrame->insertText(WebString::fromUTF8(arguments[0].toString()));
     85    testShell->webView()->confirmComposition(WebString::fromUTF8(arguments[0].toString()));
    9386}
    9487
     
    109102    result->setNull();
    110103
    111     WebFrame* mainFrame = getMainFrame();
    112     if (!mainFrame)
    113         return;
    114 
    115104    if (arguments.size() >= 3 && arguments[0].isString()
    116105        && arguments[1].isNumber() && arguments[2].isNumber()) {
    117         mainFrame->setMarkedText(WebString::fromUTF8(arguments[0].toString()),
    118                                  arguments[1].toInt32(),
    119                                  arguments[2].toInt32());
     106        WebVector<WebCompositionUnderline> underlines;
     107        testShell->webView()->setComposition(WebString::fromUTF8(arguments[0].toString()),
     108                                             underlines,
     109                                             arguments[1].toInt32(),
     110                                             arguments[1].toInt32() + arguments[2].toInt32());
    120111    }
    121112}
     
    125116    result->setNull();
    126117
    127     WebFrame* mainFrame = getMainFrame();
    128     if (!mainFrame)
    129         return;
    130 
    131     mainFrame->unmarkText();
     118    testShell->webView()->confirmComposition();
    132119}
    133120
  • trunk/WebKit/chromium/ChangeLog

    r74899 r75000  
     12011-01-04  Zhe Su  <suzhe@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Changes:
     6        1. Add WebKit::WebWidget::confirmComposition(const WebString& text)
     7           This new method corresponds to Editor::confirmComposition(text) and
     8           Editor::insertText(text). It'll be used by both DumpRenderTree's
     9           TextInputController and chromium browser.
     10        2. Fix WebFrameImpl::insertText
     11           It should call Editor::confirmComposition(text) rather than
     12           Editor::insertText(text) if there is an ongoing composition.
     13           It matches the behavior of WebKit Mac port.
     14        3. Fix WebFrameImpl::setMarkedText
     15           Editor::confirmComposition(text) shouldn't be called in this
     16           method, which incorrectly inserts the text.
     17
     18        https://bugs.webkit.org/show_bug.cgi?id=51693
     19
     20        * public/WebWidget.h:
     21        * src/WebFrameImpl.cpp:
     22        (WebKit::WebFrameImpl::insertText):
     23        (WebKit::WebFrameImpl::setMarkedText):
     24        * src/WebPopupMenuImpl.cpp:
     25        (WebKit::WebPopupMenuImpl::confirmComposition):
     26        * src/WebPopupMenuImpl.h:
     27        * src/WebViewImpl.cpp:
     28        (WebKit::WebViewImpl::confirmComposition):
     29        * src/WebViewImpl.h:
     30        * tests/PopupMenuTest.cpp:
     31        (WebKit::TestWebWidget::confirmComposition):
     32
    1332011-01-03  Daniel Bates  <dbates@rim.com>
    234
  • trunk/WebKit/chromium/public/WebWidget.h

    r67244 r75000  
    104104
    105105    // Called to inform the WebWidget to confirm an ongoing composition.
     106    // This method is same as confirmComposition(WebString());
    106107    // Returns true if there is an ongoing composition.
    107108    virtual bool confirmComposition() = 0;
     109
     110    // Called to inform the WebWidget to confirm an ongoing composition with a
     111    // new composition text. If the text is empty then the current composition
     112    // text is confirmed. If there is no ongoing composition, then deletes the
     113    // current selection and inserts the text. This method has no effect if
     114    // there is no ongoing composition and the text is empty.
     115    // Returns true if there is an ongoing composition or the text is inserted.
     116    virtual bool confirmComposition(const WebString& text) = 0;
    108117
    109118    // Returns the current text input type of this WebWidget.
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r74969 r75000  
    10751075void WebFrameImpl::insertText(const WebString& text)
    10761076{
    1077     frame()->editor()->insertText(text, 0);
     1077    Editor* editor = frame()->editor();
     1078
     1079    if (editor->hasComposition())
     1080        editor->confirmComposition(text);
     1081    else
     1082        editor->insertText(text, 0);
    10781083}
    10791084
     
    10821087{
    10831088    Editor* editor = frame()->editor();
    1084 
    1085     editor->confirmComposition(text);
    10861089
    10871090    Vector<CompositionUnderline> decorations;
  • trunk/WebKit/chromium/src/WebPopupMenuImpl.cpp

    r67244 r75000  
    254254}
    255255
     256bool WebPopupMenuImpl::confirmComposition(const WebString& text)
     257{
     258    return false;
     259}
     260
    256261WebTextInputType WebPopupMenuImpl::textInputType()
    257262{
  • trunk/WebKit/chromium/src/WebPopupMenuImpl.h

    r67244 r75000  
    7474        int selectionStart, int selectionEnd);
    7575    virtual bool confirmComposition();
     76    virtual bool confirmComposition(const WebString& text);
    7677    virtual WebTextInputType textInputType();
    7778    virtual WebRect caretOrSelectionBounds();
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r74868 r75000  
    13041304bool WebViewImpl::confirmComposition()
    13051305{
     1306    return confirmComposition(WebString());
     1307}
     1308
     1309bool WebViewImpl::confirmComposition(const WebString& text)
     1310{
    13061311    Frame* focused = focusedWebCoreFrame();
    13071312    if (!focused || !m_imeAcceptEvents)
    13081313        return false;
    13091314    Editor* editor = focused->editor();
    1310     if (!editor || !editor->hasComposition())
     1315    if (!editor || (!editor->hasComposition() && !text.length()))
    13111316        return false;
    13121317
     
    13221327    }
    13231328
    1324     editor->confirmComposition();
     1329    if (editor->hasComposition()) {
     1330        if (text.length())
     1331            editor->confirmComposition(String(text));
     1332        else
     1333            editor->confirmComposition();
     1334    } else
     1335        editor->insertText(String(text), 0);
     1336
    13251337    return true;
    13261338}
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r74568 r75000  
    106106        int selectionEnd);
    107107    virtual bool confirmComposition();
     108    virtual bool confirmComposition(const WebString& text);
    108109    virtual WebTextInputType textInputType();
    109110    virtual WebRect caretOrSelectionBounds();
  • trunk/WebKit/chromium/tests/PopupMenuTest.cpp

    r71631 r75000  
    140140        int selectionEnd) { return true; }
    141141    virtual bool confirmComposition() { return true; }
     142    virtual bool confirmComposition(const WebString& text) { return true; }
    142143    virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; }
    143144    virtual WebRect caretOrSelectionBounds() { return WebRect(); }
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r74941 r75000  
    10971097        // Commit regardless of whether commitString is empty, to get rid of selection.
    10981098        editor->confirmComposition(ev->commitString());
    1099     } else if (!ev->commitString().isEmpty())
    1100         editor->confirmComposition(ev->commitString());
    1101     else if (!hasSelection && !ev->preeditString().isEmpty())
     1099    } else if (!ev->commitString().isEmpty()) {
     1100        if (editor->hasComposition())
     1101            editor->confirmComposition(ev->commitString());
     1102        else
     1103            editor->insertText(ev->commitString(), 0);
     1104    } else if (!hasSelection && !ev->preeditString().isEmpty())
    11021105        editor->setComposition(ev->preeditString(), underlines, 0, 0);
    11031106    else if (ev->preeditString().isEmpty() && editor->hasComposition())
  • trunk/WebKit/qt/ChangeLog

    r74941 r75000  
     12011-01-04  Zhe Su  <suzhe@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Fix test LayoutTests/fast/events/ime-composition-events-001.html.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=51693
     8
     9        * Api/qwebpage.cpp:
     10        (QWebPagePrivate::inputMethodEvent): Calls editor->insertText() to
     11        insert the commit string when no composition text is available.
     12
    1132011-01-03  Yi Shen  <yi.4.shen@nokia.com>
    214
Note: See TracChangeset for help on using the changeset viewer.