W3C home > Mailing lists > Public > www-style@w3.org > November 2010

Re: directional images

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 5 Nov 2010 14:13:46 -0700
Message-ID: <AANLkTi=tgJ_V_g5QiTj3-n7JBTz3moSdL3Eg4X6KOe+h@mail.gmail.com>
To: "Aharon (Vladimir) Lanin" <aharon@google.com>
Cc: W3C style mailing list <www-style@w3.org>, "public-i18n-bidi@w3.org" <public-i18n-bidi@w3.org>
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 GMT

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