Re: [gradients] basics

On Mon, Nov 9, 2009 at 12:15 AM, Andrew Fedoniouk
<news@terrainformatica.com> wrote:
> fantasai wrote:
>> Andrew Fedoniouk wrote:
>>> Sorry, this case:
>>>
>>> background: linear-gradient(magenta yellow), url(...)
>>>
>>> has no visual effect but will force image to be downloaded.
>>> Image at url(...) will be covered by linear gradient in full.
>>
>> http://www.w3.org/TR/css3-background/#the-background-image
>>
>>  # Implementations may optimize by not downloading and drawing images
>>  # that are not visible (e.g., because they are behind other, fully
>>  # opaque images).
>
> That statement appears as a good intention without any practical value.
> How would you decide what to download without knowing is particular (remote)
> image transparent or not?

You *do* know - that linear-gradient() rule has no transparency, so
you can decide that it fully occludes any background layers underneath
it before you download anything.

The general problem is of course more difficult.

> Or does this imply that images
> are downloaded one by one?

It doesn't imply such, but if an implementation *did* do so, it would
be allowed to act on image information to decide to stop downloading
images.

As well, note that the quote fantasai pulled refers both to
downloading *and drawing*.  Even when you're downloading all the
images at the same time, you can still usually figure out which pixels
you need to draw from each image, and avoid drawing ones that are
fully occluded by higher layers.

~TJ

Received on Monday, 9 November 2009 14:57:30 UTC