[LayoutNG] Fix RebuildBoxStates to compute needs_box_fragment

This patch fixes RebuildBoxStates to compute
|needs_box_fragment| correctly.

|needs_box_fragment| was not computed correctly because
child boxes can set it when NGInlineLayoutAlgorithm handles
open/close tags.

This patch moves the logic to NGInlineItemsBuilder so that
|needs_box_fragment| is computed during PrepareLayout.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I635dcbed0939e5f23a9f6afb8ee6b22c48ab7da0
Reviewed-on: https://chromium-review.googlesource.com/c/1271655
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598942}
9 files changed