Make TextIteratorTextState to represent relative position explicitly
This patch makes |TextIteratorTextState| to represent relative position by explicit classification |PositionNodeType| with functions to emit code unit for each |PositionNodeType| instead of start and end offsets and computing parent node when emitting for improving code health. Before this patch, relative positions are encoded into start offset and end offset arguments of |SpliceBufer(code_unit, node, start, end)| as start=0, end=0 code_unit is emitted before node. start=0, end=1 code_unit is emitted as node. start=1, end=1 code_unit is emitted after node. in |TextIterator|. |SimpleBackwardTextIterator| passes |start| and |end| offsets of container node instead of encoded number of above. This patch is a preparation of the patch[1]. [1] http://crrev.com/c/1023502 Make CharacterIterator: :GetPosition{Before,After}() not to crash with block content Change-Id: I4be96f877fbcf1be52d2c4bc876226777353dc9a Reviewed-on: https://chromium-review.googlesource.com/1029393 Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#556384}
Showing
Please register or sign in to comment