Reviewed by Kevin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 May 2005 04:03:34 +0000 (04:03 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 May 2005 04:03:34 +0000 (04:03 +0000)
commit68fdb9901047e08558c72f0d0835d293f16aaa29
treec2e5c681db8b20635551d9ca2f6b018ea4461ac8
parentd39c69868cf665989db49a9178bb5e1039882fcf
    Reviewed by Kevin.

- remove isFirstVisiblePositionInBlock and isLastVisiblePositionInBlock, in favor of isStartOfBlock and isEndOfBlock

It turned out that both isEndOfBlock and isLastVisiblePositionInBlock had (different) bugs,
and there was code relying on the bugs of each. So in addition I fixed isEndOfBlock and fixed
the parts of the code relying on buggy behavior.

I also removed the includeEndOfLine parameter to endOfBlock since no one used it and it's not
clear if it would ever be useful.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertLineBreakCommand::doApply): Use new calls.
        (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Don't gratuitously make
an UPSTREAM VisiblePosition, as this will cause trouble comparing it to end of block.
        (khtml::InsertParagraphSeparatorCommand::doApply): Use new calls.
        (khtml::ReplaceSelectionCommand::doApply): Use new calls. Also, don't make a position <BR,0> and test
if it is the end of a block, that can never be true, although the buggy code in
isLastVisiblePositionInBlock would say it is. Make <BR,1> instead.
        * khtml/editing/markup.cpp:
        (khtml::createMarkup): Instead of checking isEndOfBlock on the start position, check if the start's
next is in a different block, to avoid relying on the buggy old isEndOfBlock behavior.
        * khtml/editing/visible_position.cpp:
        (khtml::isFirstVisiblePositionInParagraph): Use isStartOfBlock.
        (khtml::isLastVisiblePositionInParagraph): Use isEndOfBlock.
        * khtml/editing/visible_position.h:
        * khtml/editing/visible_units.cpp:
        (khtml::endOfBlock): Greatly simplify, and no longer consider the start of a descendant
block to be the end of the block. That's inconsistent with how startOfBlock works. Also
remove include end of line parameter.
        (khtml::isEndOfBlock): Don't pass unneeded parameter.
        * khtml/editing/visible_units.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/markup.cpp
WebCore/khtml/editing/visible_position.cpp
WebCore/khtml/editing/visible_position.h
WebCore/khtml/editing/visible_units.cpp
WebCore/khtml/editing/visible_units.h