URLBarSizing icon indicating copy to clipboard operation
URLBarSizing copied to clipboard

position:fixed vh units don't resize with URL bar on Chrome mobile

Open majaha opened this issue 4 years ago • 1 comments

Hi @bokand, first off thanks for all your hard work on this topic! It seems you're more or less the source of truth on all this.

Secondly, I found an inconsistency between your descriptions of Chrome's behaviour and what I'm observing when I open https://bokand.github.io/demo/urlbarsize.html on recent versions of Chrome mobile on Android. Your 2016 blog post says that:

... vh lengths ... will also resize to match the visible height taking the URL bar position into account.

And in this github's readme, the "Update and Summary" section is vague and doesn't make mention of the vh-in-position:fixed case. However, further down in the Changes in Chrome 56, you note:

#2 doesn't apply to vh units set on a position: fixed element. They'll still resize in response to the URL bar.

Which agrees with your blog post. However, when I open the test page in chrome, the "viewport-unit position:fixed" bar doesn't change size when the URL bar is shown or hidden! It always stays at the larger size. If I'm understanding correctly, the two position:fixed bars should always be the same size. There's a screenshot at the bottom showing what I mean (sorry it's so big).

Is this a bug in your test page, a regressive bug in chrome, or is this an intentional change in chrome that hasn't been documented here yet?

(As an aside, is it possible to edit your old blog post to add a link to this github page? This seems to be the most up-to-date and is somewhat hard to find!)

Screenshot_20210910-200421

majaha avatar Sep 10 '21 19:09 majaha

Secondly, I found an inconsistency between your descriptions of Chrome's behavior and what I'm observing...

Yeah, I think this is the bug in https://crbug.com/700431 - it's an unintentional regression but fixing it may have unintended consequences on style performance...ultimately I think the fix is the proposed new units which don't have magical special cases to preserve compatibility.

(As an aside, is it possible to edit your old blog post to add a link to this github page? This seems to be the most up-to-date and is somewhat hard to find!)

Thanks for pointing this out. IMHO, the blog post is probably easier to find so I'll see if I can clarify the information there (and a link back to this repo wouldn't hurt I guess)

bokand avatar Sep 21 '21 16:09 bokand