Intent to Experiment: Viewport-height client hint

149 views
Skip to first unread message

Tarun Bansal

unread,
Mar 4, 2021, 5:46:20 PMMar 4
to blink-dev
Intent to Experiment: Viewport-height client hint
Contact emails

tba...@chromium.org, yoav...@chromium.org, loadi...@chromium.org  


Explainer

https://github.com/WICG/responsive-image-client-hints/blob/master/Viewport-Height-Explainer.md



Specification

The new client hint attribute “viewport-height” (similar to existing viewport-width) would provide a way for origins to obtain the viewport’s height. Similar to other client hints, origins would be able to register the opt-in for viewport-height client-hint via Accept-CH header, and receive the attribute value as part of HTTP request headers.

Spec: https://wicg.github.io/responsive-image-client-hints/#sec-ch-viewport-height


Summary/Motivation

Currently, Responsive Image Client Hints provide a way for origins to obtain the viewport’s width. However, no such attribute exists for viewport height. We’ve observed that to optimize the loading of content that appears in viewport, it is essential for the origins to adapt HTML response based on viewport height. Current methods of doing that include content-negotiation through the User-Agent string, but that is suboptimal as it’s indirect, and doesn’t cover all platforms.

The new attribute “viewport-height” would enable origins to e.g., inline all the content that’s expected to appear in the viewport, or avoid lazy-loading it. That’s particularly important when it comes to image content.

Even if the above mechanism is an optimization, using Client Hints would enable to benefit from Client Hints Reliability and have that information available on the very-first load.

Blink component

Blink>Loader


Initial public proposal

https://discourse.wicg.io/t/viewport-height-client-hint-proposal/4993


TAG review

https://github.com/w3ctag/design-reviews/issues/615


TAG review status

Under review.


RisksInteroperability and Compatibility

Client hints are currently supported only in Blink. 

Gecko: Likely to be neutral based on discussion in https://github.com/mozilla/standards-positions/issues/79


WebKit: Likely to be negativebased on previous discussion in https://lists.webkit.org/pipermail/webkit-dev/2020-November/031576.html 

 

Web Developer:

Slightly positive (https://discourse.wicg.io/t/viewport-height-client-hint-proposal/4993).

Strong demand from a partner.

 

Goals for experimentation

Client hints opt-ins from origins are session-sticky which makes it difficult to experiment with using origin trials since origin trials operate at document-level. We plan to run an A/B experiment using Chrome’s field trial infrastructure. Our plan is to enable the feature for at most 1% users to collect metrics, and ship this feature only if it shows performance improvement for origins that choose to use this feature.


Ongoing technical constraints

None


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

 

Is this feature fully tested by web-platform-tests?

It will be to the extent possible.


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1184863


Launch bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1184862


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5646861215989760

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Mar 11, 2021, 4:13:13 PMMar 11
to Tarun Bansal, blink-dev
Hi,

I have two questions:

- Can you add a milestone range you'd like to experiment on? e.g. M91-M93?

- You're suggesting an A/B experiment rather than an Origin Trial, since Origin Trials don't work at the networking layer; this makes sense. But since it's an A/B experiment, these headers will be exposed to all sites in the A group. For this reason, would it suffice to test on the Canary/Dev/Beta channels?



 


--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/be498918-60c3-456f-96a6-969749d7fa7fn%40chromium.org.

Tarun Bansal

unread,
Mar 11, 2021, 4:36:40 PMMar 11
to blink-dev, Chris Harrelson, blink-dev, Tarun Bansal
Thanks Chris. Answers inline:

> - Can you add a milestone range you'd like to experiment on? e.g. M91-M93?

We're hoping to start the experiment in M-91 (I updated this on chromestatus as well).

> - You're suggesting an A/B experiment rather than an Origin Trial, since Origin Trials don't work at the networking layer; this makes sense. But since it's an A/B experiment, these headers will be exposed to all sites in the A group. For this reason, would it suffice to test on the Canary/Dev/Beta channels?

The developers would need to opt-in to get those headers, and yes, it would be possible for developers to opt-in, and get the headers from the users in group A. However, given the small size of group A, the opt-in would succeed only <5% time on stable channel. I would hope developers would not rely on it as long as we keep group A size small. 



To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Chris Harrelson

unread,
Mar 11, 2021, 5:00:27 PMMar 11
to Tarun Bansal, blink-dev
On Thu, Mar 11, 2021 at 1:36 PM Tarun Bansal <tba...@chromium.org> wrote:
Thanks Chris. Answers inline:

> - Can you add a milestone range you'd like to experiment on? e.g. M91-M93?

We're hoping to start the experiment in M-91 (I updated this on chromestatus as well).

> - You're suggesting an A/B experiment rather than an Origin Trial, since Origin Trials don't work at the networking layer; this makes sense. But since it's an A/B experiment, these headers will be exposed to all sites in the A group. For this reason, would it suffice to test on the Canary/Dev/Beta channels?

The developers would need to opt-in to get those headers, and yes, it would be possible for developers to opt-in, and get the headers from the users in group A. However, given the small size of group A, the opt-in would succeed only <5% time on stable channel. I would hope developers would not rely on it as long as we keep group A size small. 

I agree that the risk is small, but even still it's better not to experiment with new APIs on the stable channel when possible. Do you think the audience sizes on other channels will be large enough to get a statistically significant result?

Another option could be to run first on those channels, and if the results are not conclusive enough, ping this thread to request stable channel experimentation.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/5baffbfb-bbe2-4dd6-8598-030c38ede59dn%40chromium.org.

Tarun Bansal

unread,
Mar 11, 2021, 5:03:36 PMMar 11
to blink-dev, Chris Harrelson, blink-dev, Tarun Bansal
I think we should be able to get sufficient data on Canary/Dev/Beta channels, but it's harder to predict for sure. The option to run first on Canary/Dev/Beta channels and ping back this thread seems reasonable to me. 

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
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+unsubscribe@chromium.org.

Chris Harrelson

unread,
Mar 11, 2021, 5:12:32 PMMar 11
to Tarun Bansal, blink-dev
Great!

LGTM to experiment on M91 on canary/dev/beta.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
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.

--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/92367d2f-eff8-4d0e-ae30-3b2c5db2053en%40chromium.org.

Max Curran

unread,
Aug 2, 2021, 11:21:55 AMAug 2
to blink-dev, Chris Harrelson, blink-dev, Tarun Bansal
Quick update: The experiment for the viewport-height client hint are not active in M91-M93. The feature should be code complete in M94, and we plan on start experimenting in that milestone.

Max Curran

unread,
Aug 23, 2021, 4:01:07 PMAug 23
to blink-dev, Max Curran, Chris Harrelson, blink-dev, Tarun Bansal
This feature has slipped to M95.

Yoav Weiss

unread,
Aug 24, 2021, 5:41:25 AMAug 24
to Max Curran, blink-dev, Chris Harrelson, Tarun Bansal
Thanks for updating the thread! :)

Reply all
Reply to author
Forward
0 new messages