Revision b5b3c1f0c2c224e863e50ad3f78ed5af0d73981e authored by Morten Stenshorne on 13 March 2018, 11:29:55 UTC, committed by Blink WPT Bot on 13 March 2018, 11:37:14 UTC
If clear is specified on an element whose first piece of content is
inside a child (so that the element's BFC offset cannot be determined at
the beginning of layout), we need this child to know about the clearance
offset on the parent, or it will not be pushed below adjacent floats as
it should. Just pushing the parent, but leaving the children unaffected
by clearance won't do. We need this in order to be able to lay out in a
single pass (and apply clearance when we detect it, rather than doing
it on the element with 'clear' and relayout the children if something
moved).

Since a constraint space's clearance offset is now "inherited" down the
tree, as long as we're within the same block formatting context, we now
also need to propagate the "is pushed by floats" flag upwards, or we
won't detect class C break points correctly. Without this the unit test
ClassCBreakPointBeforeBlockMarginCollapsing in
NGColumnLayoutAlgorithmTest would regress, because it would incorrectly
detect a class C break point before the break-inside:avoid block.
We must make sure that class C break points are only detected on the
outermost block that got pushed by floats, because it's there that
we'll get the gap between the inner edge of the container and the outer
edge of the child.

Added some tests. One of them fails in legacy (but not in NG). One of
the tests, clear-on-child-with-margins.html, passes both with and
without this code change, but I started to wonder if we'd suddenly
could end up pulling the parent of the box with 'clear' downwards, so
thought I better add it, to make sure we don't regress in this regard.

The test NoClassCBreakPointBeforeBfc in
NGColumnLayoutAlgorithmTest no longer needs its workaround,
because the display:flow-root child of #container now sets its
position correctly (past the float) right away.

Acid2 also looks slightly better now!

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I732b19398bd43b9874f6bb8c57ce435d1c510754
Reviewed-on: https://chromium-review.googlesource.com/957045
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542769}
1 parent c7a4bd8
History
File Mode Size
1x1-green.png -rw-r--r-- 135 bytes
2048x1360-random.jpg -rw-r--r-- 4.3 MB
A4.mp4 -rw-r--r-- 52.2 KB
A4.ogv -rw-r--r-- 92.2 KB
OWNERS -rw-r--r-- 21 bytes
counting.mp4 -rw-r--r-- 304.0 KB
counting.ogv -rw-r--r-- 183.4 KB
foo-no-cors.vtt -rw-r--r-- 42 bytes
foo.vtt -rw-r--r-- 42 bytes
foo.vtt.headers -rw-r--r-- 30 bytes
green-at-15.mp4 -rw-r--r-- 292.2 KB
green-at-15.ogv -rw-r--r-- 280.9 KB
movie_300.mp4 -rw-r--r-- 2.6 MB
movie_300.ogv -rw-r--r-- 2.2 MB
movie_5.mp4 -rw-r--r-- 30.9 KB
movie_5.ogv -rw-r--r-- 18.2 KB
poster.png -rw-r--r-- 13.8 KB
sound_5.mp3 -rw-r--r-- 22.9 KB
sound_5.oga -rw-r--r-- 18.1 KB
test-a-128k-44100Hz-1ch.webm -rw-r--r-- 9.6 KB
test-av-384k-44100Hz-1ch-320x240-30fps-10kfr.webm -rw-r--r-- 74.7 KB
test-v-128k-320x240-24fps-8kfr.webm -rw-r--r-- 37.3 KB
test.mp4 -rw-r--r-- 188.3 KB
test.ogv -rw-r--r-- 143.1 KB
white.mp4 -rw-r--r-- 13.4 KB
white.webm -rw-r--r-- 10.6 KB

back to top