2.1 Revisit proposals for activating/canceling bidi isolation (Was: Re: Implementation status of "Additional Requirements for Bidi in HTML")

Hi bidi folks,

This is an attempt to revisit some issues around the prosed featured  
of the 'ubi' attributes. As far as I understand, the original global  
'ubi' attribute was rejected because

[[
Generally we only add global attributes when you'd use the attribute  
on all kinds of elements, not just phrasing content.
]] (see [1])

but I think in principle we need HTML syntax for everything that's  
needed from 'unicode-bidi' of the current CSS3 Writing Modes  
module[2]. The current proposal in HTML5 requires the user to use  
<ubi> or <output>[3] to activate bidi isolation, which has following  
issues raised by Aharon[4]:

- Longer syntax (need a closing tag)
- I want isolation by default for dir=auto elements, but I want to be  
able to suppress it with ubi=off, which I can't do with an element.
- Should the output element, which is likely to be used mostly for  
numbers, really be isolated, with no way to override it in HTML?[5]

[1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=10807#c27
[2] http://dev.w3.org/csswg/css3-writing-modes/
[3] http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#punctuation-and-decorations
[4] http://www.w3.org/Bugs/Public/show_bug.cgi?id=10807#c8
[5] https://docs.google.com/a/google.com/document/d/17nb3wlYkIG9MNtL1mlXVPOVe4QwyApiHRYim3nTi5CE/edit?hl=en&pli=1&ndplr=1

For the first point, Aharon mentioned an example like <a><ubi>BLAH  
BLAH</ubi></a> is too ugly and I concur with that. Suppose we put the  
second point into the default UA style sheet,

       [dir=auto] { unicode-bidi: isolation;}

but then we need an syntax to cancel bidi isolation. I am proposing we  
add the 'off' attribute to the ubi element with the following default  
UA style sheet (cancel the isolation of the children of the <ubi>  
element to 'embed'):

      ubi[off] > * {unicode-bidi: embed; }

Ex:

     <ubi off><output>BLAH BLAH</output></ubi>

    <ubi off><a dir="auto">BLAH BLAH</a></ubi>  ( <a>BLAH BLAH</a>  
should be used instead if you don't want to apply dir="auto" to it)

This is really just a tweak of the original ubi="off" proposal.

Pros
1. It provides a way to cancel bidi isolation on <output>
2. It reduces <a><ubi>BLAH BLAH</ubi></a> to <a dir="auto">BLAH BLAH</ 
a> but there's side effect, you might need <a dir="auto"  
autodirmethod="inherit">BLAH BLAH</a> in the end. lol

Cons
1. Using dir="auto" for the purpose of initializing bidi isolation is  
a hack. But I am guessing that some people would like to have

         [dir=ltr], [dir=rtl] {unicode-bidi: isolation;}

instead of the current 'embed', but this is a non-starter (cause it  
breaks backward-compact) and this hack might provide a workaround.
2. The fact that

        <ubi off><ubi>BLAH BLAH</ubi></ubi>

is not isolated is maybe unintuitive. Also, <ubi off> would not  
propagate to other descendants.

Frankly, it seems that having a global ubi attribute would be more  
intuitive, but I have no idea what the consequences of introducing a  
new global attribute are. Perhaps an API would be needed?

Some side comparison between these two systems:
<ubi>BLAH BLAH</ubi>                       <span ubi>BLAH BLAH</span>

<control>BLAH BLAH</control>          <control ubi>BLAH BLAH</control>

<a><ubi>BLAH BLAH</ubi></a>        <a ubi>BLAH BLAH</a>

<a dir="auto">BLAH BLAH</a>           <a dir="auto" ubi>BLAH BLAH</a>

<ubi off><control>BLAH BLAH</control></ubi>    <control ubi="off">BLAH  
BLAH</control>

Some are shorter, some are longer. If there's any statistics on the  
percentage of cases when the user wants "dir=auto" to activate bidi  
isolation, it could be helpful for obtaining a quantitative result.

As far as I known, a goal of the HTML5 editor is to let the users use  
u, b, i and so on instead of span, so this is likely to be a reason  
why he doesn't like the right hand side, which has <span ubi>.  
However, <ubi> looks just too dummy in case 3 and 5.

Perhaps this comparison can lead us to the right track, whatever it is.

If it is concluded that the RHS is better, maybe we should suggest the  
editor to deprecate <bdo> in favor of a new 'bdo' attribute to make it  
consistent. A comparison pair is listed as follows

<a><ubo dir="rtl">BLAH BLAH</ubo></a>     <a dir="rtl" ubo>BLAH BLAH</a>

with the follwodefault UA stylesheet

[dir] { unicode-bidi: embed; }
[dir=auto] { unicode-bidi: isolation;}
[ubo] { unicode-bidi: unicode-override; }
[ubi] { unicode-bidi: isolate; }
[ubi=off] { unicode-bidi: embed;}


Cheers,
Kenny

Received on Wednesday, 22 December 2010 18:34:48 UTC