Re: -webkit-image-set

On 23/03/2012 20:11, Ariel wrote:
>
> I disagree. The position of the image is presentation, but that actual
> content - meaning how many pixels are in the image is content.
>
> The visual size is presentation, but the actual physical number of
> pixels is content.
>
> There are two issues here: Changing the layout depending on screen size
> - that belongs in css certainly.
>
> But selecting which image, with the only difference being the dpi does
> not belong in css, that should be supported in html.

+1

I was giving a talk on this only yesterday [1] and it's in the Mobile 
Web Best Practices for a reason - resizing images takes processing power 
and causes a re-flow of the page (more processing power). So yes, height 
and width dimensions must be sent with the image in the markup and they 
must match the intrinsic size of the image.

The the method suggested of basically defining as group of images and 
using media queries to tell the browser which one - and one only - to 
download - sounds spot on to me and I very much hope that that, or 
something very like it, is what we end up with. The kind of hack I put 
together looks ugly [2] (it uses PHP and the GD library to resize images 
on the server). OK, it works and it means you only have to have one copy 
of the image on your server but it really doesn't feel right and I'd 
like it to be unnecessary. It's a lot better than resizing in the 
browser though!

Phil.

[1] http://www.w3.org/2012/Talks/0322_phila_openMIC/
[2] http://philarcher.org/diary/2011/phpimageadaptation/

>
> -Ariel
>
> On Fri, 23 Mar 2012, Kevin Suttle wrote:
>
>> This is a point I brought up on the site. To re-cap:
>>
>> "img is content, so having it in markup makes sense. However, the size
>> of an img is presentational. By design, this is most likely a problem
>> that CSS needs to solve."
>>
>> I guess the way I see it, if it is the same image content, does it
>> need a markup-based solution? We're trying to tackle a
>> performance/presentation issue. Thoughts?
>>
>> KS
>>
>>
>> On Friday, March 23, 2012 at 3:56 AM, Dominique Hazael-Massieux wrote:
>>
>>> WebKit has just integrated a patch (from Apple) to make it possible to
>>> provide variants of a CSS image based on the device scale factor:
>>> http://trac.webkit.org/changeset/111637
>>>
>>> I don't think that addresses the markup-based use case, but it probably
>>> should inform it.
>>>
>>> Dom
>>
>>
>
>

-- 


Phil Archer
W3C eGovernment
http://www.w3.org/egov/

http://philarcher.org
+44 (0)7887 767755
@philarcher1

Received on Friday, 23 March 2012 20:26:19 UTC