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

Follow up on this topic after having an informal discussion with a few
Shadow DOM folks.

TL;DR, I changed the opinion to not to force the computed value of the
unicode-bidi property for the Shadow DOM.

In most cases we assume authors will use div or other block elements
as the shadow hosts, and since they are already
'unicode-bidi:isolate', forcing the unicode-bidi property is probably
not necessary.

For custom elements, there are two ways to instantiate: type
extensions and custom tags.

Type extensions (e.g., <button is="x-foo">) always have base elements
to which UA default stylesheets match, so it falls into the same
category as the shadow host above.

Custom tags (e.g., <x-foo>) has a different story since UA default
stylesheets have nothing for them. Our current conclusion is that we
should be consistent with other two cases; i.e., it should be authors'
responsibility to set the appropriate unicode-bidi property.

Thank you Simon for the great suggestion!

/koji

On Mon, Dec 22, 2014 at 4:35 PM, Koji Ishii <kojiishi@gmail.com> wrote:
> On Thu, Dec 18, 2014 at 3:38 PM, Simon Pieters <simonp@opera.com> wrote:
>>>
>>> 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
>
> Ah, ok, I was too much looking for dir=isolate and forgot that, thank you.
>
>> 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?
>
> Thank you for the great suggestion. I was under an assumption that
> Shadow DOM needs to enforce encapsulations, but your suggestions
> brought me two questions I'd want to run with Shadow DOM experts:
>
> 1. If Shadow hosts are inline, do we want its bidi state isolated or
> not from the parent tree?
>
> 2. Your suggestion makes sense, but then it'd be author's
> responsibility to set it correctly for custom elements. Are we ok with
> this, or do something in custom elements?
>
> I don't have answers to these questions right now, I'll look into
> further. Thank you for your thoughts!
>
> /koji

Received on Wednesday, 24 December 2014 04:12:52 UTC