Re: [CSS3] Some clarifications on background-position four values parsing.

On Fri, 09 Nov 2012 15:32:24 +0100, Alexis Menard  
<alexis.menard@intel.com> wrote:

> top 20px center is valid but Opera treats it as invalid.

Do you have a test case for that? When I try it, it works. This is with  
12.10 (and also some internal builds with older versions of our rendering  
engine, going back a couple of years).

> Should it be
> left 50% top 20px for the actual property value?

Yes, or at least that's equivalent.

"If three or four values are given, then each <percentage> or<length>  
represents an offset and must be preceded by a keyword, which specifies  
 from which edge the offset is given."

So in this case, 20px specifies an offset from the top edge, since it's  
preceded by the keyword 'top'.

"If three values are given, the missing offset is assumed to be zero."

OK, this wording doesn't really make sense in this case since there isn't  
really any missing offset, 'center' can't have offsets added to it. But at  
least the previous quote suggests that 'center' is not an offset (it's not  
a percentage or length), so it's just grouped by itself.

"‘center’" "Computes to ‘50%’ (‘left 50%’) for the horizontal position if  
the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’)  
for the vertical position if it is."

Horizontal position is not otherwise specified here, so 'center' computes  
to 'left 50%'.

-- 
Øyvind Stenhaug
Opera Software ASA

Received on Monday, 12 November 2012 14:19:49 UTC