Currently we are relay on selection text and selection start offset from Blink to do log. However, there are few drawbacks to do so. Java side need to keep updating global selection, keeps another copy of selection string. It also brings extra string manipulation, which could introduce potential runtime errors.
The idea is to replace this with Blink side tracking, as described in https://docs.google.com/document/d/1eQ8Rtg3Qxc5NxkIdq6eqk8cjNZRs6-cyXU6ggjSC3FU/edit approach#5, we are going to handle selection start offset change and compute word indices in Blink side, and then passing such info to Java side logger.
Comment 1 by ctzsm@chromium.org
, Nov 6 2017