• Koji Ishii's avatar
    Support `box-decoration-break: clone` in NGLineBreaker · 4a368eae
    Koji Ishii authored
    In LayoutNG, when `box-decoration-break: clone` is set,
    |NGInlineBoxState| clones the inline box fragments for every
    line, but it had no effects in line breaking and measuring.
    
    This patch implements the logic in |NGLineBreaker| so that
    the property is taken account for line breaking, line width
    (and therefore `text-align`), min-max sizing, etc.
    
    |NGInlineNode::ComputeMinMaxSizes| started to hit DCHECK with
    the |NGLineBreaker| change, because it computes `max-content`
    from `min-content`. When this property clones box decorations
    to every line, the logic does not work. This patch disables
    the fast codepath, instead run a separate layout path when
    this property is effective. This fixed an old crbug.com/612641.
    
    This property is used ~0.7%. The regression crbug.com/1006599
    got 10 stars.
    
    Bug: 1006599, 612641
    Change-Id: I6425fb5e7f8dc951d882eb90d1c081abd127468e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454349Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
    Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
    Commit-Queue: Koji Ishii <kojii@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#815477}
    4a368eae
disable-layout-ng 51 KB