Commit 581c07bc authored by harrison's avatar harrison

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned

        * editing/deleting/delete-br-012-expected.checksum: Added.
        * editing/deleting/delete-br-012-expected.png: Added.
        * editing/deleting/delete-br-012-expected.txt: Added.
        * editing/deleting/delete-br-012.html: Added.

WebCore:

        Reviewed by Darin.

        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned

        Test:
        * editing/deleting/delete-br-012.html
        
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
        Update m_endingPosition when preventing merge.
        Also removed setting of m_mergeBlocksAfterDelete when this function returns true, because is is not checked in this case.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 84df0c82
2006-11-06 David Harrison <harrison@apple.com>
Reviewed by Darin.
<rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned
* editing/deleting/delete-br-012-expected.checksum: Added.
* editing/deleting/delete-br-012-expected.png: Added.
* editing/deleting/delete-br-012-expected.txt: Added.
* editing/deleting/delete-br-012.html: Added.
2006-11-06 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Sam Weinig.
9119ef6ae00aa9d31fdd67d75ac7f806
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
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 784x62 [border: (2px solid #FF0000)]
RenderBlock {DIV} at (14,14) size 756x34 [border: (3px solid #000000)]
RenderText {#text} at (3,3) size 49x28
text run at (3,3) width 49: "hello"
RenderBlock (anonymous) at (14,48) size 756x0
RenderBlock {DIV} at (0,62) size 784x24 [border: (3px solid #0000FF)]
RenderBR {BR} at (3,3) size 0x18
caret: position 0 of child 0 {BR} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function editingTest() {
deleteCommand();
}
</script>
<title>Editing Test</title>
</head>
<body onload="runEditingTest();" contenteditable id="root">
<div class="editing">
<div style="border-style:solid; border-color:black;">
hello
</div>
<br>
</div>
<div id="test" style="border-style:solid; border-color:blue;">
<br>
</div>
</body></html>
\ No newline at end of file
2006-11-06 David Harrison <harrison@apple.com>
Reviewed by Darin.
<rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned
Test:
* editing/deleting/delete-br-012.html
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
Update m_endingPosition when preventing merge.
Also removed setting of m_mergeBlocksAfterDelete when this function returns true, because is is not checked in this case.
2006-11-06 Mark Rowe <bdash@webkit.org>
Reviewed by Maciej.
......@@ -194,15 +194,16 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && m_downstreamStart.node() == m_upstreamEnd.node();
if (isBROnLineByItself) {
removeNode(m_downstreamStart.node());
m_mergeBlocksAfterDelete = false;
return true;
}
// Not a special-case delete per se, but we can detect that the merging of content between blocks
// should not be done.
if (upstreamStartIsBR && downstreamStartIsBR)
if (upstreamStartIsBR && downstreamStartIsBR) {
m_mergeBlocksAfterDelete = false;
m_endingPosition = m_downstreamEnd;
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment