[Bug 10808] i18n comment 2 : new dir attribute value: auto, and a new attribute: autodirmethod


--- Comment #18 from Maciej Stachowiak <mjs@apple.com> 2010-10-19 20:32:31 UTC ---
(In reply to comment #15)
> (In reply to comment #18 under bug 10807)
> > Having dir values that don't map to CSS will be problematic for implementors,
> > since the dir attribute is currently implemented 100% by mapping to CSS.
> > Getting the right interaction with the values that *do* map to CSS would be
> > particularly tricky. I expect the likely outcome would be to map to a
> > nonstandard CSS value for the direction property.
> I do not understand the reasoning for any of these conclusions. The
> implementation would be to scan (part of) the element's content and to set the
> CSS direction to either ltr or rtl. Seems simple enough, and the effects are
> exactly what we want. 

I see, I misunderstood the proposal. Questions about the new proposal:

(1) Should the scan be redone if the contents of the element change (e.g. due
to DOM manipulation), rather than only doing it once?

(2) Should the scan consider CSS generated content (e.g. markers, :before
content, text transforms, etc) instead of just looking at the raw text?

(3) Should the scan exclude text that is "display: none" and therefore is not

My answer to all three questions would be "yes", which is why I think this
needs to be at the CSS layer, rather than just the HTML layer.

> As far as I can remember what I was told by CSS experts, doing the estimation
> in CSS is far more difficult to implement, with weird feedback loops, e.g. due
> to the new CSS ability to select by direction.

Doing it correctly at the HTML level without involving CSS seems impossible, if
we care about issues (1)-(3) above.

> > Maybe it would have been better if CSS never got involved in defining
> > directionality, but that's not the world we live in. Having text direction
> > controlled by a mix of CSS and non-CSS mechanisms is likely to be needlessly
> > confusing and hard to implement.
> Bidi is already controlled by parallel HTML and CSS mechanism that do not map
> directly one to the other.

Not true. All current HTML directionality constructs map to CSS.

> As far as I understand it, the reason that the CSS bidi properties exist is
> that it is impossible to implement the bidi stuff without them: for the most
> part, it can only be implemented in the CSS layer, but the CSS layer is not
> supposed to know anything about specific HTML elements or attributes, so the
> HTML layer needs to pass the information on to the CSS layer, and the only way
> to do that is via CSS properties.

This same argument applies to auto-direction in my opinion.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 19 October 2010 20:32:34 UTC