LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2006 22:17:51 +0000 (22:17 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2006 22:17:51 +0000 (22:17 +0000)
        Reviewed by levi

        * editing/pasteboard/pasting-object-expected.checksum: Added.
        * editing/pasteboard/pasting-object-expected.png: Added.
        * editing/pasteboard/pasting-object-expected.txt: Added.
        * editing/pasteboard/pasting-object.html: Added.

WebCore:

        Reviewed by levi

        * editing/htmlediting.cpp:
        (WebCore::canHaveChildrenForEditing): Don't insert children into
        object tags while editing.

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

LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/pasting-object-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/pasting-object-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/pasting-object-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/pasting-object.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/htmlediting.cpp

index 9a11cdd58b92b6ba8db419a9d48da12e6d814ff8..b9eaa8f7202111250557f4b34a9f45b08eeadfd9 100644 (file)
@@ -1,3 +1,12 @@
+2006-06-30  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by levi
+
+        * editing/pasteboard/pasting-object-expected.checksum: Added.
+        * editing/pasteboard/pasting-object-expected.png: Added.
+        * editing/pasteboard/pasting-object-expected.txt: Added.
+        * editing/pasteboard/pasting-object.html: Added.
+
 2006-06-30  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/editing/pasteboard/pasting-object-expected.checksum b/LayoutTests/editing/pasteboard/pasting-object-expected.checksum
new file mode 100644 (file)
index 0000000..db7dbeb
--- /dev/null
@@ -0,0 +1 @@
+ddb47168f0e155bd53c873769879386a
\ No newline at end of file
diff --git a/LayoutTests/editing/pasteboard/pasting-object-expected.png b/LayoutTests/editing/pasteboard/pasting-object-expected.png
new file mode 100644 (file)
index 0000000..1f51d8e
Binary files /dev/null and b/LayoutTests/editing/pasteboard/pasting-object-expected.png differ
diff --git a/LayoutTests/editing/pasteboard/pasting-object-expected.txt b/LayoutTests/editing/pasteboard/pasting-object-expected.txt
new file mode 100644 (file)
index 0000000..4d2724a
--- /dev/null
@@ -0,0 +1,23 @@
+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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of 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 {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 757x36
+          text run at (0,0) width 757: "This tests for a bug where attachments dragged into Mail documents blew all content after the position being pasted into."
+          text run at (0,18) width 319: "You should see \"Hello[black box] World!\" below."
+      RenderBlock {DIV} at (0,52) size 784x156
+        RenderText {#text} at (0,138) size 35x18
+          text run at (0,138) width 35: "Hello"
+        RenderPartObject {OBJECT} at (35,0) size 302x152 [border: (1px solid #AAAAAA)]
+        RenderText {#text} at (337,138) size 49x18
+          text run at (337,138) width 49: " World!"
+caret: position 1 of child 1 {OBJECT} of child 3 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/pasteboard/pasting-object.html b/LayoutTests/editing/pasteboard/pasting-object.html
new file mode 100644 (file)
index 0000000..41ebda8
--- /dev/null
@@ -0,0 +1,11 @@
+<body>
+<p>This tests for a bug where attachments dragged into Mail documents blew all content after the position being pasted into.  You should see "Hello[black box] World!" below.</p>
+<div id="test" contenteditable="true">Hello World!</div>
+</body>
+
+<script>
+var s = window.getSelection();
+s.setPosition(document.getElementById("test"), 0);
+
+s.modify("move", "forward", "word");
+</script>
\ No newline at end of file
index abcd7f28ddee309b214f2cd91c62330ce279fac5..6bb8e9d27aad452a175774bfc954c53e9c85c737 100644 (file)
@@ -1,3 +1,11 @@
+2006-06-30  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by levi
+
+        * editing/htmlediting.cpp:
+        (WebCore::canHaveChildrenForEditing): Don't insert children into
+        object tags while editing.
+
 2006-06-30  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 6f517a0431973616f2f4dca4ea2f35229eaaa2f7..6dc1b4d1a6a5717af797bfa260c08340f5f82d86 100644 (file)
@@ -83,6 +83,7 @@ bool canHaveChildrenForEditing(const Node* node)
            !node->hasTagName(brTag) &&
            !node->hasTagName(imgTag) &&
            !node->hasTagName(buttonTag) &&
+           !node->hasTagName(objectTag) &&
            !node->isTextNode();
 }