w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 661 forks source link

[css-multicol] Spanning elements late in the content, treated as column-span: none #2448

Open rachelandrew opened 6 years ago

rachelandrew commented 6 years ago

In the section for column-span is the following text:

"A spanning element takes up more space than the element would take up otherwise. When space is limited, it may be impossible to find room for the spanning element. In these cases, user agents may treat the element as if none had been specified on this property."

The current example 21 is a demonstration of the expected result. The only web UA currently rendering as per the example is Edge. Example CodePen. Chrome spans the element but ends up with a different rendering issue, I can't get the example to load in Safari.

I raised this as Chromium issue 821760, it was pointed out that the spec says "user agents may treat the element as if none had been specified on the property", and there was not interest in implementing the feature.

In the interest of interoperability, I wanted to raise this for discussion. Is this a useful thing for multicol to be doing in this case? I'd be interested in @dbaron's thoughts on it

css-meeting-bot commented 6 years ago

The Working Group just discussed Spanning elements late in the content, treated as column-span: none, and agreed to the following resolutions:

The full IRC log of that discussion <dael> Topic: Spanning elements late in the content, treated as column-span: none
<dael> github: https://github.com/w3c/csswg-drafts/issues/2448
<astearns> s/commented/commented that they can open an issue on level 2
<dael> rachelandrew: You've got a spanner that's late enough that there isn't space to span. UA may treat it as if non has been set. I raised this as an issue against chrome. FF doesn't span yet. THere's an example code pen in the issue from the spec.
<dael> rachelandrew: Chrome's behavior isn't particularly useful.
<dael> rachelandrew: There wasn't interest in impl the issue and they thought authors should refain from this. Is it useful to have in the spec?
<dael> florian: Chrome behavior is terrible so we shouldn't allow that.
<dael> rachelandrew: Yes, but their point was they didn't think this was usefult o have in the spec.
<dael> florian: If we have a good behavior it's worth a may in the spec. Is there an alternative to the may?
<dael> fantasai: No.
<dael> rachelandrew: What will you do with them?
<fantasai> s/No/Can't think of anything/
<dael> dbaron: This is column spanning lements in a multi col with a fixed height?
<dael> florian: Yeah.
<dael> dbaron: Model of column spanning elements if you split the multi col into multiple mulcticol and you can only apply the fixed height on the last. So you get to it and you've gone past the max height and what should you have done earlier to make it fit?
<dael> fantasai: I gues alternative is overflow downwards instead of creating more columns.
<dael> dbaron: Normally multicol with fixed heigh make more columns but you can't do that here unless you go back.
<dael> florian: Overflow toe xtra columns and span that?
<dael> fantasai: Don't know number of columns.
<dael> fantasai: [whiteboards] when you make a spanner it breaks into multiple sets of spanner columns.
<dael> fantasai: [draws a row with 3 small boxes and then a row with one long box and then seveal other rows] when you have one set of columns and run out of space it generates more columns. You spanner goes down. [draws a row with 5 columns/boxes] you overflow here and make more columns. It's not awesome but it's another possibility of what you can do.
<dael> Rossen: I see how you draw that but introducing breaks in columns is nuts.
<dael> florian: You have the spanner and the contents before you basically end up in a 2 pass thing.
<dael> dbaron: I could make a no-more multipass suggestion which is that if you have a multi-col with col-spans you never overflow by making more columns. Instead any sets of columns before a column span are auto height. THat's always true. You fill the height you need. Then you have to fill the height you need.
<dael> dbaron: Basically you ignore the height when you're generating sets of columns before the span and then you ignore when generating the span itself. Then you get to the last set of columns and you honor the height if it means making it taller. If it makes it shorter you do auto-height again. It's all overflow going down.
<dael> florian: I think okay.
<dael> dbaron: Only thing you'd do to honor the height is make the last set of columns taller to fix. Pretty different from waht multicol does otherwise, but seems not completely crazy.
<dael> florian: Are you suggesting you keep the may and allow either what's in the spec or this or just this?
<dael> dbaron: I'd like to spec one behavior. We can try and spec something sane for the other. BUt if you start to allow column spans in some cases you get a bottom column that's shorter and shorter.
<dael> florian: And then all the sudden it pops out of the spanner
<dael> fantasai: So dbaron your method is a mode switch depending on if you contain spans?
<dael> dbaron: You should know if you have spans up front.
<dael> florian: Depends on if it spans the entire multicol or the current fragment of the multicol. If it's the second you still have to do layout.
<dael> dbaron: I feel like fragments in the multicol aren't that different from [missed]
<dael> florian: That's true. If you're in a non-fragmented multicol you trigger on presense of spanners and if you're in fragmented multicol you always do this and only place you have to start worrying is the last one.
<dael> fantasai: Seems to me we should make the behavior undefined.
<dael> rachelandrew: That results in...well...
<dael> florian: Chrome does something bad.
<dael> astearns: What we have isn't what Chrome does
<dael> fantasai: They're filling hte content then there's a spanner and it has to go below.
<dael> florian: You don't layout your columns and then find out there's a spanner, you find out firs there's a spanner.
<dael> Rossen: Also when we want to have variable column count spanners it becomes hokey. Triggering breaks and switching overflow in what direction. Multicol is simple and elegent in what it does Overflow columns are always in one direction and spans always span the columns. You're not really creating rows and trying to use those rows...
<dael> fantasai: I think if you have a spanner you don't want column rules underneath. Conspectually you have rows of column boxes. Going forward we should not have a model of column boxes trough the spanners.
<dael> rachelandrew: I think that's right.
<dael> rachelandrew: Do we want to try and resolve or to go away and think?
<dael> Rossen: L1 or L2?
<dael> rachelandrew: The may is in L1. Edge does spec behavior.
<dael> Rossen: And chrome has a bug they can fix
<dael> florian: BUg allowed by spec.
<dael> rachelandrew: If this is what we want we should remove the may.
<dael> florian: And if we want to do the thing dbaron suggests it shouldn't do one or the other. Author should choose.
<dael> fantasai: What bother's me about dbaron model is for all content befor ethe spanner I add content, get one behavior and as soon as there's a spanner i get different behavior and that's weird. What if you want the other behavior anyways? Empty spanner?
<dael> dbaron: If you want continuity you should get that going from end of multicol not start. If you want hte thing with the spanner to be the same as without one way is to try and make it so the bit after the last spanner behaves same as no spanners.
<dael> dbaron: Still ahrd.
<rego> this example looks bad in Chromium: https://codepen.io/mrego/pen/GxLQJm
<dael> florian: If you try for that you're past max height so you have no space left and an infiniate number of 0 height columns.
<dael> dbaron: I'm thinking that way because balancing for the bit after the last span is the thing that honors things like column fill.
<dael> fantasai: Right. I still think it's...if you as an author wanted that I'll stil a 0 height spanner at the bottom. I don't think that's great. Interesting way for a mode switch.
<dael> florian: If you don't set a height we don't have the problem in the first place.
<dael> florian: If you combine that with Rossen comment that eventually we want to span n columns instead of all
<dael> Rossen: That's been a request since we into multi col
<dael> Rossen: Let's try and move forward. There's more work to be done if we want to move forward with this. And it's in L2. Let's resolve on L1.
<dael> Rossen: Choices 1) continue with the may 2) change to an undefined 3) may changes to must
<dael> florian: 3.
<dael> Rossen: And we'll add continuation in L2
<dbaron> I think one of the prior mistakes here was probably allowing column-spanning elements anywhere within a multicol rather than just at the start...many things would have been simpler if they could only be at the start.
<dael> fantasai: I vote 1 or 2 because as we try to figure out how n column spanners work we may have a better idea of how this should work.
<dael> florian: Which allows chrome to fix themselves.
<dael> astearns: But you shouldn't expect that to happen.
<dael> fantasai: I think that rethinking this once there's a model for n spanners it'll give us a way forward. Rather then prematurely desciding this case.
<dael> Rossen: Would chrome people have a problem with this as a must?
<dael> eae: It's very hard for us to implement that behavior. We know current isn't great.
<dael> Rossen: Outside of test cases I haven't see compat problems.
<dael> rachelandrew: It's edge casey.
<dael> Rossen: I propose we stay with the may for L1. If give Chrome the ability to continue but validates the other model Edge uses. In L2 we think more.
<dael> rachelandrew: I'll raise this against L2.
<dael> fantasai: And I'd mark rediscussed after we figure out n columns
<dael> florian: Well, while we do n columns.
<dael> Rossen: Do we need resolution?
<dael> fantasai: Prop: No change to L1 refiled against L2 to think about in context of n-spanners
<dael> Rossen: Opinions or Objections?
<dael> RESOLVED: No change to L1 refiled against L2 to think about in context of n-spanners