WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2008 10:12:48 +0000 (10:12 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2008 10:12:48 +0000 (10:12 +0000)
        Reviewed by Maciej Stachowiak.

        - fix <rdar://problem/5645813> CrashTracer: [USER] 6 crashes in Safari at com.apple.WebCore: WebCore::RenderBox::destroy + 116

        Test: editing/selection/inconsistent-in-removeChildNode.html

        * editing/SelectionController.cpp:
        (WebCore::SelectionController::nodeWillBeRemoved): If the selection
        base or extent are not visible any more, adjust the selection.

LayoutTests:

        Reviewed by Maciej Stachowiak.

        - test and updated results for <rdar://problem/5645813> CrashTracer: [USER] 6 crashes in Safari at com.apple.WebCore: WebCore::RenderBox::destroy + 116

        * editing/selection/inconsistent-in-removeChildNode.html: Added.
        * platform/mac-leopard/editing/pasteboard/paste-RTFD-expected.txt:
        * platform/mac-leopard/editing/selection: Added.
        * platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.checksum: Added.
        * platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png: Added.
        * platform/mac/editing/deleting/collapse-whitespace-3587601-fix-expected.txt:
        * platform/mac/editing/deleting/delete-3608462-fix-expected.txt:
        * platform/mac/editing/deleting/delete-4083333-fix-expected.txt:
        * platform/mac/editing/deleting/delete-leading-ws-001-expected.txt:
        * platform/mac/editing/deleting/delete-line-011-expected.txt:
        * platform/mac/editing/execCommand/find-after-replace-expected.txt:
        * platform/mac/editing/execCommand/paste-1-expected.txt:
        * platform/mac/editing/execCommand/paste-2-expected.txt:
        * platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt:
        * platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt: Added.
        * platform/mac/editing/selection/move-between-blocks-no-001-expected.txt:
        * platform/mac/editing/selection/replace-selection-1-expected.txt:
        * platform/mac/editing/style/remove-underline-across-paragraph-expected.txt:
        * platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
        * platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
        * platform/mac/editing/style/remove-underline-expected.txt:
        * platform/mac/editing/style/remove-underline-in-bold-expected.txt:
        * platform/mac/editing/style/unbold-in-bold-expected.txt:

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

25 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/inconsistent-in-removeChildNode.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/editing/pasteboard/paste-RTFD-expected.txt
LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-3608462-fix-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-4083333-fix-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-leading-ws-001-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-line-011-expected.txt
LayoutTests/platform/mac/editing/execCommand/find-after-replace-expected.txt
LayoutTests/platform/mac/editing/execCommand/paste-1-expected.txt
LayoutTests/platform/mac/editing/execCommand/paste-2-expected.txt
LayoutTests/platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt
LayoutTests/platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/move-between-blocks-no-001-expected.txt
LayoutTests/platform/mac/editing/selection/replace-selection-1-expected.txt
LayoutTests/platform/mac/editing/style/remove-underline-across-paragraph-expected.txt
LayoutTests/platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
LayoutTests/platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
LayoutTests/platform/mac/editing/style/remove-underline-expected.txt
LayoutTests/platform/mac/editing/style/remove-underline-in-bold-expected.txt
LayoutTests/platform/mac/editing/style/unbold-in-bold-expected.txt
WebCore/ChangeLog
WebCore/editing/SelectionController.cpp

index 5a457513001524ca71c09d3836f382d09c829eb0..27b1c288724d31b6cf1b7fabd4e179fc1018abd2 100644 (file)
@@ -1,3 +1,33 @@
+2008-01-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        - test and updated results for <rdar://problem/5645813> CrashTracer: [USER] 6 crashes in Safari at com.apple.WebCore: WebCore::RenderBox::destroy + 116
+
+        * editing/selection/inconsistent-in-removeChildNode.html: Added.
+        * platform/mac-leopard/editing/pasteboard/paste-RTFD-expected.txt:
+        * platform/mac-leopard/editing/selection: Added.
+        * platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.checksum: Added.
+        * platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png: Added.
+        * platform/mac/editing/deleting/collapse-whitespace-3587601-fix-expected.txt:
+        * platform/mac/editing/deleting/delete-3608462-fix-expected.txt:
+        * platform/mac/editing/deleting/delete-4083333-fix-expected.txt:
+        * platform/mac/editing/deleting/delete-leading-ws-001-expected.txt:
+        * platform/mac/editing/deleting/delete-line-011-expected.txt:
+        * platform/mac/editing/execCommand/find-after-replace-expected.txt:
+        * platform/mac/editing/execCommand/paste-1-expected.txt:
+        * platform/mac/editing/execCommand/paste-2-expected.txt:
+        * platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt:
+        * platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt: Added.
+        * platform/mac/editing/selection/move-between-blocks-no-001-expected.txt:
+        * platform/mac/editing/selection/replace-selection-1-expected.txt:
+        * platform/mac/editing/style/remove-underline-across-paragraph-expected.txt:
+        * platform/mac/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
+        * platform/mac/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
+        * platform/mac/editing/style/remove-underline-expected.txt:
+        * platform/mac/editing/style/remove-underline-in-bold-expected.txt:
+        * platform/mac/editing/style/unbold-in-bold-expected.txt:
+
 2008-01-18  Adele Peterson  <adele@apple.com>
 
         Reviewed by Oliver.
diff --git a/LayoutTests/editing/selection/inconsistent-in-removeChildNode.html b/LayoutTests/editing/selection/inconsistent-in-removeChildNode.html
new file mode 100644 (file)
index 0000000..96e4c7a
--- /dev/null
@@ -0,0 +1,18 @@
+<p>
+    Test for <a href="rdar://problem/5645813">rdar://problem/5645813</a>.
+</p>
+<div id="d1">
+    Selected text
+</div>
+<div id="d2">
+    YOU SHOULD NOT SEE THIS TEXT
+</div>
+<div id="d3" style="background: red; width: 50px; height: 50px;">
+</div>
+<script>
+    getSelection().setBaseAndExtent(d1, 0, d2.firstChild, 6);
+    d2.style.display = "none";
+    document.body.offsetTop;
+    d3.style.display = "none";
+    d3.parentNode.removeChild(d3);
+</script>
index 5aa52da0ff5533e56b527cabf2240059ad8aed42..b7c2d71f2f5b38cd1aade562d957d53523451f36 100644 (file)
@@ -2,7 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of P > DIV > BODY > HTML > #document to 0 of P > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of P > DIV > BODY > HTML > #document to 0 of P > DIV > BODY > HTML > #document toDOMRange:range from 0 of P > DIV > BODY > HTML > #document to 0 of P > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
diff --git a/LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.checksum b/LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.checksum
new file mode 100644 (file)
index 0000000..cb8b0b1
--- /dev/null
@@ -0,0 +1 @@
+808720c7a61778c24e14167a6ccfd490
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png b/LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png
new file mode 100644 (file)
index 0000000..e5708d0
Binary files /dev/null and b/LayoutTests/platform/mac-leopard/editing/selection/inconsistent-in-removeChildNode-expected.png differ
index 03b9c5c5f3d1b9215862875f55b8aca6898d6aaf..f4f25c7dc535450f9275a03be1dd79b6f7816617 100644 (file)
@@ -11,8 +11,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 0c8e235fefff60de04d26c75af3471be08bf2a0b..9a4484ffc713e0c50ad7f92f490c1ea40290660c 100644 (file)
@@ -13,8 +13,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 28edcf0513af559c3c96620f4f13f88c81f2301c..d1e39c1dc87f7165e9d00ee21015f62f277213db 100644 (file)
@@ -3,8 +3,6 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > A > SPAN > DIV > BODY > HTML > #document to 4 of #text > A > SPAN > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > A > SPAN > DIV > BODY > HTML > #document to 3 of #text > A > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > A > SPAN > DIV > BODY > HTML > #document to 3 of #text > A > 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
index 0f45d33624dda900734ce03c3cf55abaec8b8d8b..71a6fe49abe8b4824f519534f673a3e3afe9240b 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index da8c9979b25d9ad745a887dc442ba7d82762b2ff..a9d49419cace9b267f9e537594b725555bee746e 100644 (file)
@@ -24,9 +24,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > 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
index ce2bfa3dc99ee379b1c2ad87c48913178226ecab..dd219308d10b29d3ef2c5f16f67d4a2c243ed524 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 4 of #text > BODY > HTML > #document to 5 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > BODY > HTML > #document to 0 of #text > BODY > HTML > #document toDOMRange:range from 3 of #text > BODY > HTML > #document to 3 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > BODY > HTML > #document to 4 of #text > BODY > HTML > #document toDOMRange:range from 3 of #text > BODY > HTML > #document to 3 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 609744c695d88a23a98e20750b4a1416f7aba05f..308ca2e6a0e96f60ddb6178759622b539f57ad80 100644 (file)
@@ -4,8 +4,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 4 of #text > BODY > HTML > #document to 4 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 6f9be6d2a3091f533b9c49bfabc50c8d603c83ef..1e59ed5359fb6b11190951e8b5eaa95f5ae0aa99 100644 (file)
@@ -4,8 +4,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 4 of #text > BODY > HTML > #document to 4 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index cde18eac4a60948c349405e59a1cb675b334a59a..8dbd697f1b6720d2a95f2c4198aae99eb898de3d 100644 (file)
@@ -10,9 +10,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 13 of #text > DIV > DIV > BODY > HTML > #document
@@ -22,9 +19,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 16 of #text > DIV > DIV > BODY > HTML > #document
diff --git a/LayoutTests/platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt b/LayoutTests/platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt
new file mode 100644 (file)
index 0000000..3021688
--- /dev/null
@@ -0,0 +1,18 @@
+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 {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {A} at (0,0) size 149x18 [color=#0000EE]
+          RenderText {#text} at (53,0) size 149x18
+            text run at (53,0) width 149: "rdar://problem/5645813"
+        RenderText {#text} at (202,0) size 4x18
+          text run at (202,0) width 4: "."
+      RenderBlock {DIV} at (0,34) size 784x18
+        RenderText {#text} at (0,0) size 80x18
+          text run at (0,0) width 80: "Selected text"
+selection start: position 5 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
+selection end:   position 18 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
index c542e2ae3beb52af114b16a5ca01df3ad19b31c3..fa888b173a5e7fb8fbe0e58cf8eefb6b67783cb1 100644 (file)
@@ -42,8 +42,6 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 39 of #text > SPAN > DIV > BODY > HTML > #document to 40 of #text > SPAN > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 39 of #text > SPAN > DIV > BODY > HTML > #document to 39 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 39 of #text > SPAN > DIV > BODY > HTML > #document to 39 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 38 of #text > SPAN > DIV > BODY > HTML > #document to 39 of #text > SPAN > DIV > BODY > HTML > #document
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 38 of #text > SPAN > DIV > BODY > HTML > #document to 38 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 38 of #text > SPAN > DIV > BODY > HTML > #document to 38 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index af4e5aa260be431c9d2e8fadb71c1f6d59ca1dd8..5dcd02151b0b62fc8438db5deb952900937681e4 100644 (file)
@@ -1,7 +1,7 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 0 of #text > A > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > A > DIV > BODY > HTML > #document to 4 of #text > A > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > A > DIV > BODY > HTML > #document to 4 of #text > A > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index bf0222bc2fd932da5f4ecd7ac6f2baf7c58f2c97..d0c50d1f032288673ba6a9125a95c5bee293ec13 100644 (file)
@@ -91,8 +91,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index e773f03cea848cdcc6fdf153486b7654798de400..638ca158882bb6b2fce3279cc5c550ba200af31e 100644 (file)
@@ -1,7 +1,8 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > SPAN > DIV > BODY > HTML > #document to 2 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index d859a07bf29099f4cf8fd21dbb5944b58db2cf54..e041523b5eae93e83c39a24b90de04e6ac9b810d 100644 (file)
@@ -1,7 +1,8 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > SPAN > DIV > BODY > HTML > #document to 2 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 55a814b451541935e8136e3afa40efa8cafb77d8..3c994b6a5e69d622c2f3f1bc2e921cd7a838f3c2 100644 (file)
@@ -64,7 +64,7 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 81651d822b9ecf92a2e773d8df8dad34d8cd5b5d..1df97e14f18f00c04d58afab062e09cae5dbaef1 100644 (file)
@@ -1,7 +1,8 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > SPAN > DIV > BODY > HTML > #document to 2 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 098cc71b57516650757e99ef1f0dfc5e07e3956c..449c0a5e3df81cc1a2c459237a125c59cf9dd8c3 100644 (file)
@@ -64,7 +64,7 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > B > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > B > DIV > BODY > HTML > #document to 7 of #text > B > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index abb69b41a23631045a07bae56b5c8d0da9d45969..d7165eb67f01cf8c8e6f2041f8ed3390ab8940f8 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        - fix <rdar://problem/5645813> CrashTracer: [USER] 6 crashes in Safari at com.apple.WebCore: WebCore::RenderBox::destroy + 116
+
+        Test: editing/selection/inconsistent-in-removeChildNode.html
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::nodeWillBeRemoved): If the selection
+        base or extent are not visible any more, adjust the selection.
+
 2008-01-19  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Eric Seidel.
index 4d68044c9d9b8feb09910a71d304e477ad8502fa..880876a06e90966600e9df6090115daa7f3f55a0 100644 (file)
@@ -168,8 +168,8 @@ void SelectionController::nodeWillBeRemoved(Node *node)
     if (isNone())
         return;
     
-    bool baseRemoved = removingNodeRemovesPosition(node, m_sel.base());
-    bool extentRemoved = removingNodeRemovesPosition(node, m_sel.extent());
+    bool baseRemoved = !m_sel.base().isCandidate() || removingNodeRemovesPosition(node, m_sel.base());
+    bool extentRemoved = !m_sel.extent().isCandidate() || removingNodeRemovesPosition(node, m_sel.extent());
     bool startRemoved = removingNodeRemovesPosition(node, m_sel.start());
     bool endRemoved = removingNodeRemovesPosition(node, m_sel.end());