W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: [css-writing-modes][css-scoping] unicode-bidi in Shadow DOM, and possibly other properties?

From: Simon Pieters <simonp@opera.com>
Date: Thu, 18 Dec 2014 07:38:36 +0100
To: "Koji Ishii" <kojiishi@gmail.com>
Cc: "www-style list" <www-style@w3.org>, public-i18n-bidi@w3.org
Message-ID: <op.xq1wqm1iidj3kv@simons-mbp>
On Wed, 17 Dec 2014 13:34:14 +0100, Koji Ishii <kojiishi@gmail.com> wrote:

> # Forgot to add [css-writing-modes] in the subject
>
> On Wed, Dec 17, 2014 at 8:36 PM, Simon Pieters <simonp@opera.com> wrote:
>> On Wed, 17 Dec 2014 11:56:36 +0100, Koji Ishii <kojiishi@gmail.com>  
>> wrote:
>>
>>> Can bi-di & CSS experts help us to figure out what to do with  
>>> unicode-bidi
>>> and Shadow DOM?
>>>
>>> I’m thinking, at the Shadow DOM boundaries, the ‘unicode-bidi’ property
>>> should be set to ‘isolate’ since that’s the value for bi-di to suffice  
>>> the
>>> philosophy of components IIUC. Is this correct? In Bidi Rules for  
>>> HTML4[1],
>>> I see <div>, <form>, etc. sets this, but I don’t see <input> or  
>>> <textarea>,
>>> so I’m not confident on this point and would appreciate any advices.
>>
>>
>> Maybe  
>> https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering
>> is more relevant than the "for HTML4" appendix.
>
> Thank you, I didn't know this!!
>
> What's more interesting to me is that this section uses dir="i", which
> is not defined in either HTML spec[3][4].

No, it doesn't. It uses the selector [dir=ltr i] where the i means  
case-insensitive match for the attribute value "ltr".

http://dev.w3.org/csswg/selectors4/#attribute-case


> "plaintext" value "behaves as 'isolate'", so probably 'isotelate' is
> correct, and given dir="i" is not defined in HTML, probably sticking
> on the "unicode-bidi" property is correct?

Why is <plaintext>'s behavior relevant to your original question?


>> (Can we drop those appendices? Why do we have them?)
>
> Don't know, it's been there for more than 3 years. I'm ok to remove,
> if no one objects.
>
>>> The next question is, assuming so, what is the best way to force that.
>>> Looking at Inheritance section of CSS Scoping[2], since top-level  
>>> elements
>>> of a shadow tree inherit from their host element, so I guess we should  
>>> let
>>> the computed value of ‘unicode-bidi’ of the host elements to  
>>> ‘isolate’. Is
>>> this correct approach?
>>>
>>> And the third and the last, I can’t find any other properties for the
>>> Shadow DOM to handle differently than normal inheritance. Can someone  
>>> find
>>> any?
>
> And any insights for these two questions?

I'm not an expert in either Shadow DOM or bidi, but...

I think if you want to match HTML elements like <div>, it should be  
unicode-bidi: isolate; except when the document's encoding is ISO-8859-8  
in which case it should be unicode-bidi: bidi-override;. As a UA-level  
style rule.

If you want to match HTML elements like <span> or unknown elements, don't  
set unicode-bidi.

What should happen with <span is=foo-bar>?

I don't think you want to just override the computed value of the host  
element. What if the author has set it to something else?


>>> [1] http://dev.w3.org/csswg/css-writing-modes/#bidi-html
>>> [2] http://dev.w3.org/csswg/css-scoping/#inheritance
>
> [3] https://html.spec.whatwg.org/multipage/dom.html#the-dir-attribute
> [4] http://www.w3.org/TR/html5/dom.html#the-dir-attribute


-- 
Simon Pieters
Opera Software
Received on Thursday, 18 December 2014 06:39:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC