[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
adele at apple.com
adele at apple.com
Thu Dec 3 13:23:54 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit b7461f3db454960d8f98071119e8ca4f548aa48d
Author: adele at apple.com <adele at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 30 22:09:07 2009 +0000
REGRESSION: In Mail, Undo does not restore some characters I have deleted at the end of a line
https://bugs.webkit.org/show_bug.cgi?id=30955
<rdar://problem/7067033>
Patch by Enrica Casucci <enrica at apple.com> on 2009-10-30
Reviewed by Darin Adler.
WebCore:
When the command is deleteWordBackward or deleteWordForward
we should not add to the open typing command, but
create a new one.
Test: editing/undo/undo-deleteWord.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Always start a new command if the granularity is
not CharacterGranularity.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Always start a new command if the granularity is
not CharacterGranularity.
LayoutTests:
* editing/undo/undo-deleteWord-expected.txt: Added.
* editing/undo/undo-deleteWord.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 73c67be..124bebc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-30 Enrica Casucci <enrica at apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION: In Mail, Undo does not restore some characters I have deleted at the end of a line
+ https://bugs.webkit.org/show_bug.cgi?id=30955
+ <rdar://problem/7067033>
+
+ * editing/undo/undo-deleteWord-expected.txt: Added.
+ * editing/undo/undo-deleteWord.html: Added.
+
2009-10-29 Jon Honeycutt <jhoneycutt at apple.com>
Test for MSAA: Accessibility of headings is not correct
diff --git a/LayoutTests/editing/undo/undo-deleteWord-expected.txt b/LayoutTests/editing/undo/undo-deleteWord-expected.txt
new file mode 100644
index 0000000..ca38bdd
--- /dev/null
+++ b/LayoutTests/editing/undo/undo-deleteWord-expected.txt
@@ -0,0 +1,3 @@
+Tests:
+Undo a delete word after a series of insertText does not wipe out the entire content.
+one two three four
diff --git a/LayoutTests/editing/undo/undo-deleteWord.html b/LayoutTests/editing/undo/undo-deleteWord.html
new file mode 100644
index 0000000..fa857d6
--- /dev/null
+++ b/LayoutTests/editing/undo/undo-deleteWord.html
@@ -0,0 +1,95 @@
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+}
+.explanation {
+ border: 2px solid blue;
+ padding: 12px;
+ font-size: 24px;
+ margin-bottom: 24px;
+}
+.scenario { margin-bottom: 16px;}
+.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function sendDeleteWordKey()
+{
+ var deleteWordModifiers;
+ if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
+ deleteWordModifiers = ["altKey"];
+ else
+ deleteWordModifiers = ["ctrlKey"];
+
+ if (window.eventSender)
+ eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers);
+ window.setTimeout(undoNow, 100);
+}
+
+function undoNow()
+{
+ document.execCommand("Undo");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function editingTest() {
+ typeCharacterCommand('o');
+ typeCharacterCommand('n');
+ typeCharacterCommand('e');
+ typeCharacterCommand(' ');
+ typeCharacterCommand('t');
+ typeCharacterCommand('w');
+ typeCharacterCommand('o');
+ typeCharacterCommand(' ');
+ typeCharacterCommand('t');
+ typeCharacterCommand('h');
+ typeCharacterCommand('r');
+ typeCharacterCommand('e');
+ typeCharacterCommand('e');
+ typeCharacterCommand(' ');
+ typeCharacterCommand('f');
+ typeCharacterCommand('o');
+ typeCharacterCommand('u');
+ typeCharacterCommand('r');
+
+ window.setTimeout(sendDeleteWordKey, 100);
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+
+<div class="explanation">
+<div class="scenario">
+Tests:
+<br>
+Undo a delete word after a series of insertText does not wipe out the entire content.
+</div>
+</div>
+
+<div contenteditable id="root">
+<div id="test" class="editing"></div>
+</div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+var selection = window.getSelection();
+selection.setPosition(document.getElementById("test"), 0);
+editingTest();
+</script>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1d2c8ff..060f541 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-30 Enrica Casucci <enrica at apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION: In Mail, Undo does not restore some characters I have deleted at the end of a line
+ https://bugs.webkit.org/show_bug.cgi?id=30955
+ <rdar://problem/7067033>
+
+ When the command is deleteWordBackward or deleteWordForward
+ we should not add to the open typing command, but
+ create a new one.
+
+ Test: editing/undo/undo-deleteWord.html
+
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::deleteKeyPressed): Always start a new command if the granularity is
+ not CharacterGranularity.
+ (WebCore::TypingCommand::forwardDeleteKeyPressed): Always start a new command if the granularity is
+ not CharacterGranularity.
+
2009-10-30 Eric Carlson <eric.carlson at apple.com>
Reviewed by Darin Adler.
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index f5901d7..2b0f61e 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -90,7 +90,7 @@ void TypingCommand::deleteKeyPressed(Document *document, bool smartDelete, TextG
ASSERT(frame);
EditCommand* lastEditCommand = frame->editor()->lastEditCommand();
- if (isOpenForMoreTypingCommand(lastEditCommand)) {
+ if (granularity == CharacterGranularity && isOpenForMoreTypingCommand(lastEditCommand)) {
static_cast<TypingCommand*>(lastEditCommand)->deleteKeyPressed(granularity, killRing);
return;
}
@@ -109,7 +109,7 @@ void TypingCommand::forwardDeleteKeyPressed(Document *document, bool smartDelete
ASSERT(frame);
EditCommand* lastEditCommand = frame->editor()->lastEditCommand();
- if (isOpenForMoreTypingCommand(lastEditCommand)) {
+ if (granularity == CharacterGranularity && isOpenForMoreTypingCommand(lastEditCommand)) {
static_cast<TypingCommand*>(lastEditCommand)->forwardDeleteKeyPressed(granularity, killRing);
return;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list