Lina Kemmel wrote:
>
> Erik van der Poel wrote:
> >
> > Lina Kemel wrote:
> > >
> > > The problem is that we have to know at the same time: 1) tag/node info
> > > (BDO) and 2) attribute (DIR). One place where those are available, is
> > > nsPresContext::ResolveStyleContextFor, after style resolution.
> >
> > That doesn't seem like the right place to look for the BDO element and
> > DIR attribute.
>
> I fully agree it's not the right place to do that, but couldn't find
> another one, where the necessary info is available.
>
> > It would probably be better to do it where other HTML elements and attributes are
> > "mapped to style". I forgot where that was, but I'm sure there are others in this
> > newsgroup that know where it is.
>
> Appreciate any help.
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.
> Our purpose here is to map the BDO element to the UNICODE_BIDI_OVERRIDE
> style, on condition that the DIR attribute is present, but not to map
> the DIR attribute itself. Also, 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?
Erik