New issue
Advanced search Search tips

Issue 796077 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[LayoutNG] Class C break points not supported

Project Member Reported by mstensho@chromium.org, Dec 19 2017

Issue description

It's allowed to break before the first in-flow child, if there's a gap between the content edge of a container and said first child. That's a class C break point. But LayoutNG doesn't yet support this.

https://www.w3.org/TR/css-break-3/#possible-breaks
 
tc.html
396 bytes View Download
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80fd8d85b990dee04e8c99498f31deb40ce9415d

commit 80fd8d85b990dee04e8c99498f31deb40ce9415d
Author: Morten Stenshorne <mstensho@chromium.org>
Date: Fri Jan 12 20:26:21 2018

[LayoutNG] Support for class C break points.

The usual place to break is *between* sibling in-flow blocks (class A
break points) or *between* sibling line boxes (class B break points).
However, in some cases we may also break *before* the first in-flow
child (block or line box) of a block. This is allowed when there's a gap
between the block-start inner (content) edge of the container and the
block-start outer (margin) edge of the first in-flow child. This is
called a class C break point [1].

Class C break points occur when floats push the outer block-start edge
of a child downwards in the block direction, either because the 'clear'
property is used, or because the content simply doesn't fit beside the
floats and needs to be pushed down.

Figuring out the margin edge of a block is tricky, due to margin
collapsing, so instead we pay attention to when blocks or lines get
pushed down by floats.

Don't let the fragment builder determine when we set a last resort
break. We used to base this decision on whether the child was the first
one. This is no longer good enough, due to class C break points. We need
to distinguish between in-flow children and floats, which the fragment
builder has no idea about. It may also be that we have a valid class C
break point before the very first child inside a container, if the child
is pushed down by floats in previous/ancestor containers within the same
formatting context. So let the layout algorithm deal with it instead.

[1] https://www.w3.org/TR/css-break-3/#possible-breaks

Bug:  796077 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I953cf01584a96b1860d694b36b5b19432de4dd47
Reviewed-on: https://chromium-review.googlesource.com/862144
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529048}
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm_test.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_container_fragment_builder.h
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc
[modify] https://crrev.com/80fd8d85b990dee04e8c99498f31deb40ce9415d/third_party/WebKit/Source/core/layout/ng/ng_layout_result.h

Status: Fixed (was: Assigned)

Sign in to add a comment