This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html Multipage: http://www.whatwg.org/C#the-dir-attribute Complete: http://www.whatwg.org/c#the-dir-attribute Comment: When the parent element is not an HTML element, the directionality of the child should default to LTR Posted from: 66.207.208.98 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Firefox/17.0
Unless, of course, the spec defines directionality as a binary thing on all elements, not just HTML elements. In which case it might be good to explicitly call that out.
(In reply to comment #1) > Unless, of course, the spec defines directionality as a binary thing on all > elements, not just HTML elements. In which case it might be good to explicitly > call that out. I think directionality should work the same regardless of whether an element is defined in HTML or not. Making it do something different (e.g. defaulting to LTR for the element or its children) would break existing pages. Even if there were no existing RTL pages using non-HTML elements (which there certainly are), I do not see any utility in making the directionality of non-HTML elements work differently.
I would be fine with that, personally, as comment 1 says.
So the bug here isn't "When the parent element is not an HTML element, the directionality of the child should default to LTR.", it's "HTML doesn't define what happens when the parent of an element is not an HTML element". An element can have - LTR directionality - RTL directionality - no directionality http://www.w3.org/TR/selectors4/#the-dir-pseudo There are various possibilities, here are the three I can think of: - All elements, whether they are HTML or not, have a directionality. - Non-HTML elements do not have a directionality, but directionality inherits through them. (This would be represented by two binary states: whether the element is LTR or RTL, and whether the element has a directionality or no.) - As bz proposed, HTML children of elements without a directionality inherit LTR.
(In reply to comment #4) > An element can have > - LTR directionality > - RTL directionality > - no directionality > http://www.w3.org/TR/selectors4/#the-dir-pseudo I do not see where the link above or the current HTML5 spec say that an element can have no directionality. As far as I understand, it is always either LTR or RTL. > > There are various possibilities, here are the three I can think of: > > - All elements, whether they are HTML or not, have a directionality. And, presumably, it is inherited from the parent if not set through an explicit dir attribute. This seems like the obvious approach to me. > > - Non-HTML elements do not have a directionality, but directionality > inherits through them. (This would be represented by two binary > states: whether the element is LTR or RTL, and whether the element > has a directionality or no.) What would be the utility of having such a fine distinction? > > - As bz proposed, HTML children of elements without a directionality > inherit LTR. But this would break current RTL pages that use non-HTML elements. And it would mean that, by default, the children would have LTR directionality but RTL direction (when the grandfather is RTL). Seems like a big mess to me.
(In reply to comment #5) > (In reply to comment #4) > > - As bz proposed, HTML children of elements without a directionality > > inherit LTR. > > But this would break current RTL pages that use non-HTML elements. And it would > mean that, by default, the children would have LTR directionality but RTL > direction (when the grandfather is RTL). Seems like a big mess to me. Sorry, the connector should have been "Or", not "And". That is, let's say that we decide that the span in <div dir="rtl"><foo><span>...</span></foo></div> should have LTR directionality. If, in the absence of custom CSS rules, it simultaneously gets direction:rtl, we have a mess, and if it has direction:ltr, we have a lack of backward compatibility. And I still do not understand the rationale for this proposal.
As far as I can tell, this was already defined. However, I've tried to make it clearer. Let me know if it's still ambiguous or if I missed the point here.
Checked in as WHATWG revision r7495. Check-in comment: Clarify that 'directionality' applies to all elements. http://html5.org/tools/web-apps-tracker?from=7494&to=7495