Reviewed by Chris
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Feb 2005 22:53:43 +0000 (22:53 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Feb 2005 22:53:43 +0000 (22:53 +0000)
commit7c450223656cace1aee45fec481b673b6bf1147a
tree60bdc6324fbb259403ac369afc61dfb03ee51f0a
parent94239776625c69c299d0f4ba21524c8ab03873d8
    Reviewed by Chris

        Fix for these bugs:

        <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
        <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
        the fragment is inserted into the document, rendered, and then tested for certain
        important pieces of information that are required for pasting.
        (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
        the fragment nodes into the document.
        (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
        document, and restores them to the fragment.
        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
        did this before into its own function.
        (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
        (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
        eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
        counted are real, rendered blocks.
        (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
        CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
        in the short term while there are still versions of Mail out there that use <p> elements
        instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
        with other mail clients that use <p> elements for their paragraphs but render them themselves
        with no margins as the result of quirks.
        (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
        of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
        coupled with the refactoring, fixes 4014393.
        * khtml/editing/htmlediting.h: Updated for new functions.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/editing/pasteboard/paste-text-010-expected.txt
LayoutTests/editing/pasteboard/paste-text-011-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h