LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2006 04:32:00 +0000 (04:32 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2006 04:32:00 +0000 (04:32 +0000)
        Test cases not reviewed but the corresponding fix was.

        - test cases for <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/

        * editing/pasteboard/nested-blocks-with-text-area-expected.txt: Added.
        * editing/pasteboard/nested-blocks-with-text-area.html: Added.
        * editing/pasteboard/nested-blocks-with-text-field-expected.txt: Added.
        * editing/pasteboard/nested-blocks-with-text-field.html: Added.

WebCore:

        Reviewed by Dave Harrison.

        - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/

        * editing/htmlediting.cpp:
        (WebCore::editingIgnoresContent):

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

LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/nested-blocks-with-text-area-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/nested-blocks-with-text-area.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/nested-blocks-with-text-field-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/nested-blocks-with-text-field.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/htmlediting.cpp

index aaebd1bf75a93b1c472e767ff218e79f507493c7..b31fcf4151526478ee2460fca40bf4007fa9c70f 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-17  Maciej Stachowiak  <mjs@apple.com>
+
+        Test cases not reviewed but the corresponding fix was.
+        
+        - test cases for <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
+
+        * editing/pasteboard/nested-blocks-with-text-area-expected.txt: Added.
+        * editing/pasteboard/nested-blocks-with-text-area.html: Added.
+        * editing/pasteboard/nested-blocks-with-text-field-expected.txt: Added.
+        * editing/pasteboard/nested-blocks-with-text-field.html: Added.
+
 2006-07-17  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/editing/pasteboard/nested-blocks-with-text-area-expected.txt b/LayoutTests/editing/pasteboard/nested-blocks-with-text-area-expected.txt
new file mode 100644 (file)
index 0000000..b29a338
--- /dev/null
@@ -0,0 +1,29 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 2 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 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
+  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 784x36
+        RenderText {#text} at (29,0) size 725x36
+          text run at (29,0) width 725: "This test checks that pasing in a combination of nested blocks where one starts with a text field doesn't crash or fail "
+          text run at (359,18) width 65: "assertions."
+      RenderBlock (anonymous) at (0,36) size 784x0
+      RenderBlock {DIV} at (0,36) size 784x36
+        RenderBlock {DIV} at (0,0) size 784x36
+          RenderTextField {TEXTAREA} at (302,2) size 163x28 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+          RenderText {#text} at (467,18) size 4x18
+            text run at (467,18) width 4: " "
+          RenderInline {SPAN} at (0,0) size 8x18
+            RenderText {#text} at (471,18) size 8x18
+              text run at (471,18) width 8: "x"
+          RenderText {#text} at (479,18) size 4x18
+            text run at (479,18) width 4: " "
+layer at (311,47) size 161x26
+  RenderBlock {DIV} at (1,1) size 161x26
+caret: position 1 of child 3 {#text} of child 0 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/pasteboard/nested-blocks-with-text-area.html b/LayoutTests/editing/pasteboard/nested-blocks-with-text-area.html
new file mode 100644 (file)
index 0000000..ff8a0aa
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+div { text-align: center; }
+</style>
+</head>
+
+<body contentEditable="true">
+
+
+<script>
+var s = window.getSelection();
+var e = document.body;
+
+s.setPosition(e, 0);
+document.execCommand("InsertHTML", false, "<div>This test checks that pasing in a combination of nested blocks where one starts with a text field doesn't crash or fail assertions.</div>\n<div>\n<div>\n<textarea> </textarea> \n<span>x</span>\n</div>\n</div>");
+
+</script>
+
+</body>
+</html>
+
diff --git a/LayoutTests/editing/pasteboard/nested-blocks-with-text-field-expected.txt b/LayoutTests/editing/pasteboard/nested-blocks-with-text-field-expected.txt
new file mode 100644 (file)
index 0000000..8658de4
--- /dev/null
@@ -0,0 +1,29 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 2 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 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
+  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 784x36
+        RenderText {#text} at (29,0) size 725x36
+          text run at (29,0) width 725: "This test checks that pasing in a combination of nested blocks where one starts with a text field doesn't crash or fail "
+          text run at (359,18) width 65: "assertions."
+      RenderBlock (anonymous) at (0,36) size 784x0
+      RenderBlock {DIV} at (0,36) size 784x23
+        RenderBlock {DIV} at (0,0) size 784x23
+          RenderTextField {INPUT} at (310,2) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderText {#text} at (460,2) size 4x18
+            text run at (460,2) width 4: " "
+          RenderInline {SPAN} at (0,0) size 8x18
+            RenderText {#text} at (464,2) size 8x18
+              text run at (464,2) width 8: "x"
+          RenderText {#text} at (472,2) size 4x18
+            text run at (472,2) width 4: " "
+layer at (321,49) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+caret: position 1 of child 3 {#text} of child 0 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/pasteboard/nested-blocks-with-text-field.html b/LayoutTests/editing/pasteboard/nested-blocks-with-text-field.html
new file mode 100644 (file)
index 0000000..a997ab2
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style>
+div { text-align: center; }
+</style>
+</head>
+
+<body contentEditable="true">
+
+
+<script>
+var s = window.getSelection();
+var e = document.body;
+
+s.setPosition(e, 0);
+document.execCommand("InsertHTML", false, "<div>This test checks that pasing in a combination of nested blocks where one starts with a text field doesn't crash or fail assertions.</div>\n<div>\n<div>\n<input type='text'> \n<span>x</span>\n</div>\n</div>");
+
+</script>
+
+</body>
+</html>
+
index c24b24aefadd66051fe4d9e1292994abbb8cdac9..ff55fa8accc1b7094ea0a5a5a9a93b2a4d0fa6be 100644 (file)
@@ -1,3 +1,12 @@
+2006-07-17  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Dave Harrison.
+        
+        - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
+
+        * editing/htmlediting.cpp:
+        (WebCore::editingIgnoresContent):
+
 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by levi
index 58e131474f9d61dcbcafbf9b69d18706825daeec..de6cf3c394dce8244f7c8d4b9b8157a46ddccfa6 100644 (file)
@@ -60,7 +60,7 @@ bool editingIgnoresContent(const Node *node)
         return true;
     
     if (node->renderer())
-        return node->renderer()->isWidget() || node->renderer()->isImage() || node->renderer()->isHR();
+        return node->renderer()->isWidget() || node->renderer()->isImage() || node->renderer()->isHR() || node->renderer()->isTextArea() || node->renderer()->isTextField();
 
     return node->hasTagName(appletTag) ||
            node->hasTagName(embedTag) ||