Reviewed by Hyatt
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2004 21:52:22 +0000 (21:52 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Dec 2004 21:52:22 +0000 (21:52 +0000)
commit671347277f4969aa2fec9651a46285281a3192c6
tree36e3be404af9c35bee0aee079336d5ab2648db92
parent34f31bc93ce45324b3fbb8659c365d3b7b3b90dc
    Reviewed by Hyatt

        Some improvements for paste, including some new code to annotate
        whitespace when writing to the pasteboard to ensure that the meaning
        of the markup on the pasteboard is unambiguous.

        There is also new code for reading this annotated markup from the pasteboard,
        removing the nodes that were added only to prevent ambiguity.

        * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
        The header should have been added earlier, but I did not do so.
        * khtml/editing/html_interchange.cpp: Added.
        (convertHTMLTextToInterchangeFormat):
        * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
        Also fixed a bug in the code that counts blocks in a fragment.
        (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
        (khtml::ReplacementFragment::insertNodeBefore): New helper.
        (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
        for the replacement after deleting. This was causing a bug when pasting at the end of a block.
        * khtml/editing/htmlediting.h: Add some new declarations.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::stringValueForRange): New helper.
        (NodeImpl::renderedText): New helper to return only the rendered text in a node.
        (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
        should be added. Called by the paste code.
        * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.

        New test to check the khtml::ReplaceSelectionCommand::doApply fix.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-010.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/editing/pasteboard/paste-text-010-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-text-010.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/WebCore.pbproj/project.pbxproj
WebCore/khtml/editing/html_interchange.cpp [new file with mode: 0644]
WebCore/khtml/editing/html_interchange.h
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h
WebCore/khtml/xml/dom2_rangeimpl.cpp
WebCore/khtml/xml/dom_nodeimpl.cpp
WebCore/khtml/xml/dom_nodeimpl.h