RE: 'dir' attribute on BIDI inline elements and actual browsers

The Unicode Bidirectional algorithm(http://www.unicode.org/reports/tr9/)
provides the guidance on how to process this. The correct layout is [1].

Because the Hebrew is a RTL script, the addition of the span does
nothing to change the layout. One could just as easily have put: 

<p>English1 &#1506;&#1489;&#1512;&#1497;&#1514;2. 
&#1506;&#1489;&#1512;&#1497;&#1514;3 
Englisch4.</p>

If you wanted the layout of [2], you can do the following to force the
right bidirectional embedding:

<p>English1 &#1506;&#1489;&#1512;&#1497;&#1514;2. 
<span dir=ltr>&#1506;&#1489;&#1512;&#1497;&#1514;3 
Englisch4.</span></p>

Some years ago I wrote a document "Authoring HTML for Middle Eastern
Content". It can be found at:
http://www.microsoft.com/globaldev/handson/dev/Mideast.mspx

Paul


-----Original Message-----
From: www-html-request@w3.org [mailto:www-html-request@w3.org] On Behalf
Of Mikko Rantalainen
Sent: Tuesday, December 19, 2006 11:43 PM
To: www-html@w3.org
Subject: Re: 'dir' attribute on BIDI inline elements and actual browsers


Helmut Wollmersdorfer wrote:
> 8.2.3 Setting the direction of embedded text
> http://www.w3.org/TR/html401/struct/dirlang.html#h-8.2.3
> 
> describes the use of the 'dir'-attribute on inline elements, and gives
a 
> nice (and simple) example.
> 
> Let me give another example:
> 
> <p>English1 <span
dir="rtl">&#1506;&#1489;&#1512;&#1497;&#1514;2</span>. 
> <span dir="rtl">&#1506;&#1489;&#1512;&#1497;&#1514;3</span>
Englisch4.</p>
> 
> In plain text
> English1 Hebrew2. Hebrew3 English4.
> 
> Which some browsers (Mozilla familiy, IE) display
> 
> [1] English1 3werbeH .2werbeH English4.
> 
> and Konqueror 3.5.5 displays
> 
> [2] English1 2werbeH. 3werbeH English4.
> 
> Which one is compliant to the W3C Specification?

I believe that the [1] variant is the correct one. As the span 
elements above are not nested with each other I think the correct 
rendering should be similar to rendering of

<p>English1 <span dir="rtl">&#1506;&#1489;&#1512;&#1497;&#1514;2.
&#1506;&#1489;&#1512;&#1497;&#1514;3</span> English4.</p>

or

<p>English1 &#1506;&#1489;&#1512;&#1497;&#1514;2.
&#1506;&#1489;&#1512;&#1497;&#1514;3 English4.</p>

which, if I've understood correctly, should be rendered like the [1] 
variant above.

(I interpret the above to contain two RTL text runs separated by 
neutral characters.)

-- 
Mikko

Received on Tuesday, 19 December 2006 21:50:03 UTC