LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2006 00:09:37 +0000 (00:09 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2006 00:09:37 +0000 (00:09 +0000)
commite07460e6b82b1206388f6724185ab4ba384938f4
treeb4174c22f0edfe41b63366e5eacabd045ed7ece1
parenta49f5db133a2568281879905ce255c26d57df0c8
LayoutTests:

        Reviewed by levi

        Added to demonstrate fixes:
        * editing/pasteboard/merge-after-delete-expected.checksum: Added.
        * editing/pasteboard/merge-after-delete-expected.png: Added.
        * editing/pasteboard/merge-after-delete-expected.txt: Added.
        * editing/pasteboard/merge-after-delete.html: Added.
        * editing/inserting/line-break-expected.checksum: Added.
        * editing/inserting/line-break-expected.png: Added.
        * editing/inserting/line-break-expected.txt: Added.
        * editing/inserting/line-break.html: Added.
        * editing/inserting/multiple-lines-selected-expected.checksum: Added.
        * editing/inserting/multiple-lines-selected-expected.png: Added.
        * editing/inserting/multiple-lines-selected-expected.txt: Added.
        * editing/inserting/multiple-lines-selected.html: Added.

        Fixed:
        * editing/deleting/collapse-whitespace-3587601-fix-expected.txt:
        * editing/deleting/delete-3775172-fix-expected.txt:
        * editing/deleting/delete-3928305-fix-expected.txt:
        * editing/deleting/delete-3959464-fix-expected.checksum:
        * editing/deleting/delete-3959464-fix-expected.png:
        * editing/deleting/delete-3959464-fix-expected.txt:
        * editing/deleting/delete-4038408-fix-expected.checksum:
        * editing/deleting/delete-4038408-fix-expected.png:
        * editing/deleting/delete-4038408-fix-expected.txt:
        * editing/deleting/delete-4038408-fix.html:
        * editing/deleting/delete-at-paragraph-boundaries-002-expected.txt:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.checksum:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.png:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.txt:
        * editing/deleting/delete-block-contents-001-expected.txt:
        * editing/deleting/delete-block-contents-002-expected.txt:
        * editing/deleting/delete-block-contents-003-expected.txt:
        * editing/deleting/delete-br-011-expected.checksum:
        * editing/deleting/delete-br-011-expected.png:
        * editing/deleting/delete-br-011-expected.txt:
        * editing/deleting/delete-image-004-expected.txt:
        * editing/deleting/delete-line-010-expected.txt:
        * editing/deleting/delete-line-015-expected.txt:
        * editing/deleting/delete-select-all-001-expected.checksum:
        * editing/deleting/delete-select-all-001-expected.png:
        * editing/deleting/delete-select-all-001-expected.txt:
        * editing/deleting/delete-select-all-002-expected.txt:
        * editing/deleting/delete-select-all-003-expected.checksum:
        * editing/deleting/delete-select-all-003-expected.png:
        * editing/deleting/delete-select-all-003-expected.txt:
        * editing/execCommand/insertImage-expected.checksum:
        * editing/execCommand/insertImage-expected.png:
        * editing/input/attributed-substring-from-range-lines-expected.txt:
        * editing/input/text-input-controller-expected.txt:
        * editing/inserting/insert-3654864-fix-expected.txt:
        * editing/inserting/insert-3659587-fix-expected.txt:
        * editing/inserting/insert-3775316-fix-expected.txt:
        * editing/inserting/insert-after-delete-001-expected.txt:
        * editing/inserting/insert-at-end-01-expected.txt:
        * editing/inserting/insert-at-end-02-expected.txt:
        * editing/inserting/insert-br-001-expected.txt:
        * editing/inserting/insert-br-005-expected.txt:
        * editing/pasteboard/4076267-3-expected.txt:
        * editing/pasteboard/4076267-expected.txt:
        * editing/pasteboard/drag-drop-modifies-page-expected.txt:
        * editing/pasteboard/paste-4035648-fix-expected.txt:
        * editing/pasteboard/paste-4039777-fix-expected.checksum:
        * editing/pasteboard/paste-4039777-fix-expected.png:
        * editing/pasteboard/paste-4039777-fix-expected.txt:
        * editing/pasteboard/paste-match-style-001-expected.txt:
        * editing/pasteboard/paste-match-style-002-expected.txt:
        * editing/pasteboard/smart-paste-006-expected.txt:
        * editing/pasteboard/smart-paste-007-expected.txt:
        * editing/selection/drag-to-contenteditable-iframe-expected.txt:
        * editing/style/block-style-005-expected.txt:
        * editing/style/typing-style-002-expected.txt:
        * editing/unsupported-content/list-delete-001-expected.checksum:
        * editing/unsupported-content/list-delete-001-expected.png:
        * editing/unsupported-content/list-delete-001-expected.txt:
        * editing/unsupported-content/list-delete-002-expected.checksum:
        * editing/unsupported-content/list-delete-002-expected.png:
        * editing/unsupported-content/list-delete-002-expected.txt:
        * editing/unsupported-content/table-delete-001-expected.checksum:
        * editing/unsupported-content/table-delete-001-expected.png:
        * editing/unsupported-content/table-delete-001-expected.txt:
        * editing/unsupported-content/table-delete-003-expected.checksum:
        * editing/unsupported-content/table-delete-003-expected.png:
        * editing/unsupported-content/table-delete-003-expected.txt:
        * fast/text/attributed-substring-from-range.html:

WebCore:

        Reviewed by levi

        * dom/Node.cpp:
        (WebCore::Node::firstDescendant): Added.
        * dom/Node.h:
        * dom/Range.cpp: Added a constructor that takes in Positions.
        (WebCore::Range::Range):
        * dom/Range.h:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::insertNodeAt):
        Let this function insert children into empty containers.
        Calls canHaveChildrenForEditing.
        (WebCore::CompositeEditCommand::appendNode): Assert that the parent canHaveChildrenForEditing.
        (WebCore::CompositeEditCommand::moveParagraph): Tell ReplaceSelectionCommand to select the
        replacement so that moveParagraph's callers have a valid destination after the move.
        * editing/CompositeEditCommand.h: Moved removeFullySelectedNode to DeleteSelectionCommand,
        made deleteTextFromNode virtual so that DeleteSelectionCommand can update it's endingPosition.
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
        Removed m_startNode, used a local variable.
        (WebCore::DeleteSelectionCommand::initializeStartEnd): Fixed special element expansion.
        (WebCore::DeleteSelectionCommand::initializePositionData): Compute the endingPosition up
        front and keep track of it as nodes and text are removed.
        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed use of m_startNode.
        (WebCore::DeleteSelectionCommand::removeFullySelectedNode): Moved from CompositeEditCommand.
        Update m_endingPosition as we remove nodes.
        (WebCore::DeleteSelectionCommand::deleteTextFromNode):
        Update m_endingPosition as we delete text.
        (WebCore::DeleteSelectionCommand::handleGeneralDelete): Retain the start block.  Cleaned up.
        (WebCore::DeleteSelectionCommand::mergeParagraphs): Recompute m_endingPosition since moveParagraph
        clobbers the old one.
        (WebCore::DeleteSelectionCommand::doApply): Fixed the logic for placeholder insertion after
        deletion. Make the placeholder decision before we do special element expansion.
        * editing/DeleteSelectionCommand.h:
        * editing/InsertLineBreakCommand.cpp:
        (WebCore::InsertLineBreakCommand::doApply): Fixed a bug where an extra br was inserted and cleaned
        up the code.
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply): Deletion of the current selection should do
        a merge (added a testcase).
        * editing/RebalanceWhitespaceCommand.cpp:
        (WebCore::RebalanceWhitespaceCommand::doUnapply): Remove/insert in a way that will trigger a layout.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Ditto.
        Merge even when the incoming fragment has interchange newlines (added a testcase).
        Merge when the selection being pasted into starts at the start of a block because not
        doing so would leave one or more hanging empty blocks.
        (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
        Rebalance whitespace using rebalanceWhitespaceAt because rebalanceWhitespace requires
        a selection, and a selection can't be created until whitespace has been rebalanced.
        * editing/htmlediting.cpp:
        (WebCore::canHaveChildrenForEditing): Added.
        * editing/htmlediting.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
98 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
LayoutTests/editing/deleting/delete-3775172-fix-expected.txt
LayoutTests/editing/deleting/delete-3928305-fix-expected.txt
LayoutTests/editing/deleting/delete-3959464-fix-expected.checksum
LayoutTests/editing/deleting/delete-3959464-fix-expected.png
LayoutTests/editing/deleting/delete-3959464-fix-expected.txt
LayoutTests/editing/deleting/delete-4038408-fix-expected.checksum
LayoutTests/editing/deleting/delete-4038408-fix-expected.png
LayoutTests/editing/deleting/delete-4038408-fix-expected.txt
LayoutTests/editing/deleting/delete-4038408-fix.html
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.checksum
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.png
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt
LayoutTests/editing/deleting/delete-block-contents-001-expected.txt
LayoutTests/editing/deleting/delete-block-contents-002-expected.txt
LayoutTests/editing/deleting/delete-block-contents-003-expected.txt
LayoutTests/editing/deleting/delete-br-011-expected.checksum
LayoutTests/editing/deleting/delete-br-011-expected.png
LayoutTests/editing/deleting/delete-br-011-expected.txt
LayoutTests/editing/deleting/delete-image-004-expected.txt
LayoutTests/editing/deleting/delete-line-010-expected.txt
LayoutTests/editing/deleting/delete-line-015-expected.txt
LayoutTests/editing/deleting/delete-select-all-001-expected.checksum
LayoutTests/editing/deleting/delete-select-all-001-expected.png
LayoutTests/editing/deleting/delete-select-all-001-expected.txt
LayoutTests/editing/deleting/delete-select-all-002-expected.txt
LayoutTests/editing/deleting/delete-select-all-003-expected.checksum
LayoutTests/editing/deleting/delete-select-all-003-expected.png
LayoutTests/editing/deleting/delete-select-all-003-expected.txt
LayoutTests/editing/execCommand/insertImage-expected.checksum
LayoutTests/editing/execCommand/insertImage-expected.png
LayoutTests/editing/input/attributed-substring-from-range-lines-expected.txt
LayoutTests/editing/input/text-input-controller-expected.txt
LayoutTests/editing/inserting/insert-3654864-fix-expected.txt
LayoutTests/editing/inserting/insert-3659587-fix-expected.txt
LayoutTests/editing/inserting/insert-3775316-fix-expected.txt
LayoutTests/editing/inserting/insert-after-delete-001-expected.txt
LayoutTests/editing/inserting/insert-at-end-01-expected.txt
LayoutTests/editing/inserting/insert-at-end-02-expected.txt
LayoutTests/editing/inserting/insert-br-001-expected.txt
LayoutTests/editing/inserting/insert-br-005-expected.txt
LayoutTests/editing/inserting/line-break-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/line-break-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/line-break-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/line-break.html [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-3-expected.txt
LayoutTests/editing/pasteboard/4076267-expected.txt
LayoutTests/editing/pasteboard/drag-drop-modifies-page-expected.txt
LayoutTests/editing/pasteboard/merge-after-delete-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-4035648-fix-expected.txt
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.checksum
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.png
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.txt
LayoutTests/editing/pasteboard/paste-match-style-001-expected.txt
LayoutTests/editing/pasteboard/paste-match-style-002-expected.txt
LayoutTests/editing/pasteboard/smart-paste-006-expected.txt
LayoutTests/editing/pasteboard/smart-paste-007-expected.txt
LayoutTests/editing/selection/drag-to-contenteditable-iframe-expected.txt
LayoutTests/editing/style/block-style-005-expected.txt
LayoutTests/editing/style/typing-style-002-expected.txt
LayoutTests/editing/unsupported-content/list-delete-001-expected.checksum
LayoutTests/editing/unsupported-content/list-delete-001-expected.png
LayoutTests/editing/unsupported-content/list-delete-001-expected.txt
LayoutTests/editing/unsupported-content/list-delete-002-expected.checksum
LayoutTests/editing/unsupported-content/list-delete-002-expected.png
LayoutTests/editing/unsupported-content/list-delete-002-expected.txt
LayoutTests/editing/unsupported-content/table-delete-001-expected.checksum
LayoutTests/editing/unsupported-content/table-delete-001-expected.png
LayoutTests/editing/unsupported-content/table-delete-001-expected.txt
LayoutTests/editing/unsupported-content/table-delete-003-expected.checksum
LayoutTests/editing/unsupported-content/table-delete-003-expected.png
LayoutTests/editing/unsupported-content/table-delete-003-expected.txt
LayoutTests/fast/text/attributed-substring-from-range.html
WebCore/ChangeLog
WebCore/dom/Node.cpp
WebCore/dom/Node.h
WebCore/dom/Range.cpp
WebCore/dom/Range.h
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/CompositeEditCommand.h
WebCore/editing/DeleteSelectionCommand.cpp
WebCore/editing/DeleteSelectionCommand.h
WebCore/editing/InsertLineBreakCommand.cpp
WebCore/editing/InsertParagraphSeparatorCommand.cpp
WebCore/editing/InsertTextCommand.cpp
WebCore/editing/RebalanceWhitespaceCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/htmlediting.cpp
WebCore/editing/htmlediting.h