Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Sep 2004 17:06:05 +0000 (17:06 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Sep 2004 17:06:05 +0000 (17:06 +0000)
commit7b0eeff080328d2b156bdf144eccfa98398af973
tree8bc3460560eb415a53af8612967794324d60bbfe
parent494badc1b23dc9c14ae9ad0c6a14fb015a6dc5ef
    Reviewed by John

        Fix for these bugs:

        <rdar://problem/3729219> REGRESSION (Mail): Caret placement and navigation not working correctly at yahoo.com
        <rdar://problem/3758606> REGRESSION (Mail): Deletions across DIV elements is broken
        <rdar://problem/3784810> REGRESSION (Mail): delete at beginning of line instead deletes to the end of the document (simple reduced test)

        I made some very big improvements to the code which handles deletions of selections
        which span more than one block.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::deleteUnrenderedText): An new, overloaded version of this
        function which works on a NodeImpl. The code in this function fell out of some refactoring
        I did in the function with the same name which takes a Position as an argument.
        (khtml::DeleteSelectionCommandImpl::moveNodesToBlock): New function. This new logic provides
        the smarts to fix the bugs listed above and greatly improves the code to perform deleting
        selections which span more than one block.
        (khtml::DeleteSelectionCommandImpl::doApply): Several changes. Constrain downstream positions
        so that they stay in the current block. This was a mistake before I think. Add code to detect
        when the insertion point is a caret at the start of a block. This is a special-case of a
        cross-block selection. Change the end-of-deletion-fixup case to operate on the downstreamEnd
        position of the selection rather than the upstream. This is more logical. Refine the block
        merge logic to handle more cases, like dealing with whitespace.
        * khtml/editing/htmlediting_impl.h: Associated header file changes.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::rootEditableElement): Add code to clamp the return value to the body element.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): Make selection canonicalizations stay in the current block.
        * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt:
        * layout-tests/editing/deleting/delete-block-merge-contents-001.html:
        * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-002.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-003.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-004.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-005.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-006.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-007.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-008.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-009-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-009.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-010-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-010.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-011-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-011.html: Added.
        * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Updated with new results.
        * layout-tests/editing/inserting/insert-3654864-fix.html: Updated test to deal better with
        improved select all behavior.
        * layout-tests/editing/selection/select-all-003-expected.txt: Updated with new results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/editing/deleting/delete-block-merge-contents-001-expected.txt
LayoutTests/editing/deleting/delete-block-merge-contents-001.html
LayoutTests/editing/deleting/delete-block-merge-contents-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-002.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-003.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-004.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-005.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-006-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-006.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-007-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-007.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-008-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-008.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-009-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-009.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-010-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-010.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-011-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-011.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-3654864-fix-expected.txt
LayoutTests/editing/inserting/insert-3654864-fix.html
LayoutTests/editing/selection/select-all-003-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/SelectionController.cpp
WebCore/khtml/editing/htmlediting_impl.cpp
WebCore/khtml/editing/htmlediting_impl.h
WebCore/khtml/editing/selection.cpp
WebCore/khtml/xml/dom_nodeimpl.cpp
WebCore/khtml/xml/dom_selection.cpp