WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-110742-20130304130327.patch (text/plain), 5.47 KB, created by
Eugene Klyuchnikov
on 2013-03-04 01:07:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eugene Klyuchnikov
Created:
2013-03-04 01:07:20 PST
Size:
5.47 KB
patch
obsolete
>Subversion Revision: 144594 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c7595b7bd5cb884040b904953bbfbc2fe1c05c7a..0b53b97cc3717ace12afca1be9512d69decabfe0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2013-02-25 Eugene Klyuchnikov <eustas@chromium.org> >+ >+ [Editor] selectionStart/selectionEnd return "obsolete" values when requested during "input" event. >+ https://bugs.webkit.org/show_bug.cgi?id=110742 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: editing/selection/caret-after-keypress.html >+ >+ * editing/Editor.cpp: >+ (WebCore::Editor::appliedEditing): >+ Dispatch "input" event after selection is updated. >+ > 2013-03-03 Kentaro Hara <haraken@chromium.org> > > Unreviewed. Rebaselined run-bindings-tests. >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index c2b752872a0b6983619a5ba1c71a3ce96382bcf5..fab346885dd3a84340d2beffbbde06f0b90e82d0 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -837,7 +837,6 @@ void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd) > > EditCommandComposition* composition = cmd->composition(); > ASSERT(composition); >- dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement()); > VisibleSelection newSelection(cmd->endingSelection()); > > m_alternativeTextController->respondToAppliedEditing(cmd.get()); >@@ -846,6 +845,8 @@ void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd) > FrameSelection::SetSelectionOptions options = cmd->isDictationCommand() ? FrameSelection::DictationTriggered : 0; > changeSelectionAfterCommand(newSelection, options); > >+ dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement()); >+ > if (!cmd->preservesTypingStyle()) > m_frame->selection()->clearTypingStyle(); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 52d2466bdddab618ea6e7d56297e4e069119660b..3388ddc6f4cbff7ac3afe73ddc482485c694a25a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2013-02-25 Eugene Klyuchnikov <eustas@chromium.org> >+ >+ [Editor] selectionStart/selectionEnd return "obsolete" values when requested during "input" event. >+ https://bugs.webkit.org/show_bug.cgi?id=110742 >+ >+ Test that cursor position is up-to-date during "input" event. >+ >+ * editing/selection/caret-after-keypress-expected.txt: Added. >+ * editing/selection/caret-after-keypress.html: Added. >+ > 2013-03-03 Ryosuke Niwa <rniwa@webkit.org> > > Some perf. tests have variances that differ greatly between runs >diff --git a/LayoutTests/editing/selection/caret-after-keypress-expected.txt b/LayoutTests/editing/selection/caret-after-keypress-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..68af46b38f750baba4973629332575ba5aa4a265 >--- /dev/null >+++ b/LayoutTests/editing/selection/caret-after-keypress-expected.txt >@@ -0,0 +1,16 @@ >+This tests that 'input' event listener gets correct caret position after keypress. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS 0 >+PASS 1 >+PASS 2 >+PASS 3 >+PASS 4 >+PASS 5 >+PASS 6 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/editing/selection/caret-after-keypress.html b/LayoutTests/editing/selection/caret-after-keypress.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d4042a95efeb11412a80a17d550742b641f0a4fc >--- /dev/null >+++ b/LayoutTests/editing/selection/caret-after-keypress.html >@@ -0,0 +1,42 @@ >+<!DOCTYPE HTML> >+<html> >+<body> >+<script src="../../fast/js/resources/js-test-pre.js"></script> >+<script> >+description("This tests that 'input' event listener gets correct caret position after keypress."); >+ >+function assertEquals(actual, expected, msg) >+{ >+ if (actual !== expected) >+ testFailed(msg + ": <" + actual + "> != <" + expected + ">"); >+} >+ >+var test = document.createElement("input") >+document.body.appendChild(test); >+test.focus(); >+test.addEventListener("input", step); >+ >+const backSpace = String.fromCharCode(8); >+var input = ["a", "b", "c", backSpace, backSpace, backSpace]; >+var output = []; >+var pass = 0; >+ >+function step() { >+ assertEquals(test.value, output.join(""), "value"); >+ assertEquals(test.selectionStart, output.length, "selectionStart"); >+ assertEquals(test.selectionEnd, output.length, "selectionEnd"); >+ testPassed("" + pass++); >+ >+ var key = input.shift(); >+ if (key === backSpace) >+ output.pop(); >+ else >+ output.push(key); >+ eventSender.keyDown(key); >+} >+ >+step(); >+</script> >+<script src="../../fast/js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations >index 2ebc013742b9178eb4b2f0cf1da1eb2ae05cd751..939a43b0f05b2ac2157aec3e9a8010f74b61869b 100644 >--- a/LayoutTests/platform/mac-wk2/TestExpectations >+++ b/LayoutTests/platform/mac-wk2/TestExpectations >@@ -51,6 +51,7 @@ editing/selection/5354455-2.html > editing/selection/anchor-focus2.html > editing/selection/anchor-focus3.html > editing/selection/button-right-click.html >+editing/selection/caret-after-keypress.html > editing/selection/click-in-margins-inside-editable-div.html > editing/selection/click-in-padding-with-multiple-line-boxes.html > editing/selection/contains-boundaries.html
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 110742
:
190024
|
190922
|
191167
|
192444
|
197012
|
203349
|
203355
|
203363
|
203563