W3C home > Mailing lists > Public > www-style@w3.org > May 2011

Re: [css3-images] Reintroduce object-fit: none

From: Leif Arne Storset <lstorset@opera.com>
Date: Wed, 25 May 2011 10:58:59 +0200
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style@w3.org, Philip J├Ągenstedt <philipj@opera.com>, "Simon Pieters (zcorpan)" <simonp@opera.com>
Message-ID: <op.vv04klq3tmo5g6@localhost.localdomain>
Tab Atkins Jr. <jackalmage@gmail.com> skreiv Tue, 24 May 2011 19:33:40  

> On Tue, May 24, 2011 at 4:36 AM, Leif Arne Storset <lstorset@opera.com>  
> wrote:
>> Tab Atkins Jr. <jackalmage@gmail.com> skreiv Tue, 24 May 2011 02:06:39
>> +0200
>>> On Thu, Jan 27, 2011 at 2:35 PM, fantasai  
>>> <fantasai.lists@inkedblade.net>
>>> wrote:
>>>> On 01/27/2011 09:18 AM, Tab Atkins Jr. wrote:
>>>>> Ok, so I'm hearing some good justifications for both 'cover' and
>>>>> 'none' (and I think 'scale-down' has similar nice justifications).
>>>> I'm still unsure about 'none'. The use case Leif has given is
>>>> panning the image, and in that case you'd probably want more than
>>>> just the ability to pan at 100% zoom level. If that's the use case
>>>> we're addressing, we should add percentages or something.
>>> 3) Add the 'none' value.  The stronger use-case here seems to be
>>> panning a "window" over a portion of a larger image, a la Google Maps.
>>>  A somewhat weaker imo use-case is vertically centering an image; I
>>> think this should be addressed by a more general centering mechanism
>>> like Flexbox.
>> We already have a more general centering/positioning mechanism:
>> 'object-position', implemented by HP and Opera. However, for it to work
>> without scaling the image, we need 'object-fit: none'. 'scale-down'  
>> comes
>> close, but doesn't address cases such as the following:
>> (From my former life as a web developer for www.neitileu.no:) You are
>> writing style sheets for a site with many content producers. The site
>> includes a fixed-size banner, but after a while you want to adjust the
>> design and shave a few pixels off the banner. But you want to avoid
>> scaling, as that will deform and blur or alias the text, and this is  
>> more
>> important than losing a few edge pixels. A demo is at [0].
> Can't you just edit the image?  Or was it common that you'd reuse the
> same logo in several places, and you only want the marginally-smaller
> size in some of the places?

In a site managed by myself in plain Apache, resizing images is pretty  
easy. In a CMS and with many authors, not so much. It's not impossible to  
exert social control over people's image editing, of course - but styling  
with CSS rather than with Gimp seems a reasonable technical solution and  
within scope of the spec. (And 'none' already been implemented at least  

To answer your other question: there was some reuse of images, but only  
photos and illustrations that scaled fine.

>> Another case is a screenshot gallery, similar to Opera's speed dial
>> feature: You have a series of screenshots for the user to choose from,
>> presented in thumbnail form. You want the screenshots unscaled but  
>> evenly
>> sized. A screenshot from my speed dial is at [1].
> Similar question here.  Why can't you just take a screenshot and crop
> it to the necessary size?  I don't feel like switching over to my
> windows box to test Opera - are the speed dial boxes variable-width?

Yes, they are dynamically sized - think "height: 33%; width: 33%", with  
different percentages depending on the number of items. On a web-page  
version of this, the size of the thumbnails is a styling issue and belongs  
in CSS, does it not? (At least under constraints such as download size -  
for speed you probably will want to make a smaller version of the  
screenshot, just not N smaller versions.)

BTW, Opera is built for Linux (which I use almost exclusively), FreeBSD  
and Mac in addition to Windows. I don't judge you if you are using a  
"fifth OS", though. ;)

Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway
Received on Wednesday, 25 May 2011 08:59:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:46 UTC