[Bug 23260] Make the dir attribute use isolation instead of embedding

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23260

Aharon Lanin <aharon.lists.lanin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #20 from Aharon Lanin <aharon.lists.lanin@gmail.com> ---
Sorry I am replying so late, but there is a number of problems in the latest
set of changes.

1. There is a problem in the CSS. The selector of "bdo { unicode-bidi:
isolate-override; }" has a lower specificity than the selectors of "[dir=ltr
i], [dir=rtl i], [dir=auto i] { unicode-bidi: isolate; }". As a result, this
assigns unicode-bidi:isolate to <bdo dir="ltr"> instead of the intended
isolate-override. To fix this, "bdo { unicode-bidi: isolate-override; }" should
be replaced with "bdo, bdo[dir=ltr i], bdo[dir=rtl i], bdo[dir=auto i] {
unicode-bidi: isolate-override; }". Note that this does assign isolate-override
to <bdo> and <bdo dir="auto">, though, which according to the spec for bdo are
not allowed. If that is problem (even though we have not worried about it up to
now), we need to break this up into two parts:

bdo, bdo[dir=auto i] { unicode-bidi: normal; }

bdo[dir=ltr i], bdo[dir=rtl i] { unicode-bidi: isolate-override; }

2. The spec for bdo, which previously stated that the element behaves as if it
were surrounded by LRO ... PDF or RLO ... PDF, now states that it behaves as if
it were surrounded by LRI ... PDI or RLI ... PDI. This is wrong, or at least
incomplete, because the isolate formatting characters alone do not achieve the
required override effect. It has to behave as if surrounded by LRI LRO ... PDF
PDI or RLI RLO ... PDF PDI. But actually, I think it would be best to remove
any reference to implementation via Unicode formatting characters entirely,
because this is actually in the province of
http://www.w3.org/TR/css-writing-modes-3. The specification there is actually
much more involved because it has to deal with the possibility that an element
(that is supposed to behave as surrounded by bidi formatting characters)
happens to contain within it various things that are bidi paragraph breaks.
(These include newlines when white-space is preformatted, <br>, and nested
elements with display:block.) According to the Unicode spec, a paragraph break
ends the effect of bidi formatting character(s), but this does not make sense
for HTML/CSS, where one would expect the effect of a dir attribute to last
until the end of the element. Thus, when such a paragraph break is encountered,
the spec says that the opening Unicode formatting characters for all the
relevant ancestor elements have to be repeated after the paragraph break. For
example, for <div dir="ltr">hello <bdo dir="rtl">foo<br>bar</bdo> world</div>,
the equivalent plain text is "[LRE]hello
[RLI][RLO]foo[PDF][PDI]\n[RLI][RLO]bar[PDF][PDI] world[PDF]". I do not think
that any of this should be specified on the HTML level because it needs to
refer to style - display, white-space, unicode-bidi. (And, if we were to
specify it on the HTML level, the place to start would be the dir attribute,
not the relatively unimportant <bdo>.)

Thus I think that the two paragraphs in the <bdo> spec that start with "If the
element's directionality is" should be removed. If you do not want to make such
a radical change at this late date, then they should be restored to the text
they had prior to http://html5.org/tools/web-apps-tracker?from=8282&to=8283.

3. A minor typo: "a such an element" should be "such an element".

4. While it probably is not absolutely necessary, I think that the sentence (in
the spec for the dir attribute) that currently reads "For the purposes of
applying the bidirectional algorithm to the contents of elements with a dir
attribute that is in one of the states defined above, user agents must treat
the element as an independent and isolated segment" would be more complete if
the words "of the directionality determined above" or something like them were
added. But I would not have reopened the bug for that alone.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Monday, 2 December 2013 08:32:31 UTC