Reland "Fix bottleneck in AXObject::GetWordBoundaries"

This reverts commit 3064da20981be73b7acf2128dd407a5f3da78165.

Reason for revert: Purpose of original revert was just to
see that it was reflected on chromeperf. I can now confirm
that reverting this change does result in a significant
performance drop, so relanding it is worth it.

Original change's description:
> Revert "Fix bottleneck in AXObject::GetWordBoundaries"
> 
> This reverts commit c9218a18e39eb3e42245ee74f159594611d1e36f.
> 
> Reason for revert: Temporarily reverting in order to see
> if the performance on chromeperf changes.
> 
> Original change's description:
> > Fix bottleneck in AXObject::GetWordBoundaries
> > 
> > GetWordBoundaries is only used on an AXInlineTextBox, so it only needs
> > to return integer start and end offsets within a single node. It was
> > inefficient for it to return AXRanges, since AXRanges span multiple nodes
> > and do lots of validation and normalization.
> > 
> > This change leads to a ~3x speedup of this benchmark
> > (added in http://crrev.com/c/1410175):
> >   third_party/blink/perf_tests/accessibility/line-breaks.html
> > 
> > TBR=mkwst@chromium.org
> > 
> > Bug: 921789
> > Change-Id: I826feedc7863caa5ce4baa11de0971e68b1bf114
> > Reviewed-on: https://chromium-review.googlesource.com/c/1411212
> > Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
> > Reviewed-by: Alice Boxhall <aboxhall@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#623411}
> 
> TBR=dmazzoni@chromium.org,aboxhall@chromium.org,mkwst@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 921789
> Change-Id: Icdb625c4563691cb4771dd829f49f06cc165181c
> Reviewed-on: https://chromium-review.googlesource.com/c/1426170
> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
> Reviewed-by: Alice Boxhall <aboxhall@chromium.org>
> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#624700}

TBR=dmazzoni@chromium.org,aboxhall@chromium.org,mkwst@chromium.org

Change-Id: I775847259836684f1212610c66f5b0f0cbf3893c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 921789
Reviewed-on: https://chromium-review.googlesource.com/c/1426520
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624737}
5 files changed