[whatwg] Implementation complexity with elements vs an attribute (responsive images)
svartman95 at gmail.com
Sun May 13 12:55:08 PDT 2012
On 5/13/12, Kornel Lesiński <kornel at geekhood.net> wrote:
> I think layout (media queries) and optimisation cases are orthogonal and
> it would be a mistake to do both with the same mechanism.
My knee-jerk reaction to the above thought is that layout should be
done using CSS and any optimizations left up to the UA. A bandwidth
constrained UA could request a downsized thumbnail that fits the size
of the <object>/<img>/<video poster>/<a> element, or render an
appropriately sized bitmap from a SVG.
The problem with that, though, is that then bandwidth constraints
can't affect layout. Users should be able to configure UAs to use
downsized images even given a large viewport, if only to save
bandwidth and reserve a larger fraction of the viewport for text
> Adaptation of images to the layout is page-specific. Adaptation of images
> to bandwidth/screen is UA/device-specific.
Quite. But the latter just might affect the layout.
> Author is in the best position to adapt image to page layout. User-agent
> is in the best position to determine speed/quality trade-offs.
But low-res images usually don't look too good when upscaled. Thus few
pixels should mean small image, UAs mustn't default to pixelation.
> Media queries MUST be interpreted exactly as author specified them.
Thus we mustn't force UAs to pretend to render to small viewports to
find low-res images. That would have unwieldy side-effects.
> User-agents need freedom to choose image resolution based on open set of
> factors, many of which are details authors should not have to think about
> (presence in cache, cost of bandwidth, available memory, external
> displays, etc.)
But the chosen image resolution might be a factor for choosing layout.
More information about the whatwg