gecko-dev/testing/web-platform/tests/css/CSS2/floats-clear/second-float-inside-empty-cleared-block-after-margin.html
Morten Stenshorne e47eb6df70 Bug 1459954 [wpt PR 10897] - [LayoutNG] Avoid false positives for clearance., a=testonly
Automatic update from web-platform-tests[LayoutNG] Avoid false positives for clearance.

Clearance inhibits margin collapsing and thus makes it possible to
resolve the BFC offset of its parent. In that regard we sometimes
incorrectly assumed that a child would get clearance. The only case
where we can tell for sure up front, is when there are adjoining floats
that match the value of the 'clear' property. In all other cases, we
first need to calculate the block-start border edge of the child.

Added a few new tests. Only two of them failed in NG prior to this CL,
but coverage seemed low, so I added them anyway. Two of them fail in the
legacy engine.

Move the code that detects pending child floats a bit further down, to
give HandleInflow() an opportunity to re-layout the child without
aborting container layout. Otherwise clearance on an empty block will
be lost when positioning the float. Added two tests for this
(second-float-inside-empty-cleared-block*), since nothing except a
multicol test (that happened to do complicated clearance stuff)
regressed.

Removed now unused bits from NGExclusionSpace.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I73b4aa02e5e88d1063f345db271cde1ad31ea9f5
Reviewed-on: https://chromium-review.googlesource.com/1049974
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557282}

--

wpt-commits: 857126e062ef13c28981a9a1a01df4695f74715d
wpt-pr: 10897
2018-05-18 11:15:13 +01:00

14 lines
845 B
HTML

<!DOCTYPE html>
<title>Float separated from float inside empty cleared block, margin before clearance</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#flow-control" title="9.5.2 Controlling flow next to floats: the 'clear' property">
<link rel="help" href="https://www.w3.org/TR/CSS22/box.html#collapsing-margins" title="8.3.1 Collapsing margins">
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="float:left; width:100px; height:50px; background:green;"></div>
<div style="height:1px;"></div>
<div style="margin-top:20px;">
<div style="clear:left;">
<div style="float:left; width:100px; height:50px; background:green;"></div>
</div>
</div>