Bug 1436558 [wpt PR 9430] - [LayoutNG] Mild cleanup and bugfixing of end margin strut handling., a=testonly

Automatic update from web-platform-tests
Also some more documentation.

Tried to make the various situations a bit clearer, with documentation
and code. And shared code for layout abortion.

The code used to call MaybeUpdateFragmentBfcOffset() quite
unconditionally based on an *end* offset inside the block. I found it
confusing to use an end offset as a BFC start offset. The code was
correct, though, since MaybeUpdateFragmentBfcOffset() wouldn't do
anything if the BFC offset was already known (which would be the case
if had children with actual size, for instance, making for a strange
BFC offset in that case). We'll now only call
MaybeUpdateFragmentBfcOffset() if BFC offset is unknown.
That's the only time end_bfc_block_offset can actually be used as a BFC
start offset.

Fixed one bug, though: A block with explicit height:0 ate the input
margin, rather than letting it collapse through and propagate to
subsequent layout input nodes. The intention of the code was just to get
rid of the last child margin, since height was non-auto. Now we check if
we have a BFC offset before doing so. If we have BFC offset, it means
that no input margins should collapse through. And if we DON'T have a
BFC offset, leave the margins alone for subsequent layout input nodes.
Otherwise we'd just lose them.

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

<!-- Reviewable:start -->

<!-- Reviewable:end -->

wpt-commits: 19b995f0100dcc3c163153bd7e0a32249d736034
wpt-pr: 9430
reapplied-commits: 370e267e160568862f1fd9ec246ab5bb840f586e, fe4514c84e7ad28e46bad5da93381deb99b177f3, 7806af854343c043a2645a4034fdc7812f65daad, 9ddfd21554293dec5a4bf2e5375ae4f3c9f2ded0, 75f63c4d1ebc949647184fd60972fc7b9fd4affb, 1f3a5b496acd2288cc8cf0c32af86cb35157ea4e, 88b42bd5847abac58a62c4d6b33c1509bfce5f3d, 15c2e4c690700c6c115f8afe5e44ded10d943538, c8d461ef1437641ae7d4ea1d21e1e60cd62910b0, a6088a5f48ee299386a84d2f771902267d7355b1, 0634cd8f08ebe0905a9188fb1398c7b5f889c5dc, c8ee4a012dae506ae06bb5b2ad50942b04c1aaaa, c2c352456a4cf62dcc12f851138b04397675a445, b93a8879555d2fa7e7d4e00a275513a3a6338b35, b86e1331cb36634fd33677043b61fc0c1d8485bc, 44ddf14fd3346658c3223f13652073fafbfa48fa, a1a5840a6bb53e305ba02bcbeb215659342d0edb, 7465cb110ae5ec2e2ca73182caf5293f0efc8fd5, aad5349b3458bc3414e274b33fa86a1123901ff2, eca0907980d2769c449894a6277c60c1a306792f, 38626987c0cfd6e715cfcc6f4f1a1209191a03c5, e4a67f7ddcde6cd99348e9104bd7ed07074da44a, bb3c9990840a0fae2afc840b5952d7874785b112, 042d7adef0bdb9dc80e825c3997ace7519477c42, 99f1ea44fc7915b8b7b33bce4732fa8765fd3ac2, b81999f30c1516a70c153de51a0331d14c8faead
This commit is contained in:
Morten Stenshorne 2018-03-06 18:27:04 +00:00 коммит произвёл James Graham
Родитель be1c74aea2
Коммит 1ac01c8e29
2 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -68193,6 +68193,18 @@
{} {}
] ]
], ],
"css/CSS2/normal-flow/margin-collapse-through-zero-height-block.html": [
[
"/css/CSS2/normal-flow/margin-collapse-through-zero-height-block.html",
[
[
"/css/reference/ref-filled-green-200px-square.html",
"=="
]
],
{}
]
],
"css/CSS2/normal-flow/max-height-001.xht": [ "css/CSS2/normal-flow/max-height-001.xht": [
[ [
"/css/CSS2/normal-flow/max-height-001.xht", "/css/CSS2/normal-flow/max-height-001.xht",
@ -448166,6 +448178,10 @@
"a19a4cc8d7c500e01a0b591b16c13cd9a18773db", "a19a4cc8d7c500e01a0b591b16c13cd9a18773db",
"reftest" "reftest"
], ],
"css/CSS2/normal-flow/margin-collapse-through-zero-height-block.html": [
"33e6e180ed6e9896b7aeb3fcd9060bedb162291c",
"reftest"
],
"css/CSS2/normal-flow/max-height-001.xht": [ "css/CSS2/normal-flow/max-height-001.xht": [
"34a501cb70b591b6998234f3366361c33a064a18", "34a501cb70b591b6998234f3366361c33a064a18",
"reftest" "reftest"

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Collapse bottom margin from previous sibling through zero height block to next sibling</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<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-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="overflow:hidden; width:200px; height:400px; background:green;">
<div style="margin-bottom:200px;"></div>
<div style="height:0;"></div>
<div style="height:200px; margin-top:100px; background:white;"></div>
<div style="height:200px; background:red;"></div>
</div>