+2007-08-22 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Adam.
+
+ <rdar://problem/5418891> CrashTracer: [USER] 1 crash in Mail at -[WebViewEditor webView:shouldInsertText:replacingDOMRange:givenAction:]
+
+ * editing/inserting/5418891.html: Added.
+ * platform/mac/editing/inserting: Added.
+ * platform/mac/editing/inserting/5418891-expected.checksum: Added.
+ * platform/mac/editing/inserting/5418891-expected.png: Added.
+ * platform/mac/editing/inserting/5418891-expected.txt: Added.
+
2007-08-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adele.
--- /dev/null
+<style>
+blockquote {
+ color: blue;
+ border-left: 2px solid blue;
+ padding-left: 5px;
+ margin: 0px;
+}
+</style>
+<p>This tests for a crash when attempting to break a blockquote at the end of its content. The caret should be in the first of two empty paragraphs between two pieces of quoted content.</p>
+<div contenteditable="true">
+<blockquote type="cite"><table border="1"><tr><td id="td">foo</td></tr></table></blockquote>
+<br>
+<blockquote type="cite"><table border="1"><tr><td>bar</td></tr></table></blockquote>
+</div>
+
+<script>
+td = document.getElementById("td");
+text = td.firstChild;
+s = window.getSelection();
+s.setPosition(text, 3);
+document.execCommand("InsertNewlineInQuotedContent");
+</script>
--- /dev/null
+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 772x36
+ text run at (0,0) width 536: "This tests for a crash when attempting to break a blockquote at the end of its content. "
+ text run at (536,0) width 236: "The caret should be in the first of two"
+ text run at (0,18) width 358: "empty paragraphs between two pieces of quoted content."
+ RenderBlock {DIV} at (0,52) size 784x92
+ RenderBlock {BLOCKQUOTE} at (0,0) size 784x28 [color=#0000FF] [border: (2px solid #0000FF)]
+ RenderTable {TABLE} at (7,0) size 31x28 [color=#000000] [border: (1px outset #808080)]
+ RenderTableSection {TBODY} at (1,1) size 29x26
+ RenderTableRow {TR} at (0,2) size 29x22
+ RenderTableCell {TD} at (2,2) size 25x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (2,2) size 21x18
+ text run at (2,2) width 21: "foo"
+ RenderBlock (anonymous) at (0,28) size 784x36
+ RenderBR {BR} at (0,0) size 0x18
+ RenderBR {BR} at (0,18) size 0x18
+ RenderBlock {BLOCKQUOTE} at (0,64) size 784x28 [color=#0000FF] [border: (2px solid #0000FF)]
+ RenderTable {TABLE} at (7,0) size 30x28 [color=#000000] [border: (1px outset #808080)]
+ RenderTableSection {TBODY} at (1,1) size 28x26
+ RenderTableRow {TR} at (0,2) size 28x22
+ RenderTableCell {TD} at (2,2) size 24x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (2,2) size 20x18
+ text run at (2,2) width 20: "bar"
+caret: position 0 of child 2 {BR} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+2007-08-22 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Adam.
+
+ <rdar://problem/5418891> CrashTracer: [USER] 1 crash in Mail at -[WebViewEditor webView:shouldInsertText:replacingDOMRange:givenAction:]
+
+ * editing/BreakBlockquoteCommand.cpp:
+ (WebCore::BreakBlockquoteCommand::doApply): We're reusing the topBlockquote
+ variable. Null it out first. If there is no new topBlockquote and we don't null
+ it out first, we'll assume that there was a new one and crash.
+
2007-08-22 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adele.
// If a new start node was determined, find a new top block quote.
if (newStartNode) {
startNode = newStartNode;
+ topBlockquote = 0;
for (Node *node = startNode->parentNode(); node; node = node->parentNode()) {
if (isMailBlockquote(node))
topBlockquote = node;
}
- if (!topBlockquote || !topBlockquote->parentNode())
+ if (!topBlockquote || !topBlockquote->parentNode()) {
+ setEndingSelection(Selection(VisiblePosition(Position(startNode, 0))));
return;
+ }
}
// Build up list of ancestors in between the start node and the top blockquote.