Re: [csswg-drafts] How to increase margins of containers for pending floats ? (#4052)

None of the 10 proposed solutions are what I expect. All of them still leaves the float going "inside" the block (that they cover).
What I mean is jist allowing the container to have its margins increased so that the floats remain completely outside of it (even if this means that any blanks space left below the float will not be used by the new container, unless, it includes internal floats that ''may'' go in that margin (but only if they fit, but I think it complicates things).

What is sufficient is that, when increasing automatically the margins due to external floats still needing space, the minimum width for the new container will be respected; otherwise a vertical clear will occur along each successive floats pending vertically until there's space, or all floats have been cleared.

When such clear will occur, this will just increase the top margin of the new container, but the border, background, and content of the new container will be also moved vertically. As this leaves some space above the container, some of the pending floats may be placed there instead of stacking vertically. The renderer could automatically select the floats that best match that empty space.

The block formatting context does not help here.

And as I said the typical usage is for illustrations added in Wikpedia articles: there's no easy way to place them in the article, including when their vertical height is variable, and even ajustable (e.g. my collapsing/expanding a floatting infobox). As well we cannot predict the effective rendering display width, the article being read on narrow smartphones or large desktops.

It's a common problem in articles: it's difficult to find the appropriate place where to include these floatting illustration. So finally we use too many "clears" and space is wasted on all screens.

Note that the situation is simpler when all floatting illustrations or lateral notes will go to a dedicated and cumfortable lateral margin, but this is only used for output printed on paper with known page sizes.

Floats were initially intended for lateral ilustrations, and this is still the majority of use of them in Wikipedia articles (also with lateral infoboxes, or floatting TOC's which are collapsible). But finally we have to group all the floatting illustrations and boxes at top, an not in the relevant sections they should illustrate, so that they can stack correctly, and then we can remove all clears: this works well for dektop screen rendering but not so well for small mobile displays (notably those held in portrait mode), and that was the reason for creating another layout for the mobile version of the wikis.


-- 
GitHub Notification of comment by verdy-p
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4052#issuecomment-505212572 using your GitHub account

Received on Monday, 24 June 2019 23:00:40 UTC