Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LayoutNG] Mild cleanup and bugfixing of end margin strut handling.
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. The old layout test that now passes is actually because of this (dog ate BODY top margin), but that probably wasn't too obvious, so I added a dedicated WPT test for it. Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng Change-Id: Iec8cea316015c6d36ef6bab9acbe826513222b1d
- Loading branch information