vh units size should be affected by the `width` value of the meta viewport tag
Categories
(Core :: Layout, defect, P3)
Tracking
()
People
(Reporter: hiro, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
Attaching file is an example to see the difference between 100vh and 100% computed values.
On my pixel 3, on Chrome the difference is 143px (note that the initial-scale value is 1.0 and the minimum-scale is 0.39 (the minimum-scale here is not the one in specified in the meta viewport though). If the minimum-scale is 1.0, the difference is 56px on my pixel 3.
So, it looks like the vh height should be "the ICB height + 56 / 0.39" (56 / 0.39 = 143).
But things are not so simple as far as I've tested. In cases where the minimum scale is dynamically changed, it's inconsistent. I am going to two cases where the minimum scale is dynamically changed in different ways.
| Reporter | ||
Comment 1•5 years ago
|
||
In this case, vh units value is also changed in response to the minimum scale change.
| Reporter | ||
Comment 2•5 years ago
•
|
||
In this case, vh units value is not changed in response to the minimum scale value.
Comment 3•5 years ago
|
||
Does the 56px correspond to the dynamic toolbar's height?
| Reporter | ||
Comment 4•5 years ago
|
||
Yes, I think the 56px (in CSS untis at resolution:1.0) is the dynamic toolbar height on pixel 3.
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•4 years ago
|
Comment 5•3 months ago
|
||
Can you clarify in this bug, especially in comment 0, what the expected behavior is in each of these test cases, and why? It's hard to understand how to evaluate whether a patch fixes this bug.
| Reporter | ||
Comment 6•3 months ago
|
||
For example in the third case (https://bugzilla.mozilla.org/attachment.cgi?id=9152012), you can see two "100vh - 100% = XXpx". The second one's value needs to be greater than the first one.
In the second case, it's same the second one's value needs to be greater than the first one. NOTE that if the device screen width is larger than 1000px, you will have to modify 1000 value in document.querySelector("meta[name=viewport]").content = "width = 1000 to be larger then the screen width.
In the first case, there's only one "100vh - 100% = XXpx". The value needs to be larger than the first value in the second/third case.
| Reporter | ||
Comment 7•2 months ago
|
||
Markus realized me that making viewport units depend on the minimum-scale will introduce a cyclic dependency such as html { width: 200lvh }. That means, our current behavior is ideal.
The reason why the test case in comment 2 doesn't change the viewport value is to avoid the cyclic?
| Reporter | ||
Comment 8•2 months ago
|
||
Okay, it turned out that Chrome doesn't depend on the minimum-scale, it rather depends on width value in the meta viewport tag. That's the reason why test case in comment 2 doesn't change the viewport value since the test case does have width=device-width. In other cases width is not device-width.
| Reporter | ||
Updated•2 months ago
|
| Reporter | ||
Comment 9•2 months ago
|
||
FWIW, it loos like Safari doesn't have the concept of minimum-scale size changed by the content size such as html { width: 200vw}.
Description
•