2009-03-31 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2009 04:41:34 +0000 (04:41 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2009 04:41:34 +0000 (04:41 +0000)
commit358e80b82d26f34adbc3e8902f9ef0c208c05481
tree76cbfcb8a4bc658c7c82beb45a9d82dd14804b94
parent43afdd5a768777ba55fe0397b7a89ad652ef2e56
2009-03-31  Darin Adler  <darin@apple.com>

        Reviewed by Eric Seidel.

        Bug 24621: PositionIterator doesn't iterate "after last child" positions when going backwards
        https://bugs.webkit.org/show_bug.cgi?id=24621

        * dom/PositionIterator.cpp:
        (WebCore::PositionIterator::decrement): Make sure that when the parent has no children, we
        don't ever use Position::uncheckedPreviousOffset. This is consistent with the forward
        iterator, but also should never arise because of the fix below.
        * dom/PositionIterator.h:
        (WebCore::PositionIterator::PositionIterator): Fixed so m_offset will always be 0 when
        the passed-in node has no children. Like the change above, this is consistent with the rest
        of the class, although in the long run I think it's a bit strange to treat a <p> element
        with no children differently than a <p> element with children.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/dom/PositionIterator.cpp
WebCore/dom/PositionIterator.h