Re: [csswg-drafts] [css-box-4] Use cases for margin-trim on floats (#8547)

The CSS Working Group just discussed `[css-box-4] Use cases for margin-trim on floats`, and agreed to the following:

* `RESOLUTION: margin-trim doesn't apply to floats (by default), and we'll explore the interaction in the future`

<details><summary>The full IRC log of that discussion</summary>
&lt;bramus> Sammy_Gill: this is an open ended discussion. whjile doing some prelim work on floats we found that there ar esome complexities<br>
&lt;bramus> … we want to come back to the wg and see if there has been high demand or if there are signifcatn benefits to authors<br>
&lt;bramus> fantasai: (draws on whiteboard)<br>
&lt;bramus> fantasai: i can see wanting to ???<br>
&lt;iank_> q+<br>
&lt;bramus> … i have a page with some text at the top and an image here<br>
&lt;bramus> … you generally want float and text to be flush<br>
&lt;florian> q+<br>
&lt;bramus> … if we trim all margins on the inline stuff but not the float you are gonna have a margin at the top that was not there<br>
&lt;bramus> … why the margin? maybe you have two floats. I can see having two different for floats vs other thing.<br>
&lt;bramus> … it is possible that if you float sth it is not furthest to the side<br>
&lt;bramus> … so you might not be able to select the float that is flush with the side<br>
&lt;bramus> … that is the use case<br>
&lt;astearns> ack iank_<br>
&lt;bramus> iank_: i think when yeah it is sort of a judgement call. some folks want it, some dont<br>
&lt;bramus> … the implementation complexity is significant<br>
&lt;fantasai> s/two different/separate controls/<br>
&lt;fantasai> s/other thing/in-flow content/<br>
&lt;bramus> … for example, if you trim then that float might get replaced somewhere else<br>
&lt;bramus> … another one is that you  may have to restyle layout from the root like bfc to get the layout to be correct.<br>
&lt;bramus> … you might need to backtrack the whole entire way<br>
&lt;bramus> … very complex<br>
&lt;astearns> ack florian<br>
&lt;bramus> florian: for floats that are meant to be floats, looking at print is a good source of use cases<br>
&lt;astearns> antenna house<br>
&lt;bramus> … if you look at antenna house formatter (css to pdf tool) they do this slightly differently. instead of margin trimming they let you set multiple types of margin which you can set separately, but that might not remove complexities<br>
&lt;bramus> … where you try to do a book-ish layout, you might need it<br>
&lt;fantasai> s/types of margin/types of margin, e.g. float-to-float margin, float-to-text margin, float-to-container margin,/<br>
&lt;bramus> iank_: a simple formatter might get away with this, but here its more complex<br>
&lt;bramus> astearns: that said, existence of thse controls in print formatters is evidence that some ppl do want to have control over these things<br>
&lt;bramus> iank_: yeah. from what i have seen, some ppl do want to control this<br>
&lt;bramus> … but compared to the general feature it is less<br>
&lt;bramus> … the demand is not as large from what i have seen<br>
&lt;bramus> fantasai: one q: are complexities from both axis or just from inline?<br>
&lt;bramus> iank_: the block start margin is likely fine modulo the placement thing<br>
&lt;bramus> … that might be acceptable<br>
&lt;bramus> … inline dimension there is complexities like block end<br>
&lt;bramus> … complexities on all sides. least troublesome is block start. most is block end<br>
&lt;dbaron> (inline dimensions in the middle for how troublesome)<br>
&lt;bramus> fantasai: block end margin is a complicated? Does it only apply to bfc root?<br>
&lt;bramus> Sammy_Gill: the trimming for block end margin extends through entire bfc and not just the block<br>
&lt;bramus> fantasai: for the bem because the float does not cause the non bfc root to grow/shrink<br>
&lt;bramus> iank_: ?? clears<br>
&lt;dbaron> iank: ...except when you have clearance<br>
&lt;astearns> iank_: except when you have clearance<br>
&lt;bramus> fantasai: if we had margin trim on block end side apply only to bfc root would probabyl satisfy the use cases<br>
&lt;bramus> iank_: it still is complex. that float might before the content. if it has end margin ??? it might get replaced ??? so you might need to backtrack<br>
&lt;bramus> fantasai: but you dont remove bem?<br>
&lt;bramus> iank_: that still is ???<br>
&lt;bramus> fantasai: it probably should not<br>
&lt;bramus> … it should not cause the float to ???<br>
&lt;dbaron> s/???/be placed again/   (?)<br>
&lt;bramus> … the margin trim should not on the bottom not cause it to move. it should allow the bottom marign of the bfc to shift upwards until it is flush with<br>
&lt;bramus> … the bottomless border edge of the floats<br>
&lt;bramus> … i think what wont cause problems<br>
&lt;dbaron> s/bottomless/bottom-most/<br>
&lt;bramus> … I thin kuse cases for block layout in general is block axies margin. cant think of example for inline axis trimming except for floats<br>
&lt;bramus> iank_: there is still issues with blocks and margins<br>
&lt;bramus> astearns: it may be around float stacking wehre bottom edge of one float can affect ??<br>
&lt;bramus> iank_: yeah, also fun stuff about ??? that clear stuff<br>
&lt;astearns> s/??/a subsequent float<br>
&lt;bramus> … brs get complicated<br>
&lt;florian> q+<br>
&lt;bramus> … brs are magical<br>
&lt;astearns> ack florian<br>
&lt;bramus> florian: so my takeaway that there are usecases and it is hard<br>
&lt;bramus> … suggestion to take it back to github<br>
&lt;myles> q?<br>
&lt;bramus> fantasai: suggestion not apply margin trim by derafult to floats, try and find a syntax that would allow margin trim to apply to only floats or floats and all other content, and then work through some of the block axis issues at least<br>
&lt;bramus> myles: one side is about implementation discussion, then making this an authoer opt in does not help<br>
&lt;fantasai> fantasai: but then you can implement it in stages<br>
&lt;florian> q?<br>
&lt;florian> q+<br>
&lt;bramus> iank_: if we make default not apply to floats, then webkit can make ??? then we can add an extension to floats which we can decide upon later<br>
&lt;astearns> s/make ???/implement without affecting floats<br>
&lt;dbaron> ScribeNick: dbaron<br>
&lt;florian> florian: opt-in to be defined later also allows for introducing partial solutions as opt ins, if we can find some that are reasonably easy to implement and do solve meaningful subsets of use cases<br>
&lt;myles> q+<br>
&lt;florian> q-<br>
&lt;astearns> ack fantasai<br>
&lt;astearns> ack florian<br>
&lt;astearns> ack myles<br>
&lt;dbaron> myles: Main concern is about implementation cost of final thing eventually in the future.<br>
&lt;dbaron> myles: staging it out over years doesn't satify that.<br>
&lt;dbaron> myles: If we end up with multiple different opt-ins, problem is worse in the end.<br>
&lt;dbaron> fantasai: It seems that an author might reasonably set it independentyl for inline flow and floats.<br>
&lt;dbaron> fantasai: otherwise I wouldn't want this<br>
&lt;dbaron> myles: I'm not making a judgment about one side of the issue or the other ,just trying to clarify about implementation complexity.<br>
&lt;dbaron> fantasai: I want to talk more with Ian to understand where the complextiy is coming from.<br>
&lt;dbaron> fantasai: I wonder if the complexity is actually intended.<br>
&lt;dbaron> fantasai:  some of the complexity may not me desirable<br>
&lt;dbaron> iank_: Sammy_Gill may have more of it loaded in his head right now.<br>
&lt;dbaron> iank_: Discussion I had with Alan at WebKit a while ago.<br>
&lt;dbaron> astearns: not as much about margin-trim itself, but how it affects all of float positioning which is complicated<br>
&lt;dbaron> Sammy_Gill: example here is reasonable, but when you make it apply to all floats then it gets hairy<br>
&lt;astearns> and floats with shape-outside!<br>
&lt;dbaron> iank_: if we resolve not to apply to floats in the moment... web developers are great at telling us when they think something is broken, so we can get a sense of demand later on<br>
&lt;dbaron> myles: sounds like a great compromise<br>
&lt;dbaron> florian: in terms of usage,  ... usableness of floats increases significantly with well functioning fragmentation and page layouts.  So we don't see this much on the web.  If we increase our fragmentation capability, we might also increase our need for fancy floats, which will remain complicated.<br>
&lt;dbaron> florian:  original use case for floats not used all that often on the web, but used plenty on paged media<br>
&lt;dbaron> myles: comment about usage of floats or about margin-tripm<br>
&lt;dbaron> florian: floats in general... but once floats are used more, people will want more fancy floats features<br>
&lt;dbaron> hober: aren't floats used all the time, to a  first approxmitaion?<br>
&lt;dbaron> fantasai: way they're used on the web and the way they're used in paged media are quite different<br>
&lt;dbaron> fantasai: many ways they're used on the web are correctly being replaced by grid and flexbox<br>
&lt;dbaron> fantasai: if we hade developers trying to do what floats were intended for on the web, demand for these features would increase<br>
&lt;dbaron> myles: I think we should tentatively resolve that they don't apply to floats, and then try to understand use cases and slice/dice issues.<br>
&lt;dbaron> astearns: proposed resolution: margin-trim doesn't apply to floats (by default), and we'll explore the interaction in the future<br>
&lt;dbaron> RESOLUTION: margin-trim doesn't apply to floats (by default), and we'll explore the interaction in the future<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8547#issuecomment-1641093845 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 18 July 2023 22:57:25 UTC