• Morten Stenshorne's avatar
    [LayoutNG] Refactor and fix code for breaking before a child. · 70586989
    Morten Stenshorne authored
    This was just meant to be a preparatory CL for adding support for
    avoiding breaks using the break-before and break-after properties, but
    ended up fixing bugs as well. :)
    
    This makes 3 web tests pass, because we now have more control over break
    avoidance, so that we can keep last resort breaks inside a child if
    breaking before would be just as bad. When two breakpoints are equally
    bad, prefer the one that takes us the furthest in the content.
    
    Rename BreakBeforeChild() to BreakBeforeChildIfNeeded(), and introduce
    BreakBeforeChild(), which actually always breaks before a child.
    BreakTypeBeforeChild() only partially contained the logic to determine
    whether and how to break, and has now been swallowed by
    BreakBeforeChildIfNeeded().
    
    Bug: 829028
    Change-Id: Ia620c19e1dfd31e88cf76eb7cea150a9e1152865
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829101Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
    Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
    Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#701456}
    70586989
TestExpectations 543 KB