Reviewed by john
* editing/execCommand/indent-empty-root-expected.checksum: Added.
* editing/execCommand/indent-empty-root-expected.png: Added.
* editing/execCommand/indent-empty-root-expected.txt: Added.
* editing/execCommand/indent-empty-root.html: Added.
WebCore:
Reviewed by john
<http://bugzilla.opendarwin.org/show_bug.cgi?id=11002>
Gmail Editor: Crash at WebCore::SplitElementCommand::doApply() when attempting to indent in a new message
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::indentRegion): Special case
an empty root editable element.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16563
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-25 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by john
+
+ * editing/execCommand/indent-empty-root-expected.checksum: Added.
+ * editing/execCommand/indent-empty-root-expected.png: Added.
+ * editing/execCommand/indent-empty-root-expected.txt: Added.
+ * editing/execCommand/indent-empty-root.html: Added.
+
2006-09-24 Eric Seidel <eric@eseidel.com>
Reviewed by mjs.
--- /dev/null
+3163e8bd957297fceddf64a8046905ea
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 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 0 of BLOCKQUOTE > DIV > BODY > HTML > #document to 0 of BLOCKQUOTE > 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 784x576
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 291x18
+ text run at (0,0) width 291: "This tests Indent in an empty editable element."
+ RenderBlock {DIV} at (0,34) size 784x18
+ RenderBlock {BLOCKQUOTE} at (40,0) size 704x18
+ RenderBR {BR} at (0,0) size 0x18
+caret: position 0 of child 0 {BR} of child 0 {BLOCKQUOTE} of child 3 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<body>
+<p>This tests Indent in an empty editable element.</p>
+<div id="div" contentEditable="true"></div>
+
+<script>
+var div = document.getElementById("div");
+var sel = window.getSelection();
+sel.setPosition(div, 0);
+document.execCommand("Indent");
+</script>
+</body>
\ No newline at end of file
+2006-09-25 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by john
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=11002>
+ Gmail Editor: Crash at WebCore::SplitElementCommand::doApply() when attempting to indent in a new message
+
+ * editing/IndentOutdentCommand.cpp:
+ (WebCore::IndentOutdentCommand::indentRegion): Special case
+ an empty root editable element.
+
2006-09-25 Brady Eidson <beidson@apple.com>
Reviewed by Steve
ASSERT(!startOfSelection.isNull());
ASSERT(!endOfSelection.isNull());
+ // Special case empty root editable elements because there's nothing to split
+ // and there's nothing to move.
+ Node* startNode = startOfSelection.deepEquivalent().downstream().node();
+ if (startNode == startNode->rootEditableElement()) {
+ RefPtr<Node> blockquote = createElement(document(), "blockquote");
+ insertNodeAt(blockquote.get(), startNode, 0);
+ RefPtr<Node> placeholder = createBreakElement(document());
+ appendNode(placeholder.get(), blockquote.get());
+ setEndingSelection(Selection(Position(placeholder.get(), 0), DOWNSTREAM));
+ return;
+ }
+
Node* previousListNode = 0;
Node* newListNode = 0;
Node* newBlockquote = 0;