W3C home > Mailing lists > Public > www-style@w3.org > December 2008

Re: background-position and bidi in CSS 2.1

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sun, 14 Dec 2008 12:15:55 -0800
Message-ID: <4945697B.30909@terrainformatica.com>
To: "L. David Baron" <dbaron@dbaron.org>
CC: www-style@w3.org

L. David Baron wrote:
> On Sunday 2008-12-14 05:52 +0100, Daniel Glazman wrote:
>> Currently implementing background-* properties in BlueGriffon,
>> I have found two issues in the case of a rtl document:
>>
>> 1. we miss the values 'start' and 'end' for horizontal position
>>    and that's is incredibly painful for rtl documents.
>>
>> 2. a length always aligns the top left corner of the image.The
>>    definition for <length> values should probably be bidified
>>    and use "top right" corner in case of rtl. If it's not the
>>    case, it forces web authors to make computations that are not
>>    existing in the case of ltr.
>>    I have a good example : make an arbitrary background image non
>>    tiling aligned with the top start corner of the content edge
>>    of a box having a left padding of 10px and a right padding of 7px.
>>    Trivial for ltr, painful for rtl. Preserving the behaviour if
>>    the width of the box changes will require JS in rtl documents.
> 
> I don't think we should attempt to change this in CSS 2.1; it's too
> late to introduce new features there.  And given that
> css3-background is very close to entering CR, solving the problem
> there could lead to implementation just as soon.
> 
> We discussed issue (2) rather extensively at the Cambridge
> face-to-face meeting:
> http://lists.w3.org/Archives/Public/www-style/2008Sep/0075.html
> and I think issue (2) seems to be addressed by the current
> css3-background draft:
> http://dev.w3.org/csswg/css3-background/#the-background-position
> as we discussed at the Cambridge meeting.
> 
> I think issue (2) is more critical than issue (1), since issue (2)
> is about providing equal capability to rtl documents, whereas issue
> (1) is about writing a single style sheet that can work for
> documents in either direction.  Issue (1) also seems a little more
> complicated, since:
> 
>   (A) if we introduce 'start' and 'end', we need to do it in a way
> that's forward-compatible with vertical text flow, which means we
> probably also need to introduce 'before' and 'after' and forbid
> mixing before/after/start/end with top/right/bottom/left.
> 
>   (B) If we really want to let authors use the same style sheet for
> documents in different directions (which seems to be the point of
> (1)) we also need to be able to flip and rotate the background
> image, and we also need to be able to change the meanings of the
> 'background-repeat' property.
> 

Flipping as any other automatic transformations of images for RTL
are not working in some cases. Consider image with
shadow. You cannot just flip it.

If someone might consider that calc() example in
http://dev.w3.org/csswg/css3-background/#the-background-position
as a solution then it is still a question what selector to use
for distinguishing RTL environments.

You cannot use things like:
[dir=rtl] ul { padding-right:2em; }
in general.

It should be :ltr/:rtl pseudo-classes to be short.

Sorry but there is *absolutely* no way in CSS2.1/3 to say
something like this now:

ul:ltr { padding-left:2em; }
ul:rtl { padding-right:2em; }


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Sunday, 14 December 2008 20:16:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:18 GMT