[css-text-3] treat all-neutral lines same as empty ones for plaintext alignment · Issue #4405 · w3c/csswg-drafts (original) (raw)

[note added 9 Oct @15:35 by @r12a
For an overview of the thread leading up to this see here]

From Aharon Lanin https://lists.w3.org/Archives/Public/public-i18n-bidi/2016JulSep/0028.html

I do not think that there is a problem with the directionality algorithm. Aside from alignment, it makes no difference whether that isolate paragraph is displayed as LTR overall or RTL overall. And for much more important and common cases of all-neutral text - phone numbers and, to a smaller extent, dates, times, and signed numbers - its being LTR by default is extremely important.

I do think that there is a problem with the definition of start alignment, which is not controlled by Unicode, but by various other specs, such as CSS. The problem affects the alignment of all-neutral paragraphs generally, like the examples cited above, not just the corner case of an isolate. Start alignment is generally defined as "left" for an LTR paragraph, and "right" for an RTL paragraph, and this means that an all-neutral paragraph, which is LTR by the UBA, is left-aligned - even if the alignment outside that paragraph is right. This makes the all-neutral paragraph needlessly different from its surroundings and usually looking pretty bad.

The solution is to make start alignment match the alignment outside the paragraph if the paragraph's directionality is determined from its content and its content is all-neutral.

In the context of CSS, the relevant spec is that of the start and end edges of a line box whose containing block has ‘unicode-bidi: plaintext’ (https://www.w3.org/TR/css-text-3/#bidi-linebox). It already makes an exception for an empty line box, which "takes its inline base direction from the preceding line box (if any), or, if this is the first line box in the containing block, then from the ‘direction’ property of the containing block." I think that this exception should be broadened to an all-neutral line box.