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