Make NGOffsetMapping available for non-LayoutNG LayoutBlockFlow

This patch allows computing NGOffsetMapping for legacy inline
formatting context.

For an experimental project "Invisible DOM"[1][2] to support
the find-in-page feature, it is needed to compute the text
content with whitespace collapsing applied, along with the
mapping to the DOM offset. This patch adds an API to compute
NGOffsetMapping even when the LayoutBlockFlow is not laid out
by LayoutNG for that purpose.

Note that the project is still in the early phase. We may
revisit the design as it moves forward.

[1] https://github.com/rakina/searchable-invisible-dom
[2] https://www.chromestatus.com/feature/5105291213406208

Bug: 636993, 873057
Change-Id: I101b411960813a7b9b5c9c6e2db85d28737af882
Reviewed-on: https://chromium-review.googlesource.com/c/1322184
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606292}
3 files changed