Re: directional images

On Fri, Nov 5, 2010 at 3:59 AM, Aharon (Vladimir) Lanin
<aharon@google.com> wrote:
> As was mentioned during the CSS face-to-face at TPAC, the declarative
> (ltr|rtl) version is indeed better than the instructive (rtlflip).
> Furthermore, we probably want similar keyword(s?) to deal with writing mode,
> for the required rotation(s?). I am not familiar enough with the
> requirements of vertical text, so I would not want to spec that. Tab?
> As was also mentioned, this does not address similar flipping/rotation for
> <img> elements, since that should already be available, with authorsdefining
> classes like this (and similar ones for writing mode):
> .flip-in-rtl:rtl {
>   transform:scaleX(-1);
> }
>
> .flip-in-ltr:ltr {
>   transform:scaleX(-1);
> }
>
> Then, the HTML can simply say <img class="flip-in-rtl" ...>
> Now, for a crazy idea: could the default stylesheet define such classes, so
> they have well-known names and don't have to be done again and again by
> authors? (I am not pushing the names or any other detail I scribbled in the
> code above, just the idea itself.)

We don't like predefined class names; classes are explicitly for
authors to innovate in, not browsers.

However!  Could you do this by tagging the <img> with @dir?  Then you could do:

:rtl > img:ltr, :ltr > img:rtl {
  transforms: scaleX(-1);
}

That is, whenever the <img> is in an opposite-direction context, flip it.

~TJ

Received on Friday, 5 November 2010 21:14:40 UTC