Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Apr 2006 00:14:21 +0000 (00:14 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Apr 2006 00:14:21 +0000 (00:14 +0000)
commit6fd3415c177ae128e43a84232f5409a02fea50e3
tree0f42fed24c4227ac8c9b49977a9253d6fe7e46a7
parent1b841417a41d4fe7c351c43f5492a2c339d247fa
    Reviewed by Darin.

        <rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker does not respect paragraph boundary
        <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app

        AXPreviousSentenceStartTextMarkerForTextMarker failed to stop at the beginning a block because
        SimplifiedBackwardsTextIterator::handleNonTextNode() emitted a space when exiting the block.
        Fixed by emitting a newline instead.

        Word boundary failed to stop at the beginning of a block because no character at all was emitted
        when leaving the block, because the exitNode was checking specific html tags to decide whether the
        node is block, but the node was xml.  Fixed by using the node's renderer, if present.

        (see related changes in WebKit)

        Tests added:
        * editing/selection/extend-by-sentence-001.html: Added.
        * fast/dom/inner-text-001.html: Added.

        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
        Add sentence navigation/selection.

        * editing/Selection.cpp:
        (WebCore::Selection::validate):
        Add sentence navigation/selection.

        * editing/SelectionController.cpp:
        (WebCore::SelectionController::modifyExtendingRightForward):
        (WebCore::SelectionController::modifyMovingRightForward):
        (WebCore::SelectionController::modifyExtendingLeftBackward):
        (WebCore::SelectionController::modifyMovingLeftBackward):
        (WebCore::SelectionController::modify):
        Add sentence navigation/selection.

        * editing/TextGranularity.h:
        (WebCore::):
        Add SentenceGranularity and SentenceBoundary.

        * editing/TextIterator.cpp:
        (WebCore::isTableCell):
        (WebCore::shouldEmitTabBeforeNode):
        (WebCore::shouldEmitNewlineForNode):
        (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
        (WebCore::shouldEmitExtraNewlineForNode):
        New utility functions that prefer renderers over html tag names.

        (WebCore::TextIterator::handleNonTextNode):
        (WebCore::TextIterator::exitNode):
        (WebCore::SimplifiedBackwardsTextIterator::advance):
        Use new utility functions.

        (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
        Use new utility functions.  Also emit linefeed instead of space,
        so sentence parsing works across block boundaries.

        (WebCore::SimplifiedBackwardsTextIterator::exitNode):
        Use new utility functions.

        (WebCore::SimplifiedBackwardsTextIterator::emitNewline):
        Renamed from emitNewlineForBROrText because it is not always for BR or text.

        * editing/TextIterator.h:
        Renamed emitNewlineForBROrText to emitNewline.

        * editing/visible_units.cpp:
        * editing/visible_units.h:
        (WebCore::previousBoundary):
        (WebCore::nextBoundary):
        (WebCore::previousSentencePosition):
        (WebCore::nextSentencePosition):
        Add sentence navigation/selection.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/editing/Selection.cpp
WebCore/editing/SelectionController.cpp
WebCore/editing/TextGranularity.h
WebCore/editing/TextIterator.cpp
WebCore/editing/TextIterator.h
WebCore/editing/visible_units.cpp
WebCore/editing/visible_units.h