W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: Background image cropping

From: Marat Tanalin <mtanalin@yandex.ru>
Date: Wed, 11 Jun 2014 19:11:57 +0400
To: Sylvain Galineau <galineau@adobe.com>
Cc: Dirk Schulze <dschulze@adobe.com>, Tab Atkins Jr. <jackalmage@gmail.com>, Lajos Koszti <ajnasz@ajnasz.hu>, "<www-style@w3.org>" <www-style@w3.org>
Message-Id: <2083311402499517@web15g.yandex.ru>
11.06.2014, 04:52, "Sylvain Galineau" <galineau@adobe.com>:
> On Jun 10, 2014, at 5:30 PM, Marat Tanalin <mtanalin@yandex.ru> wrote:
>> šMedia Fragments could be used in CSS for some simplest cases, while pure-CSS solutions could be used as a more flexible and usable alternative when needed.
>>
>> šFor example, how would following expression be expressed in terms of Media Fragments?
>>
>> šššš/* Here we have 4em-size center part of the image: */
>> šššš-moz-image-rect(
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em)
>> šššš)
>
> In cases like this you'd need the full image to compute the result anyway, so it's not really a scenario for MF.
>
> This thread started with background sprites as they are currently built on the web. Those can certainly use MF, though some syntactic sugar to build the fragment may be nice...

Based on whay you say, it looks like that Media Fragments cause a separate HTTP request for each region of the same image (one image => multiple HTTP requests).

This is the contrary to the main idea behind sprites that consists of uniting multiple images into a single image file to _minimize_ the number of HTTP requests (multiple images => one HTTP request).

If so, MF look like not suitable for the purpose of spriting at all.
Received on Wednesday, 11 June 2014 15:12:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC