Re: [csswg-drafts] [css-writing-modes] direction: auto

@laukstein It is already the case that [semantic directionality in HTML is styled using the `direction` CSS property in the default user-agent style sheet](//html.spec.whatwg.org/multipage/rendering.html#bidi-rendering). This is done using the [`:dir` CSS pseudo-class](//drafts.csswg.org/selectors/#the-dir-pseudo), which matches DOM elements by their host language’s effective semantic direction. [`:dir`, of course, already matches elements with `auto` directionality using their automatically detected effective directionality](//html.spec.whatwg.org/multipage/semantics-other.html#selector-ltr). At this time, the user agent by this time must have already determined whether directionality is effectively LTR or RTR.

As for why you shouldn’t use the `direction` CSS property on HTML beyond the user-agent defaults, I’m not an expert, but I guess that would override the default user-agent style rules for bidirectionally and negate much of the value of HTML’s standardization of bidi markup.

As you probably already know, the finding of W3C and the Unicode Consortium is that bidirectional text should always use markup in HTML (cf. [UTR #20 / “Unicode in XML and other Markup Languages”: “Bidi Embedding Controls”](//www.w3.org/TR/unicode-xml/#Bidi), [“CSS vs. markup for bidi support”](//www.w3.org/International/questions/qa-bidi-css-markup), [“Inline markup and bidirectional text in HTML”](//www.w3.org/International/articles/inline-bidi-markup/)). Overriding directionality is important enough to the meaning of a text that it got standardized by Unicode for plain text with U+202A to U+202E. If different plain-text-rendering implementations implemented bidirectionally differently, then that standardization of encoding is lost.

`<bdo>` and `dir=` have to act as replacements for the plain-text control characters. For an HTML document, it is important that the bidi markup’s meaning is preserved independently and regardless of whatever stylesheet happens to be applied. Otherwise, the document’s textual meaning can change, e.g., simply when a stylesheet fails to load.

TL;DR: `direction` is already used on `dir=` by HTML’s default user-agent style sheet, and in HTML only `<bdo>` and `dir=` should be used to override bidi, just like U+202A to U+202E in plain text. Otherwise, the HTML text’s meaning becomes volatile.

(This again does not apply to arbitrary XML, which needs `directionality` to style whatever bidi markup it uses, just like HTML’s user-agent style sheet does…Though maybe the real issue is that `:dir` is not well defined for arbitrary XML. I don’t know yet whether a `directionality: auto` would be appropriate for arbitrary XML.)

-- 
GitHub Notification of comment by js-choi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2091#issuecomment-351301086 using your GitHub account

Received on Wednesday, 13 December 2017 06:57:12 UTC