w3c / alreq

Documenting gaps and requirements for support of Arabic and Persian on the Web and in eBooks.
Other
60 stars 31 forks source link

Block elements converted to inline should retain isolation #193

Open r12a opened 5 years ago

r12a commented 5 years ago

@ntounsi describes some interesting behaviour that i will reproduce here:

div (or others block elements) default to isolate only in FF. Implementation problem. Following the example in this thread,

<div>ابجد</div> <div style="background-color: yellow;" >2 abc</div> with the style div {display: inline;}

gives (yellow for readability): isolate1 in FF (isolation) isolate2 in Safari, Chrome and Opera

The 2 sticks to Arabic (RTL) in the last image, due to non isolation.

r12a commented 5 years ago

I would have expected that the bidi isolation that applies to an HTML div or li when it is a block element would remain unchanged around the content of the element when CSS is used to convert it to inline, eg. for constructing tabs on a page. (I would expect that the same applies for all block elements that are defined in HTML to have isolation.)

I coudn't find any text in the Writing Modes spec to confirm that expectation. @fantasai @kojiishi what do you think?

Zhang-Junzhi commented 5 years ago

Here is the recommended default UA stylesheet in HTML spec:

https://html.spec.whatwg.org/#bidi-rendering

Firefox seems to be the reasonable one, and also it follows the recommendation of the spec.

kojiishi commented 5 years ago

Right, the spec is in HTML. We have a contributor on our crbug 296863 but he is not active these days.

Zhang-Junzhi commented 5 years ago

And that was the reason why I argued that the HTML spec's specifying div as meaningless at all is inaccurate. Because the unicode-bidi value for a div defaults to isolate, which is inconsistent with specifying div as meaningless at all

matial commented 5 years ago

It seems to me that isolation for a block is irrelevant until it is converted to inline. Thus FF's behavior (isolating the converted block) is the more useful one. Also, when in doubt, isolating is less likely to produce surprising effects than not isolating, so if the specs need to be clarified, this is the preferred choice.