[LayoutNG] Include inline float ancestors in "can fit" calculation.

This fixes float-avoids-padding-inline-ancestors.html.

We need to consider inline ancestors of floating objects to determine
if they can fit on a line. In order not to perform any layout object
tree walking we keep a "depth counter" on the inline item results.

This allows us to not perform a "scan forward" in the common case.

When we detect we *do* have ancestors, it perform a "scan forward",
however this stops whenever we have non-empty content or an open tag,
so should be relatively cheap.

Bug: 636993
Change-Id: Ic7df912de7aef8003b2c0b8a7a653b22eb7bd9f8
Reviewed-on: https://chromium-review.googlesource.com/c/1389475
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621335}
5 files changed