W3C home > Mailing lists > Public > public-i18n-bidi@w3.org > October to December 2011

Styling bdi and dir=auto for legacy support

From: Richard Ishida <ishida@w3.org>
Date: Mon, 31 Oct 2011 17:32:39 +0000
Message-ID: <4EAEDBB7.2090003@w3.org>
To: "public-i18n-core@w3.org" <public-i18n-core@w3.org>, public-i18n-bidi@w3.org
I asked Remy Sharp and Bruce Lawson a few days ago to add bdi to the 
HTML5 shiv, so that it can be styled in IE.  This is a piece of 
JavaScript that is typically added to HTML pages to enable IE to 
recognize new HTML5 elements, such as article, aside, etc, and allow 
them to be styled.

I just received a tweet from Bruce Lawson:

"RT @rem HTML5shiv (and shim) now loaded with <data> element and the 
<bdi> element. I've not removed <time>. (cc @r12a)"

Apart from it's general usefulness, this opens the way for us to now 
discuss whether styling can help to bridge between use of the new 
elements/attributes on new vs older browser versions - particularly IE8.

I've seen a few places in my own pages where I'm inclined to add 
dir=auto or bdi right now, but I know that i will still need to also use 
the rlm/lrm for at least a couple of years to cater for the IE8
corporate legacy.

Using both will be messy, for explanation as well as for content authoring.

I'm wondering whether the situation can be helped a little by 
recommending the use of CSS.  For example, in
a LTR page or context, the CSS rule

bdi:before { content: '\200E '; }

will cause

<p>The names of these states in Arabic are <bdi>مصر</bdi>,
<bdi>البحرين</bdi> and <bdi>الكويت</bdi> respectively.</p>

to display as expected, even if bdi is not styled by the browser's 
default stylesheet to cause isolation of its content.

I suspect we may need to distinguish between cases, such as input
fields, where the rlm/lrm is not appropriate (because it doesn't help),
and situations like the example above, where it can help (either for bdi 
or dir=auto).

Actually, the CSS should probably be genericised to say something like,
if the direction of the parent element is RTL use rlm, and vice versa,
but I think that that capability too (using :rtl or :ltr) is only now 
being introduced and so will also fail on legacy browsers. Same goes for 
styling using unicode-bidi:isolate (which should eventually be added to 
the default stylesheet).

I haven't thought this through completely yet, but I throw it out there 
for suggestions.


Richard Ishida
Internationalization Activity Lead
W3C (World Wide Web Consortium)

Received on Monday, 31 October 2011 17:33:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:24:39 UTC