[LayoutNG] Margin collapsing complexity with empty blocks.

This patch does two things broadly...

1) If an empty block clears a float, we set the previous inflow
   position to the empty block *minus* the margin strut.

   This matches edges behaviour. I couldn't determine a sane behaviour
   for the other user agents.

2) If we resolve our BFC offset as a result of a child potentially
   clearing floats, *and* we have unpositioned direct float children,
   we set the previous inflow position to the top border edge, and
   reset the margin strut.

   I think this broadly matches other UAs behaviour, there is a note
   which I added about only forcing our BFC to resolve if
   unpositioned_floats_ contains the right type of float, but this
   can be looked at later.

Bug: 635619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I80ad01e12ad91f302b927103050055cffc6121f2
Reviewed-on: https://chromium-review.googlesource.com/577267
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488096}
6 files changed