Closed vwkd closed 11 months ago
It's definitely some form of 2 in practice. (At least) Mobile browsers will create an ICB that is large enough to safely contain the largest visual viewport, which can be larger than the layout viewport.
It would probably be good to get some clarity on this, as it affects at least fixed position elements, as discussed in #8410.
The spec (along with the specs defining the appropriate concepts - Display and Position) is now well-defined. The ICB is the "small viewport size" and the fixpos containing block is the layout viewport which is the "dynamic viewport size".
Commits: 504724653630e57f934be6fe3f11d3cf3eaae0a0 and 79daa0a8f380ba62123d03b36a2dfa65465ef569
That can't be right? The containing block of a fixed element is in some cases larger than any of the viewport dimensions.
Can you provide an example of one of those cases?
I suppose this case is one of such cases what @CendioOssman is concerned; https://hiikezoe.github.io/vh-units.html
It happens on mobile browsers when they are in their "desktop mode". I'll see if I can link to an example. The one @hiikezoe refers to might be relevant, but I don't have a device here to confirm it right now.
What is the difference between the size of the viewport and the size of the initial containing block (ICB)? The current spec is contradicting itself (at least for continuous media). There are two possibilities:
Matches definition in 10.1 in CSS2.
The size of the viewport is the visible part of the document without overlays (like scrollbar, on-screen keyboard), while the size of the ICB is with it.
Matches definition in note in css-values-4 on viewport-percentage lengths.
I guess it is the second? But no matter what the answer is, there is at least one bug in css-values-4.
If the answer is 1., then the note quoted in 2. is erroneous.
If the answer is 2., then the definition in 1. is erroneous (which is quoted through as still valid definition, e.g. in css-display). Additionally the definition of the viewport-percentage lengths is erroneous.
Yes, the spec includes the scrollbar afterwards
But then, this is exactly the difference between the size of the viewport and the size of the ICB. So the spec should just use the correct term (viewport). Defining an exception for a term (ICB) that is used to differentiate from another term (viewport) but making the exception so the term equals the other term from which it tried to differentiate itself in the first place is ... confusing, to say the least.