- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Fri, 18 Oct 2024 10:39:34 +0000
- To: public-css-archive@w3.org
> we are somewhat compat constrained if we want to keep stretch as a pure alias of `-webkit-fill-available` Blink and WebKit have different behaviors, so it's probably fine if we choose one or the other depending on the case. > Blink doesn't know anything about any proceeding margins In Servo we parallelize block layout (when there are no floats), so we also have this problem for preceding margins. > ignoring margins entirely might be an option Do you mean to just stretch the border box like WebKit? This can result in overflow if the margins don't end up collapsing, which seems bad. > consider the elements (own) margins if the element is a direct child of a BFC I think that ignoring margins for non-BFC parent is too restrictive. So I have another proposal. Given that: - `stretch` doesn't make that much sense if there are siblings - Margins collapsing through boxes was a [mistake](https://wiki.csswg.org/ideas/mistakes) and "the root of all margin-collapsing evil". - In case of doubt, it seems better to not overflow Then we could, for the purpose of resolving a vertical `stretch` on a block-level box: - Treat the top margin as 0 if the box has no preceding sibling, and the top margin is adjoining with the top margin of its parent - Treat the bottom margin as 0 if the box has no following sibling, and the bottom margin would be adjoining with the bottom margin of its parent if the parent’s sizing properties all had their initial values. For the purpose of checking preceding/following siblings, ignore collapsed whitespace and out-of-flow elements. So then I think we only need to check: - Whether the parent establishes an independent BFC - Whether the parent has vertical borders or padding - Whether our element has clearance (only for the top margin) - Whether our element is the first/last child Seems fine from an implementation POV. -- GitHub Notification of comment by Loirooriol Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11044#issuecomment-2422165458 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 18 October 2024 10:39:35 UTC