Re: background-position and bidi in CSS 2.1

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.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Sunday, 14 December 2008 19:49:21 UTC