Skip to content

update Width to report in physical pixels #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2015
Merged

Conversation

igrigorik
Copy link
Owner

We originally defined Width to report in CSS px because the same header was responsible for reporting both the "intended image display width", or the "layout viewport size" for resources that don't have a "display width". However, we've since split these use cases (see #48) into separate headers: Viewport-Width and Width.

This update changes the definition of Width to report image display width (when it's known) in physical pixels, instead of CSS pixels. This offers a couple of important benefits:

<img srcset="wolf-480.jpg 480w, ..., wolf-1920.jpg 1920w" sizes="...">
  1. The communicated value is aligned with w descriptor used for viewport-based selection.
  2. The communicated value significantly improves interaction with HTTP caches:
    • With current definition the cache has to vary the response based on DPR and Width (i.e. Vary: DPR, Width) which leads to unnecessary fragmentation (see viewport-based selection use case and caching #59).
    • With updated definition the cache would have to vary on Width only.

Closes #59.

@yoavweiss
Copy link
Contributor

LGTM for these changes, but we'd need to also change the browser implementation considerations document.

@igrigorik
Copy link
Owner Author

Updated UA considerations doc.

@yoavweiss
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants