Re: [css-writing-modes][svg] Embedded SVG and inheritance

On 05/07/2015 01:14 AM, Jonathan Kew wrote:
> On 7/5/15 05:22, Koji Ishii wrote:
>> Not sure where to post cross-WG thing, IIUC cross-posting is not
>> recommended, so let me start here.

Cross-posting is totally fine, when it's a legit thing that should
be discussed in both groups. :)

>> An issue was brought up asking whether SVG viewBox is logical or
>> physical when containing HTML has writing-mode: vertical-*. I think
>> this is easy -- physical -- and should be confirmed at www-svg if
>> needed.
>>
>> But then checking CSS Writing Modes brought up a couple of CSS questions.
>>
>> 1. Is SVG "images" or "content involving text"?
>>
>> CSS Writing Modes defines[1]:
>>
>> * The content of replaced elements do not rotate due to the writing
>> mode: images, for example, remain upright.
>>
>> but then defines:
>>
>> * However replaced content involving text (such as MathML content or
>> form elements) should match the replaced element’s writing mode and
>> line orientation
>>
>> I suppose SVG belongs to images rather than "involving text" here even
>> if SVG contains text.

Yes, I think it should probably be treated as an image. We'll
want to clarify that in the spec.

>> 2. Does writing-mode: vertical-rl in HTML inherits to SVG?
>> [...]
>
> ... I agree it might be better to avoid this, as the svg image as a
> whole does not rotate. While there may be some cases where an author
> would want the text within an svg image to respond to the document's
> writing mode, this seems unlikely to be widely useful.
>
> Perhaps we should simply add
>
>    svg { writing-mode: initial; }
>
> to the UA stylesheet? Then an author who *does* want the outside
> writing-mode to apply to text within the svg can still use
> "writing-mode: inherit" to achieve this.

It seems to me that this is a broader problem than just writing-mode.
Should 'font-variant: small-caps' inherit into an SVG? What about
'text-emphasis'?

It might just make sense for the UA style sheet to include

   svg { all: unset; }

and then make a per-property exception if necessary for some very
specific reason, e.g.

   svg { all: unset; color: inherit; }

if we want 'color' to inherit by default.

The place to make this change would be
   * informatively in CSS Cascade Level 3 (as an example appendix)
   * normatively in the appropriate SVG specs

~fantasai

Received on Thursday, 7 May 2015 17:19:53 UTC