[whatwg] RWD Heaven: if browsers reported device capabilities in a request header
mail at matthewwilcox.com
Tue Feb 7 14:06:56 PST 2012
> > > And, screen size is useful when understood to mean "CSS Pixels".
> > > Because that's what a browser renders. If a device has a screen 1900px
> > > CSS px wide, you know you never need send anything larger.
> > It's getting in the way, and it's certainly been a strong topic.
> I know that if a screen is 480px wide that I know nothing. I spent a lot of time on work-arounds for DPI issues on mobile and desktop.
I agree about this. But realise that if we take your zoom use case to
it's logical conclusion, we'd need to supply images at an infinite
resolution. Which is patently absurd. With visual media, it is
expected, and the only practical thing, to have pixelation at zooms
higher than one CSS pixel.
> Unless you go out and disable zoom, the user can zoom into the image. That applies to mobile for sure. I hate it when I can't zoom in on some sites. Google news is a prime example.
I would never disable zoom, it's completely irresponsible. But so is
trying to supply an image that stands up to zoom. It's irresponsible
to every other user who doesn't zoom.
> It also applies to desktop. There are many instances of sites that have a downsampled image, which you can then click to get a higher resolution version.
> It'd be a nasty thing to have to change my system resolution settings because someone thought it would be funny to serve me up small versions of images based on my browser zoom or screen resolution.
Agreed. So don't report the browser zoom pixel size, report the screen
size at normal zoom.
> I'm all for exposing data. I had a very public tantrum about devicePixelRatio; Microsoft exposes it directly,
> WebKit exposes it inadvertently, Mozilla exposes it via CSS selectors (needing about 15 lines of css).
> While I am for exposing data, I'm just not seeing this idea of exposing "all" css media attributes.
Same here, I'm open to figuring out what ones would actually be
useful. It's just my position that screen size is in fact critical -
but not necesarily for saving bandwidth as an end goal.
> But I'll try to bend my mind around it, now that we're over the initial hurdle about screen size.
> Sure, if you want to have something like this, it's not the end of the world:
> <style server="viewport-width, media, min-width" src="http://server.com/dynamic.css">
> That'd result in some kind of header when requesting that style sheet.
CSS already has methods for this. We are not talking about CSS. We are
talking about HTML, which has no methods for this.
> It could be used for really nasty purposes if it automatically updated.
> Such as, if you set set "width", it might re-request the CSS file every time the user resizes the browser.
This use case was considered and worked around when I developerd
http://adaptive-images.com - it is precisely and exactly why that
solution sends images at the maximum size the device can output to
it's screen, rather than the size of the current viewport.
More information about the whatwg