Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2004 17:49:54 +0000 (17:49 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Sep 2004 17:49:54 +0000 (17:49 +0000)
commit778413625e369694cc0296014b02b202d7b5e528
tree76ae9cff0cce10e2930ca45ae406fb035bc631af
parent8b9245d0a6c4508ac08dff5c7cccb61d3b7329f0
    Reviewed by John

        Removed closestRenderedPosition function from Position class and gave this work
        to VisiblePosition instead. However, in order to make the transfer possible,
        VisiblePosition needed upstream and downstream affinities added to its
        constructors. Also moved the EAffinity enum into its own file. Also moved it
        to the khtml namespace.

        Updated several functions which used closestRenderedPosition to use VisiblePosition
        instead.

        Also deleted Position::equivalentShallowPosition. This was unused.

        * ForwardingHeaders/editing/text_affinity.h: Added.
        * ForwardingHeaders/editing/visible_position.h: Added.
        * WebCore.pbproj/project.pbxproj: Added new files.
        * khtml/editing/selection.cpp:
        (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/editing/selection.h:
        * khtml/editing/text_affinity.h: Added.
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::VisiblePosition):
        (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
        (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
        downstream checks for visible position. Renamed to describe this more clearly.
        * khtml/editing/visible_position.h:
        * khtml/editing/visible_units.cpp:
        (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
        (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::closestRenderedPosition): Removed.
        * khtml/xml/dom_position.h: Removed two functions mentioned above.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
        * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
        * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
        * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/editing/deleting/delete-block-merge-contents-012-expected.txt
LayoutTests/editing/deleting/delete-block-merge-contents-017-expected.txt
LayoutTests/editing/deleting/delete-contiguous-ws-001-expected.txt
LayoutTests/editing/selection/move-by-character-004-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/ForwardingHeaders/editing/text_affinity.h [new file with mode: 0644]
WebCore/ForwardingHeaders/editing/visible_position.h [new file with mode: 0644]
WebCore/WebCore.pbproj/project.pbxproj
WebCore/khtml/editing/SelectionController.cpp
WebCore/khtml/editing/SelectionController.h
WebCore/khtml/editing/selection.cpp
WebCore/khtml/editing/selection.h
WebCore/khtml/editing/text_affinity.h [new file with mode: 0644]
WebCore/khtml/editing/visible_position.cpp
WebCore/khtml/editing/visible_position.h
WebCore/khtml/editing/visible_units.cpp
WebCore/khtml/xml/dom_docimpl.cpp
WebCore/khtml/xml/dom_position.cpp
WebCore/khtml/xml/dom_position.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.mm