-
Notifications
You must be signed in to change notification settings - Fork 687
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 sizing] auto <length> description may have wrong "otherwise" #7769
Comments
Yes, that was deliberate, see #6308.
Yes, see #7519. @tabatkins said he would add some examples to clarify what the text is trying to say. |
@Loirooriol Thanks. I don't see how that follows from #6308 . That's about making sure that the onscreen element is not rendered with outdated dimensions. It makes sense not to render using a remembered value. But what I think this text stays is that you would in this case render with I will look at the #7519 examples. Thanks for considering the comments. I appreciate that they probably seem a bit stupid when you understand all the context. |
To avoid using the outdated dimension, it's using the specified |
Ah! The logic I saw "somewhere" for providing auto was that it helps because getting the |
I guess I should outline my concern with a real case. Imagine you have an offscreen element that has The user scrolls the element near to the view so the user agent starts rendering the elements. At this point it starts using the
|
In that case the element will no longer skip its contents, and thus won't have size containment (unless you are also using e.g.
Possibly, if e.g. the contents have changed (i.e. the last remembered size was outdated). But in most cases it should work well enough.
To mitigate these visual effects, like the scrollbar thumb jumping around, see #5668. Switching from an old non-contained size to the current non-contained size is probably better than switching from some poorly guessed length. And note you can pair |
OK, I guess you might be arguing that the condition of skipping the contents could be replaced with having a non- So, the answer of "If the element has size containment, should it use the last remembered size?" is:
And it would become:
I don't think it matters much in practice since |
@Loirooriol My concerns here are answered. I was mostly concerned about the case when the element is coming into view from offscreen - i.e. why you would choose not to use the remembered size in this case. You answered this two comments above in #7769 (comment); it's because you're not in size containment anymore so you're not skipping the content. IN other words you're not using the length OR the remembered size. "remembering" is a way of getting the benefits of size containment when you're offscreen without actually having to "think about it". If something is actually "planned" to be size contained and is visible then using the user-supplied length makes sense. Thanks for taking the time to spell it out for me. Closing this - I'll keep an eye on #7519 |
I think it may be worth discussing whether to improve the case with both |
For
contain-intrinsic-size: auto <length>
my understanding is that the intent is that if the content has never been rendered you won't have a remembered value, so you will use thelength
value for size constrained layout. If however you have ever been able to render the content you will have a remembered value for the size, and you'll use that instead.The spec here does not appear to say that.
The first part implies it:
My interpretation of that is that you use the remembered value when you are offscreen and have a remembered value and have
auto
set. That makes sense - you're using a remembered value because you can't recalculate one.But then the spec says:
That "otherwise" is all other cases. To me that means that if you are not skipping the contents you will use length. I suspect in most cases you won't be using size containment, but if you are, this means you aren't using the remembered value even if you could.
As an aside, the following paragraph reads as gibberish:
I may just be completely missing the point but "after laying out the element as normal for size containment" should means that there is nothing calculated in the layout.
The text was updated successfully, but these errors were encountered: