[LayoutNG] Fix 'text-align' applied to 'white-space: pre-wrap'

This patch matches the behavior of 'text-align' applied to
'white-space: pre-wrap' and when the line wraps to the
current engine; do not include for 'justify' but do include
for other values.

Spec is not clear on this regard. An issue filed at:
https://github.com/w3c/csswg-drafts/issues/3440

It turned out that our tests cover the combination of the
properties only when lines do not wrap.

Because NGLineBreaker computes |has_only_trailing_spaces| as
part of the line breaking, the last lines and single lines
don't have such item. The difference caused the bug, but the
lack of tests prevented finding the problem. This patch adds
tests for this case.

Also, computing trailing space is moved to NGLineInfo as we
discovered it is needed in other cases too, with more cases
covered and with unit tests.

Bug: 913995
Change-Id: I49428f2dcf193e2b7a745431f82724308a17d90f
Reviewed-on: https://chromium-review.googlesource.com/c/1374331
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616617}
11 files changed