Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(215)

Issue 5812003: Merge 73279 - 2010-12-03 Ryosuke Niwa <rniwa@webkit.org>... (Closed)

Created:
8 years, 6 months ago by rniwa-cr
Modified:
8 years ago
Reviewers:
rniwa-cr
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/597/
Visibility:
Public.

Description

Merge 73279 - 2010-12-03 Ryosuke Niwa <rniwa@webkit.org>; Reviewed by Darin Adler. REGRESSION: Crash when deleting text after textarea's value is modified on input event https://bugs.webkit.org/show_bug.cgi?id=49962 The crash was caused by TypingCommand::deleteKeyPressed's reusing a typing command for textarea's shadow DOM after its input event handler rewrote the value set by the typing command. Because the reused typing command's ending selection was pointing at a shadow node that has been detached from the document when the event handler set the new value, rootEditableElement of the ending selection was null and caused the crash. Fixed the bug by updating the ending selection of the last typing command when it differsfrom that of the current selection held by the SelectionController in TypingCommand::deleteKeyPressed. Also fixed similar bugs in forwardDeleteKeyPressed and insertText, and insertTextRunWithoutNewlines. Tests: editing/input/set-value-on-input-and-delete.html editing/input/set-value-on-input-and-forward-delete.html editing/input/set-value-on-input-and-type-input.html editing/input/set-value-on-input-and-type-textarea.html * editing/InsertTextCommand.h: Added TypingCommand as a friend because it needs to update selection. * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): Updates the last typing command's selection as needed. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. (WebCore::TypingCommand::insertText): Ditto. (WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection): Added. (WebCore::TypingCommand::insertTextRunWithoutNewlines): Updates InsertTextCommand's selection as needed. * editing/TypingCommand.h: 2010-12-03 Ryosuke Niwa <rniwa@webkit.org>; Reviewed by Darin Adler. REGRESSION: Crash when deleting text after textarea's value is modified on input event https://bugs.webkit.org/show_bug.cgi?id=49962 Added tests to ensure inserting and deleting a character inside input or textarea succeeds even if the value of those elements have been rewritten by its input event handler. * editing/input/set-value-on-input-and-delete-expected.txt: Added. * editing/input/set-value-on-input-and-delete.html: Added. * editing/input/set-value-on-input-and-forward-delete-expected.txt: Added. * editing/input/set-value-on-input-and-forward-delete.html: Added. * editing/input/set-value-on-input-and-type-input-expected.txt: Added. * editing/input/set-value-on-input-and-type-input.html: Added. * editing/input/set-value-on-input-and-type-textarea-expected.txt: Added. * editing/input/set-value-on-input-and-type-textarea.html: Added. BUG=62608 TBR=rniwa@webkit.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=73934

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, --3 lines) Patch
A + LayoutTests/editing/input/set-value-on-input-and-delete.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-delete-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-forward-delete.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-forward-delete-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-type-input.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-type-input-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-type-textarea.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/editing/input/set-value-on-input-and-type-textarea-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M WebCore/editing/InsertTextCommand.h View 1 chunk +2 lines, -0 lines 0 comments Download
M WebCore/editing/TypingCommand.h View 1 chunk +2 lines, -0 lines 0 comments Download
M WebCore/editing/TypingCommand.cpp View 6 chunks +20 lines, -5 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
rniwa-cr
8 years, 6 months ago (2010-12-13 19:11:19 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698