Changeset 152668 in webkit


Ignore:
Timestamp:
Jul 15, 2013 4:28:50 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

compositionstart event should contain the text to be replaced
https://bugs.webkit.org/show_bug.cgi?id=118684

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/9e04f728a95ad7d4783b1d31c3cdc1412dd6cc4d.

DOM3 level 3 specifies compositionstart event's data to be the text to be replaced.
http://www.w3.org/TR/DOM-Level-3-Events/#event-type-compositionstart

According to the author of the Blink change, IE10 on Windows and Firefox22 on Linux confirms
to the specified behavior.

Test: fast/events/ime-composition-events-001.html

  • editing/Editor.cpp:

(WebCore::Editor::setComposition):

LayoutTests:

Add a test case.

  • fast/events/ime-composition-events-001-expected.txt:
  • fast/events/ime-composition-events-001.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152653 r152668  
     12013-07-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        compositionstart event should contain the text to be replaced
     4        https://bugs.webkit.org/show_bug.cgi?id=118684
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Add a test case.
     9
     10        * fast/events/ime-composition-events-001-expected.txt:
     11        * fast/events/ime-composition-events-001.html:
     12
    1132013-07-15  Antoine Quint  <graouts@apple.com>
    214
  • trunk/LayoutTests/fast/events/ime-composition-events-001-expected.txt

    r105609 r152668  
    44
    55
    6 SUCCESS: INPUT - compositionstart - "1"
     6SUCCESS: INPUT - compositionstart - ""
    77SUCCESS: INPUT - compositionupdate - "1"
    88SUCCESS: INPUT - compositionupdate - "2"
     
    1010SUCCESS: INPUT - compositionend - "4"
    1111SUCCESS: INPUT - textInput - "4"
    12 SUCCESS: INPUT - compositionstart - "5"
     12SUCCESS: INPUT - compositionstart - ""
    1313SUCCESS: INPUT - compositionupdate - "5"
    1414SUCCESS: INPUT - compositionupdate - "6"
     
    1616SUCCESS: INPUT - compositionend - ""
    1717SUCCESS: INPUT - textInput - "8"
    18 SUCCESS: INPUT - compositionstart - "9"
     18SUCCESS: INPUT - compositionstart - ""
    1919SUCCESS: INPUT - compositionupdate - "9"
    2020SUCCESS: INPUT - compositionend - "9"
    2121SUCCESS: INPUT - textInput - "9"
     22SUCCESS: INPUT - compositionstart - "have"
     23SUCCESS: INPUT - compositionupdate - "lost"
     24SUCCESS: INPUT - compositionend - "made"
     25SUCCESS: INPUT - textInput - "made"
     26SUCCESS: I made a pen
  • trunk/LayoutTests/fast/events/ime-composition-events-001.html

    r120792 r152668  
    5858        textInputController.unmarkText();
    5959    }
     60
     61    // Case 5: Compose a text on selection and commit it.
     62    test.value = 'I have a pen';
     63    test.selectionStart = 2;
     64    test.selectionEnd = 6;
     65    textInputController.setMarkedText('lost', 0, 1);
     66    textInputController.insertText('made');
     67    if (test.value == 'I made a pen')
     68        log('SUCCESS: ' + test.value);
     69    else
     70        log('FAILURE: ' + test.value + ' is not "I made a pen".');
    6071}
    6172</script>
  • trunk/Source/WebCore/ChangeLog

    r152667 r152668  
     12013-07-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        compositionstart event should contain the text to be replaced
     4        https://bugs.webkit.org/show_bug.cgi?id=118684
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Merge https://chromium.googlesource.com/chromium/blink/+/9e04f728a95ad7d4783b1d31c3cdc1412dd6cc4d.
     9
     10        DOM3 level 3 specifies compositionstart event's data to be the text to be replaced.
     11        http://www.w3.org/TR/DOM-Level-3-Events/#event-type-compositionstart
     12
     13        According to the author of the Blink change, IE10 on Windows and Firefox22 on Linux confirms
     14        to the specified behavior.
     15
     16        Test: fast/events/ime-composition-events-001.html
     17
     18        * editing/Editor.cpp:
     19        (WebCore::Editor::setComposition):
     20
    1212013-07-15  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Source/WebCore/editing/Editor.cpp

    r152203 r152668  
    15421542            // function doesn't create a composition node when the text is empty.
    15431543            if (!text.isEmpty()) {
    1544                 target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, m_frame->document()->domWindow(), text));
     1544                target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, m_frame->document()->domWindow(), selectedText()));
    15451545                event = CompositionEvent::create(eventNames().compositionupdateEvent, m_frame->document()->domWindow(), text);
    15461546            }
Note: See TracChangeset for help on using the changeset viewer.