Erik van der Poel wrote:
> 
> How about creating a new file:
> 
>   mozilla/layout/html/content/src/nsHTMLBDOElement.cpp
> 
> And then add eHTMLTag_bdo to MakeContentObject():
> 
http://lxr.mozilla.org/seamonkey/source/layout/html/document/src/nsHTMLContentSink.cpp#912
> 
> nsHTMLFontElement.cpp maps the font element and its attributes into
> style, so perhaps nsHTMLBDOElement.cpp could do the same for BDO and the
> DIR attribute.
> 

Sounds good. Thanks. BTW I tried to do this some time ago, but finally
decided to add a function to nsHTMLSpanElement.cpp


> > We don't seem to interfere with the existing precedence rules.
> > So that the following would work:
> >
> >   <style type="text/css">
> >     P {unicode-bidi: normal; direction: ltr}
> >   </style>
> >   <!unicode-bidi: normal - means that override is prohibited>
> >
> >   ...
> >
> >   <P><BDO dir=rtl>abc</BDO></P>
> 
> I don't understand this example. What is supposed to happen according to
> the specs?


Sorry about the typo. Supposed to be:

<style type="text/css">
  BDO {unicode-bidi: normal; direction: ltr}
</style>
<!unicode-bidi: normal - means that override is prohibited>

...

<P><BDO dir=rtl>abc</BDO></P>

We see here 2 rules with identical weight and origin, but different
specificity:
the first rule has selector's specificity = 1 (please correct me if I'm
wrong; anyway, its specificity has a non-zero value!), and the second
one has specificity = 0

<http://www.w3.org/TR/REC-CSS2/cascade.html#cascade>
"the non-CSS presentational hints must be translated to the
corresponding CSS rules with specificity equal to zero."

As a result, the first rule wins, <BDO dir=rtl> has no effect, and the
text should be displayed as is:               abc


(... Or you meant something else by "rules of precedence"?)

Thanks,
Lina

Reply via email to