Contact emails
Spec
https://github.com/bokand/URLBarSizing
Summary
This isn't really a new feature, it's more of a change to improve interop with Safari and improve user experience. I was debating sending a PSA but decided to send out an intent as the compat impact is non-trivial.
The details are in an explainer at the "Spec" link above but in summary:
1) Today, the initial containing block is resized each time the top controls (aka URL bar) are shown/hidden. This means an element with a percentage based height will change size whenever the user changes scroll direction (causing relayout, potentially losing their place). Chrome is the only mobile browser that does this. This intent proposes that we fix the ICB to the "smallest possible" viewport (like Safari) so that height:100% will fill the viewport when the top controls are showing. Hiding the top controls will not resize the ICB (elements that are position: fixed, however, will be resized - their ICB remains the dynamically sized viewport).
2) Similarly, vh units are also dynamic today w.r.t. the top controls. This makes them virtually unusable since things like fonts will change size as the user scrolls around the page. The proposal here makes vh units relative to the "largest possible" viewport (to match Safari) so that 100vh will fill the viewport when the top controls are hidden. Likewise, hiding/showing the top controls will not change the size of a vh-sized elements.
Link to “Intent to Implement” blink-dev discussion
Not really an official intent-to-implement but some initial discussion on input-dev:
Posted explainer and followup discussion
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
This intent affects only Android since it's the only platform with movable top controls.
Demo link
I've put up an APK demonstrating the change on the linked github. To see the difference, I've put together a demo page.
Interoperability and Compatibility Risk
Top Controls behavior is something that's completely unspec'd and, until now, browsers have all behaved differently, making developer's lives painful. This change aligns us more closely with Safari so I expect interop to improve here. Ideally, we'd eventually collaborate with other vendors to write some kind of document (if not a spec) on how top controls affect pages.
That said, this is a fairly visible change and could affect existing pages. I've tried this out on many popular pages (Facebook, G+, Twitter, etc.) and haven't seen anything break (most pages don't rely on the viewport size vertically). The failure mode shouldn't be critical either since the page will simply remain as it looked at load; the most convincing argument is that Safari's been doing this for years without user/developer complaint, UA sniffing aside. My plan here is to closely monitor any breakages in beta and revert if the pain is non-trivial.
In terms of functionality, developers can still easily revert to the old mode with a little bit of javascript: add a resize handler that sizes the document element explicitly to the window.innerHeight.
Signals from other vendors:
Apple - None but we're essentially moving to their model
Firefox - Mildly positive signal in input-dev discussion
Edge/IE - N/A; Non resizing top controls
WebDevs - The original motivation for this was bug 428132 - 51 stars. Positive support from G+/AMP team.
OWP launch tracking bug
N/A
Entry on the feature dashboard
None - This isn't really a new feature. It's a change in how our browser UX interacts with the page.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
So 100% will be the minimal viewport height and 100vh will be the maximal viewport height? :|This sounds so backwards. :(
--
Hi there,
I’m not at all involved in browsers development, I’m more in the users and web developers sides.
You tell us that “Safari’s been doing this for years without user/developer complaint”… Well, how do you know nobody complained?
I, for example, complained in a post on my blog almost a year ago: http://nicolas-hoizey.com/2015/02/viewport-height-is-taller-than-the-visible-part-of-the-document-in-some-mobile-browsers.html
And I didn’t only complain, as suggested by Yoav Weiss, I opened a few bugs/issues on Apple Bug Reporter and Webkit Bugzilla, and even talked (on Twitter) with the W3C CSS Working Group.
And I’m not the only one complaining at all.
There is a “buggyfill” library that initialy aimed to solve iOS < 8 issues with viewport units, but people still believe the way iOS Safari deals with vh
nowadays is still a bug
It’s really a pain to develop full-viewport (not really full-screen) interfaces, like I am with my game esviji with such a behavior of the vh
unit. You never know if you really use the full visible height, or less, or more…
I do understand, through, that other components in the page, if not using 100vh
can behave strangely for users in current Chrome for Android implementation. A friend told me so a few month ago, because some elements in my blog design use the vw
and vh
units for fluid responsiveness (instead of step by step responsiveness with Media Queries).
So I know it’s not an easy decision, and I know that “improve interop with Safari” is a big motivation when even Mozilla makes Firefox compatible with -webkit- prefixes.
But I know you can’t say “Safari’s been doing this for years without user/developer complaint” without me banging my head against the wall…
I’m not sure I will make you change anything in the process, but at least I gave you my different point of view.
-Nicolas
My quote was in the context of compatibility; a page that "breaks" as a result of this change will look like it does in Safari, which developers have either worked with or worked around. I didn't mean to say it was easy or pleasant.
I actually replied on the bug you filed with WebKit but got no reply. Given that Safari intentionally chose the "larger viewport" they're unlikely to change now.
I think there's use cases for both arguments (smaller and larger viewport) but at the end of the day, even if we have "the same 'bug' everywhere", I think it's preferable that we have interoperable implementations. At least you can work around one set of bugs :).
The best thing would have to be interoperability of default behavior, and a standard way to change the behavior, like with box-sizing for example.
On Jan 21, 2016 10:36 AM, "John Mellor" <joh...@chromium.org> wrote:
>
> Sorry to throw spokes in the wheels, but I'm really worried about this change. You're proposing the following behaviors (changes in bold):
>
> Property | mobile url bar | desktop scrollbars |
> -------------------------------+-------------------+--------------------+
> CSS html { height:100%; } | excluded | excluded |
> CSS position:fixed;height:100% | depends on scroll | excluded |
> CSS html { height:100vh; } | included | included |
> CSS position:fixed;height:100vh| included | included |
> CSS @media height | excluded | included |
> JS doc.docElement.clientHeight | excluded | excluded |
> JS window.innerHeight | depends on scroll | included |
>
> That's 5 different combinations of behaviors, for properties that are all expected to evaluate to "viewport height". Most web developers will initially expect these all to be the same, and over time having been bitten might be aware of 2 or 3 of them, but this is super gnarly.
>
> To take a concrete example, after this change, how would you implement a basic layout template:
> SIDENAV | CONTENT
> where if the content is short, the sidenav should still extend all the way to the bottom of the window?
>
Use flexbox, vh units are not the solution to this.
> ...
>
> As to Safari-compatibility, It's not clear from webkit.org/b/141832 that Safari has considered the web developer inconsistency cost of their approach, so it seems worth discussing this further with them.
Seems worth a shot, but given how much content targets iOS I think developers are already dealing with this okay.
- E
Sorry to throw spokes in the wheels, but I'm really worried about this change. You're proposing the following behaviors (changes in bold):Property | mobile url bar | desktop scrollbars |-------------------------------+-------------------+--------------------+CSS html { height:100%; } | excluded | excluded |CSS position:fixed;height:100% | depends on scroll | excluded |CSS html { height:100vh; } | included | included |CSS position:fixed;height:100vh| included | included |CSS @media height | excluded | included |JS doc.docElement.clientHeight | excluded | excluded |JS window.innerHeight | depends on scroll | included |That's 5 different combinations of behaviors, for properties that are all expected to evaluate to "viewport height". Most web developers will initially expect these all to be the same, and over time having been bitten might be aware of 2 or 3 of them, but this is super gnarly.To take a concrete example, after this change, how would you implement a basic layout template:SIDENAV | CONTENTwhere if the content is short, the sidenav should still extend all the way to the bottom of the window?If you set min-height:100% on the sidenav, it'll be too short when the top controls are hidden. If you set min-height:100vh on the sidenav, it'll be too long when the top controls are showing (i.e. it'll force the page to be scrollable when it wouldn't have been necessary). If you size the page using position:fixed, then the sidenav will be the right height, but this prevents the page from being scrolled; you could hackily add overflow:scroll, but then scrolling will behave weirdly, e.g. it won't cause the top controls to hide. There seems to no longer be any way to implement such a trivial design using pure CSS, even in a single browser.
From an ease of development point of view, Chrome's existing behavior seemed a lot better: the page would resize from time to time, which websites have to handle anyway, but otherwise all these heights returned the same values.
Or if we consider the performance benefits of fixed-height ICBs to be overwhelming (even though we still have to relayout position:fixed elements), then it seems that Firefox's approach might have made more sense, i.e. always include the top controls (use the largest viewport), unless the page is too short to require scrolling, in all of the CSS and JS properties (except perhaps the position:fixed ones, though that's a bit messy), so that at least these values are all consistent.
As to Safari-compatibility, It's not clear from webkit.org/b/141832 that Safari has considered the web developer inconsistency cost of their approach, so it seems worth discussing this further with them.
This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software.Guardian News & Media Limited is a member of Guardian Media Group plc. Registered Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP. Registered in England Number 908396
Total Pages: 8338 Pages without any paint invalidation: 5623.500 Pages with full invalidation: 0 Pages with partial invalidation: 2714.5
vs. without change:
total pages tested: 7951
pages without any paint invalidation: 2212
pages with full paint invalidation: 1
pages invalidated paint because of style and/or layout change: 5738.