Re: [csswg-drafts] [css-ruby-1] Propose to treat rtc with orthogonal writing-mode to be inter-character rather than using ruby-position (#1773)

How about we solve this overall question of writing modes for inter-character annotations is by:
    
> The writing-mode of a ruby annotation is computed to vertical-rl if the
ruby-position of parent (i.e. the ruby-position of the annotation container) is inter-character

This is different from the current spec, which computes on the annotation container itself. Upsides (?) are:
* No need to worry about someone manually changing the writing-mode on the annotation itself
* Interdependency on an element is between writing-mode and display only, as we're using ruby-position of the parent.

Although display and writing-mode would depend on each other on a single element, there is no loop: writing-mode would depend on display only if display is ruby-annotation, and in this case display does not depend on writing-mode. If needed, we could also make orthogonal writing-mode affecting display a used-value time operation, since 'display' doesn't inherit.

This works fine if:
* neither the annotation nor its annotation containers are anonymous
* the annotation container is anonymous (just go up one level to the ruby container)
* the annotation is an anonymous wrapper around white space (there's no structure below the annotation within which we should worry about inheritance)
    
The only odd case is this:

```html
<ruby style="inter-character">hello<rtc>I am <em>really</em> messed up</ruby>
```
or equivalently this:
```html
<ruby>hello<rtc style="inter-character">I am <em>really</em> messed up</ruby>
```

Inheritance works on the element tree, so the forced vertical writing mode on the rtc doesn't propagate down to the `<em>` element, which then is an orthogonal horizontal-tb inline-block inside the vertical annotation.

I suppose we could make an exception and ask inheritance to special case this, but I don't think we need to: there's no reason to use that particular markup pattern. Authors should instead use this simpler markup, which works just fine.

```html
<ruby style="inter-character">hello<rt>This is <em>fine</em>.</ruby>
```

And if they really want an rtc element there for some reason, then they should have an explicit rt element as well.

With that in mind, this proposal solves all cases involving reasonable markup, without going into complicated inheritance or computed value shenanigans.

See also prevous www-style commentary https://lists.w3.org/Archives/Public/www-style/2014Dec/0245.html (thread) and https://lists.w3.org/Archives/Public/www-style/2015Feb/0358.html

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1773#issuecomment-775694005 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 9 February 2021 06:06:52 UTC