-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-flexbox] Definiteness of flex items' main size depend on flex-basis's definiteness #1679
Comments
https://codepen.io/gsnedders/pen/GvjRNN is one of the original cases that I started having problems with; unlike the codepen linked above it doesn't have the flex container having a definite size. |
The conclusion at the F2F was to get opinions from implementors: @dholbert @FremyCompany @cbiesinger. |
@gregwhitworth asked me to see what happened with Grid in this case, so I threw together https://codepen.io/gsnedders/pen/ZJpYBY (this is essentially a minimally different example, just using grid); Firefox, Chrome, and Safari do what I expect there. (Up-to-date Edge is still downloading as I write this.) |
Microsoft EdgeHTML 16.16257 passes both flex and grid variants. So we have interop on grid doing what most authors seem to expect; we have Firefox and Edge doing what authors expect with flexbox and Chrome and Safari not. |
Yeah, I would strongly oppose changing our implementation to the one that authors aren't expecting, especially since the other engines are doing this in the grid case and we've tried, in many areas to keep flex/grid consistent. So if this works in Grid, and two impl can do it - then I think that Blink/Webkit should make it work for author ease and platform consistency. |
You mean away from the one that authors expect, I assume? Edge does what authors expect today. |
@gsnedders yes you're right, I updated the comment so people don't get confused. |
Issue here is that Grid's behavior comes from the fact that, while there may be some definite/indefinite shenanigans while figuring out how large the tracks are, once you do so, the tracks (and thus, the grid areas) have a definite size in px. If you then stretch the grid item into that space, they're considered definite as well, so child %s resolve. Flexbox doesn't have this two-tier notion. There's nothing in the spec currently to support the flex item's main size being treated as definite in this case; it's auto-height, and none of the special cases in Flexbox/9.8 apply. If you or a Firefox dev can tell us how you're getting it to have a definite size, that would be great. ^_^ |
/cc @dholbert |
The CSS Working Group just discussed The full IRC log of that discussion<dael> Topic: Definiteness of flex items' main size depend on flex-basis's definiteness<fantasai> https://github.com//issues/1679 <fantasai> github: https://github.com//issues/1679 <dael> fantasai: The grid has a behavior where we calc size of rows and columns whcih could depend on content we then do a pass to layout the items. So if the grid item is stretch or % it will resolve, as will any child. <dael> fantasai: Seems like there are impl of flexbox with a similar effect where a flex item is considered definite even though spec says if flex-item size depends on content the % wont' resolve. TabAtkins and I are happy to define what impl want, but we need to know if this was intentional or not. It does require another pass. <dael> fantasai: Basically, we want impl feedback. <dael> TabAtkins: Specfically FF and Edge. <fantasai> s/feedback/to say what they want us to put in the spec/ <dael> gregwhitworth: I was going to ask for another week if possible. <dael> gregwhitworth: I was going to look into our code more. Unless Gecko has feedback now. <dael> fantasai: Next week is good. <dael> Chris: Sounds good gregwhitworth. ANyone from FF, can they do input? <dael> fantasai: dbaron CCed dholbert. <dael> Chris: Great. We'll defer. |
Quoting @tabatkins : There's nothing in the spec currently to support the flex item's main size being treated as definite in this case; it's auto-height, and none of the special cases in Flexbox/9.8 apply. If you or a Firefox dev can tell us how you're getting it to have a definite size, that would be great. ^_^ In Firefox, we simply haven't gotten to implementing the relevant spec change/clarification (the change that said main-size definiteness depends on flex-basis's definiteness). bug 1092007 is filed on that, though. I tend to think it's a change we should make, but I just haven't gotten to it. |
We also haven't updated our implementation since 2015 for this section of spec text. By simply applying a definite |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Definiteness of flex items' main size depend on flex-basis's definiteness<dael> github topic: https://github.com//issues/1679 <dael> Bert: I think gregwhitworth wanted to look at code he had to compare. <dael> gregwhitworth: Is anybody from FF on? <dael> dbaron: I don't know if I'll be helpful. <dael> gregwhitworth: I put my information in the notes. I sat with our dev. We could out the same thing as dholbert. We haven't impl this aspect. I pushed him tos ee if this is right approach. Dholbert seemed to say he thought it was the right approach. <dael> gregwhitworth: WE do because everything is auto we do layout and then a second pass to resolve %. That's what authors also expect. I'm wondering if we should remove the constraing on #2 of 1.8. If you set definte flex basis and fixed height it does the extra work. I see a lot of authors doing this though it's not what they're expecting. <dael> fantasai: Bigger argument is we have introp on 2 impl and the authors expect that behavior. Spec says something else so we should change spec. <dael> gregwhitworth: And what dholbert posted to the list, we originally said hey performance. It's odd for authors to know that to set flex-basis to 0 is what you need to do for chorome to look like edge and ff. <fremy> fwiw I discussed this with gregwhitworth yesterday, and I totally +1 his request to remove the constraints on #2 <dael> gregwhitworth: Let's just removet he constraints of #2 under 9.8 <dael> fantasai: Reasonable to me. <dael> Bert: Me too, but I'm not expert. Other opinions? <dael> dbaron: I'm not sure how well performance bugs get tied back to this. I'm not sure if we heard there were performance bugs. <dbaron> s/heard/would have heard/ <dbaron> s/there/if there/ <dael> gregwhitworth: That's a valid arguments. I feel like we're going to argue a theory. Now that we have grid we'll be able to have less nested flexes is my guess so I'm not as worried about the circular problem. <dael> fantasai: IN grid % always resolved b/c grid sizing creates sizes for the tracks. Conseptually grid algo resolves the eq. code the way FF and Edge do flex right now. <dael> Bert: I'm hearing, fantasai , that there are impl that do and some that don't do the layout based sizing? <dael> gregwhitworth: Chrome and I believe I saw webkit and blink would have to change. As we stated the people on the thread aren't on the call. <gsnedders> FF and Edge agree, Chrome and Safari agree (but are one impl now again) <dael> Bert: Are we confident enough to decide? Do we need more input? <gsnedders> WebKit's implementation of flex was literally copied over from Blink a few months ago <dael> fantasai: Christian is away for the next couple months. We can ask dholbert that we want this resolution and ask for approval. From dholbert and whomever people want to tag. <dael> Bert: Sounds like a good way forward. If we document it in the issue is that enough? Do we need to contact personally? <dael> gregwhitworth: I say we just resolve since we discussed it. We can rediscuss if they want to get on a call <dael> Bert: Okay. <dael> Bert: wording for proposed resolution: <dael> gregwhitworth: It's what I said in #2. Basically re-wirte #2 of section 9.8 to % would resolve. <dael> fantasai: Allow % to resolve, re-open issue if dholbert or others want to rediscuss. <dael> Bert: Okay, that's the proposal. Objections? <gregwhitworth> s/it's what I said in #2/it's what I said in the issue <dael> RESOLVED: Allow % to resolve, re-open issue if dholbert or others want to rediscuss. |
…te wrt resolving percentages inside them. #1679.
Edits checked in. @gregwhitworth @gsnedders would you mind reviewing the edits to make sure that's what you intended? |
Yep, just removal of the definite flex basis - looks good. |
To check: in https://codepen.io/gsnedders/pen/GvjRNN |
@gsnedders Yes, because both the |
Reopening for testcase need. |
@fantasai @gsnedders I created a testcase for this - please review at earliest convenience. |
The test for this one has been merged, so I'll be removing the label for tests. |
From email:
Note that since this was written, Safari's behaviour is now genuinely right, because it now shares its flexbox implementation with Chrome.
The text was updated successfully, but these errors were encountered: