Re: Bidi - HTML vs. CSS

At 02:29 PM 2/22/00 -0500, Matthew Brealey wrote:
>Section 8.2.6 of HTML seems to me to be illogical, and doesn't seem to
>work with CSS' cascading rules.
...
>
>When an inline element that does not have a dir attribute is transformed
>to the style of a block-level element by a style sheet, it inherits the
>dir attribute from its closest parent block element to define the base
>direction of the block.
>
>| This is not fine, because an inline element has [implied - these are the
>initial values] INLINE ELEMENT {display: inline; unicode-bidi: normal}.
>Specifying display: block according to the above results in inheritance of
>the dir attribute, which is equivalent to setting unicode-bidi: embed, so
>display: block also sets unicode-bidi: embed.

The "trick" is that "unicode-bidi: embed" has the same semantics as 
"unicode-bidi: normal" for an element with "display: block"
this is because Unicode doesn't embed blocks. 

The reason that CSS2 suggests that the default (informative?) HTML style sheet 
have "unicode-bidi: embed" for blocks is to accommodate for the case where 
a <p> for example is "converted" to "display: inline" in which case 
the "Unicode-bidi" better be set to "embed".
 
>
>This totally screws up the cascade. It appears to me that this section is
>a a hangover from the time when CSS didn't support bidi; but now it does
>it seems that this section is totally unnecessary and should be excised
>from HTML.
>
>In the mean time however, what effect does this bizarre 'display: block
>implies unicode-bidi: embed' (it's as absurd saying color: black implies
>background: white) have? For example, is this 'inheritance' forced or can
>it be overridden; e.g., does unicode-bidi: normal suppress it or not.

It has no effect. Since for an element with "display: block" 
"Unicode-bidi: embed" and "Unicode-bidi: normal" have identical 
semantics. "Unicode-bidi: embed" is a "conditional style" that is 
different from "normal" only when the element has "display: inline".

>
>Or perhaps I've got hold of the wrong end of the stick? Do they instead
>live in parallel universes - was I mistaken in my assumption that the HTML
>should map to CSS (e.g., for specificity of formatting attributes)?

CSS2 in <http://www.w3.org/TR/REC-CSS2/visuren.html> says 
"Conforming HTML user agents may therefore ignore the 'direction' 
 and 'unicode-bidi' properties in author and user style sheets. "

I think they wanted to say "conforming CSS2 user agents may therefore 
ignore the 'direction' and 'unicode-bidi' properties in author 
and user style sheets, when the style sheet is applied to an HTML document." 

Also in <http://www.w3.org/TR/REC-CSS2/visuren.html>
we have "Conforming HTML user agents may ignore the 'display' property."
Probably with a similar intention as the above quotation.

>From a practical point of view is seems best 
1. In HTML, do not mess with the display property, in particular 
   when using BiDi.
2. In HTML, do your BiDi in HTML; not in the associated style sheet.

Clearly, I didn't answer all your questions, but I hope that 
I answered some.

Regards,
Nir.
===================================
Nir Dagan
Assistant Professor of Economics
Brown University 
Providence, RI
USA

http://www.nirdagan.com
mailto:nir@nirdagan.com
tel:+1-401-863-2145

Received on Wednesday, 23 February 2000 06:36:31 UTC