W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[css3-images] Editorial: Wording of 'object-fit: fill' apparently mandates filling the content box

From: Leif Arne Storset <lstorset@opera.com>
Date: Wed, 01 Feb 2012 15:34:06 +0100
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.v8z724bktmo5g6@localhost.localdomain>
In section 5.4, the definition for 'object-fit: fill' currently contains:

# Set the object's size to the concrete object size obtained by running
# the object sizing algorithm with a specified size and a default object
# size equal to the replaced element's used width and height.
#
- This will make the contents exactly fill the replaced element's
- content box.

This statement will probably be interpreted too strongly. For example, an
SVG image with preserveAspectRatio not set to "none" will be given the
entire content box of the replaced element to render in, but it will
actually only render into an area that will maintain the aspect ratio. [0]

Of course, if the reader consults section 5.2. "CSS‚áčObject Negotiation",
step 3, the correct behavior is specified there. However, I think it's
good to be clearer about the behavior here.

Note that Opera's implementation (AFAIK the only of the two that is easily
obtainable) does not currently match the spec in this respect. (Or rather,
it matches the overly-strict interpretation of the paragraph quoted above.)

Suggested wording:

# Set the object's size
[...snip rest of paragraph...]
#
+ This will allow the object to fill the replaced element's content box.
+
+ NOTE: However, the object may choose to render at a smaller size, as
+       mentioned in section 5.2. For example, an SVG image will usually
+       preserve its aspect ratio even if 'fill' is specified.

[0] A pivotal post in the discussion about this:
         http://lists.w3.org/Archives/Public/www-style/2010Feb/0164.html

-- 
Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway
Received on Wednesday, 1 February 2012 14:34:44 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT