LayoutTests:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jul 2006 00:16:37 +0000 (00:16 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jul 2006 00:16:37 +0000 (00:16 +0000)
        Reviewed by timo.

        <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion

        * editing/deleting/delete-mixed-editable-content-001-expected.checksum: Added.
        * editing/deleting/delete-mixed-editable-content-001-expected.png: Added.
        * editing/deleting/delete-mixed-editable-content-001-expected.txt: Added.
        * editing/deleting/delete-mixed-editable-content-001.html: Added.

WebCore:

        Reviewed by timo.

        <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion

        * Test: editing/deleting/delete-mixed-editable-content-001.html

        * editing/visible_units.cpp:
        (WebCore::startOfParagraph):
        Respect editable boundary the same way endOfParagraph does.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15587 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.checksum [new file with mode: 0644]
LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.png [new file with mode: 0644]
LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-mixed-editable-content-001.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/visible_units.cpp

index 91b43d72b03d7ffa32e0609dc098c9ed429a62b9..66ff07e750f93510211ea55c2aa3a453531cb9d2 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-23  David Harrison  <harrison@apple.com>
+
+        Reviewed by timo.
+
+        <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
+
+        * editing/deleting/delete-mixed-editable-content-001-expected.checksum: Added.
+        * editing/deleting/delete-mixed-editable-content-001-expected.png: Added.
+        * editing/deleting/delete-mixed-editable-content-001-expected.txt: Added.
+        * editing/deleting/delete-mixed-editable-content-001.html: Added.
+
 2006-07-23  Adele Peterson  <adele@apple.com>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.checksum b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.checksum
new file mode 100644 (file)
index 0000000..b1f8553
--- /dev/null
@@ -0,0 +1 @@
+986e3b78de78f9e7e41bb632c41ccfa1
\ No newline at end of file
diff --git a/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.png b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.png
new file mode 100644 (file)
index 0000000..9d34ce2
Binary files /dev/null and b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.png differ
diff --git a/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt b/LayoutTests/editing/deleting/delete-mixed-editable-content-001-expected.txt
new file mode 100644 (file)
index 0000000..fb496fb
--- /dev/null
@@ -0,0 +1,28 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of SPAN > SPAN > DIV > BODY > HTML > #document to 1 of SPAN > SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of SPAN > SPAN > DIV > BODY > HTML > #document to 0 of SPAN > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of SPAN > SPAN > DIV > BODY > HTML > #document to 0 of SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 204x22 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 44x18
+          RenderText {#text} at (0,0) size 0x0
+          RenderInline {SPAN} at (0,0) size 40x18
+            RenderInline {SPAN} at (0,0) size 40x18
+              RenderText {#text} at (2,2) size 40x18
+                text run at (2,2) width 40: "12345"
+          RenderText {#text} at (42,2) size 4x18
+            text run at (42,2) width 4: " "
+          RenderInline {SPAN} at (0,0) size 0x0
+            RenderBR {BR} at (0,0) size 0x0
+          RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+caret: position 0 of child 0 {BR} of child 3 {SPAN} of child 1 {SPAN} of child 0 {DIV} of child 2 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/deleting/delete-mixed-editable-content-001.html b/LayoutTests/editing/deleting/delete-mixed-editable-content-001.html
new file mode 100644 (file)
index 0000000..8f1a031
--- /dev/null
@@ -0,0 +1,16 @@
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+<script>
+function editingTest() {
+       selectAllCommand();
+       deleteCommand();
+}
+</script>
+<div style="border-style:solid; border-width:2px; border-color:red; width:200px;">
+<span>
+   <span><span contenteditable="true">12345</span></span>
+   <span contenteditable="true" id="test">hello</span>
+</span>
+</div>
+<script>
+runEditingTest();
+</script>
\ No newline at end of file
index 6c8e7ed80969501ebde702f3adf178c8ff4d8a01..c615f11ead6c8f2e57511598f5020dc96783dbb6 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-23  David Harrison  <harrison@apple.com>
+
+        Reviewed by timo.
+
+        <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
+        
+        * Test: editing/deleting/delete-mixed-editable-content-001.html
+
+        * editing/visible_units.cpp:
+        (WebCore::startOfParagraph):
+        Respect editable boundary the same way endOfParagraph does.
+
 2006-07-23  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
index 2888e950572332e138354dbe2014ee311ccd0fbf..0c3cc30a1b74ec9c655b8425465cad7f61b0d909 100644 (file)
@@ -561,6 +561,8 @@ VisiblePosition startOfParagraph(const VisiblePosition &c)
 
     Node *n = startNode;
     while (n) {
+        if (n->isContentEditable() != startNode->isContentEditable())
+            break;
         RenderObject *r = n->renderer();
         if (!r) {
             n = n->traversePreviousNodePostOrder(startBlock);