This patch mirrors the last, which implemented Intl.Segmenter support for expanding range starts.
Specifically, it:
Extracts most of the logic of expandRangeStartToWordBound to a new helper method, expandToNearestWordBoundaryPointUsingSegments.
Adds logic to getTextNodesInSameBlock to also return any text subnodes of the given node, if it is not already a text node. This is mainly needed because DOM traversal works differently in reverse (if we traverse forward from node we will traverse all of its children; if we traverse backward from node we do not).
The diff will also show some changes to backwardTraverse and the existing body of expandRangeStartToWordBound, but these are just auto-formatting.
This patch mirrors the last, which implemented Intl.Segmenter support for expanding range starts.
Specifically, it:
expandRangeStartToWordBound
to a new helper method,expandToNearestWordBoundaryPointUsingSegments
.getTextNodesInSameBlock
to also return any text subnodes of the given node, if it is not already a text node. This is mainly needed because DOM traversal works differently in reverse (if we traverse forward fromnode
we will traverse all of its children; if we traverse backward fromnode
we do not).The diff will also show some changes to
backwardTraverse
and the existing body ofexpandRangeStartToWordBound
, but these are just auto-formatting.