Re: transform attribute in <svg> element allowed?

 According to that spec, a glyph is a standalone SVG document so CSS transforms should not apply to the outer <svg> element.


1: https://www.w3.org/TR/svg-integration/#secure-animated-mode


________________________________
From: Sairus Patel
Sent: Monday, March 21, 2016 4:23 PM
To: Rik Cabanier; Behdad Esfahbod; public-svgopentype@w3.org
Subject: Re: transform attribute in <svg> element allowed?

Hi Rik,

> The question is: do SVG glyphs behave like standalone documents or embedded ones?

https://www.w3.org/TR/svg-integration/ defines SVG-in-OT glyphs as a “font document” referencing mode. There is a specific UA style sheet whereby certain properties like “fill” are passed to the SVG UA handling the glyph descriptions.
SVG Integration - w3.org<https://www.w3.org/TR/svg-integration>
www.w3.org
2. Referencing modes. There are various ways that an SVG document fragment can be referenced by or included in other documents and then as a consequence be processed ...



Would you consider this an embedded document (not sure if you make a distinction between a referencing mode & embedded document)?

If so, then would your assertion that “all CSS attributes like transforms and overflow apply” for an embedded doc still hold true, given the above link?

Thanks,
Sairus

From: Rik Cabanier <cabanier@adobe.com<mailto:cabanier@adobe.com>>
Date: Saturday, March 19, 2016 at 11:58 AM
To: Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>>, Behdad Esfahbod <behdad@google.com<mailto:behdad@google.com>>, "public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>" <public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>>
Subject: Re: transform attribute in <svg> element allowed?


Hi Sairus,


you've stumbled into a weirdness between SVG as an embedded document and as a standalone one.


In the case of an SVG embedded as a document, the outer <svg> element is a hybrid svg and HTML element. As such, all CSS attributes like transforms and overflow apply. The SVG working group also decided the SVG transforms correspond to CSS transforms for elements in the SVG namespace (of which <svg> belongs [1]).


However, it is *not* decided how the <svg> element behaves in a standalone document (ie an SVG linked through the <img> tag)

For a standalone document <svg> establishes the initial viewport. It doesn't really make sense to transform a viewport so in that case, it should be ignored.


The question is: do SVG glyphs behave like standalone documents or embedded ones?


1: https://html.spec.whatwg.org/multipage/embedded-content.html#svg-0


________________________________
From: Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>>
Sent: Friday, March 18, 2016 5:48 PM
To: Behdad Esfahbod; public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>
Subject: Re: transform attribute in <svg> element allowed?

https://www.w3.org/TR/SVG/extend.html says “The SVG user agent will include unknown attributes in the DOM but with otherwise ignore unknown attributes.” It’s not clear to me whether this only applies to attributes from foreign namespaces mentioned earlier on in that paragraph, or to other attributes, including those known to the UA even if only for a different version of the SVG.
Extensibility – SVG 1.1 (Second Edition)<https://www.w3.org/TR/SVG/extend.html>
www.w3.org
23 Extensibility Contents. 23.1 Foreign namespaces and private data; 23.2 Embedding foreign object types; 23.3 The ‘foreignObject’ element; 23.4 An example



My sense is that this means that for SVG 1.1 (or 1.2, as in Bixa’s case) if the transform attribute is used in the svg element, then that attribute should be simply ignored by the SVG UA, and that information about that little encounter shouldn’t be passed up the stack as some warning or error code to the “SVG integration” context, in this case, OpenType.

It would be good to know the formal SVG spec “answer” to this before I approach Firefox about it.

Thanks,
Sairus


From: Behdad Esfahbod <behdad@google.com<mailto:behdad@google.com>>
Date: Thursday, March 17, 2016 at 6:06 PM
To: Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>>
Cc: "public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>" <public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>>
Subject: Re: transform attribute in <svg> element allowed?

Please also file bug against firefox, if it is respecting transform on svg for SVG 1.2.

On Thu, Mar 17, 2016 at 5:51 PM, Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>> wrote:

Note that the svg example I gave has svg version="1.2" which I take to mean SVG Tiny 1.2, which does *not* list transform as an svg element attribute: https://www.w3.org/TR/SVGTiny12/single-page.html#struct-SVGElement


While https://validator.w3.org doesn't seem to support validating SVG 1.2, I'd assume that the svg example I gave below is invalid SVG 1.2. I'll file a bug with the font creation tool used.


Thanks for the info, all.


Sairus

________________________________
From: Dirk Schulze
Sent: Thursday, March 17, 2016 3:29 PM
To: Leonard Rosenthol
Cc: Sairus Patel; public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>; Rik Cabanier
Subject: Re: transform attribute in <svg> element allowed?

Just a short note: The transform attribute can be used on SVGElement since CSS Transforms but definitely with the upcoming SVG2 spec. It is not allowed in SVG 1.1 though and browsers did not adapt yet.

Greetings
Dirk

Sent from my iPhone

On Mar 17, 2016, at 11:24 PM, Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>> wrote:

[Adding Rik and Dirk]

My personal opinion would be that since transform() is not permitted on the SVG element, that the glyph description in question is illegal and how it would be rendered is therefore undefined. (absent some standardized error handling for glyph rendering in fonts).

Leonard

From: Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>>
Date: Thursday, March 17, 2016 at 6:15 PM
To: "public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>" <public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>>
Subject: transform attribute in <svg> element allowed?
Resent-From: "public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>" <public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>>
Resent-Date: Thursday, March 17, 2016 at 6:16 PM


A couple of SVG-in-OT fonts use the transform attribute in the <svg> element: Bixa Color https://bixacolor.com/, just released last week, and Gecko Emoji http://people.mozilla.org/~jkew/opentype-svg/GeckoEmoji.html.

https://www.w3.org/TR/SVG/struct.html#SVGElement, however, doesn't include transform in the list of allowable attributes in the <svg> element.

The font still "works" in Firefox, but if you extract a glyph's svg doc from the 'SVG ' table and display it in Chrome, IE, or Safari as a standalone graphic, it will show as being inverted (flipped upside down).

Could someone please confirm that this interpretation is correct, and that there is no "story" to keep in mind around this such as a move to allow transform in the svg element in the future?

FYI, here is the code for Bixa’s glyph B (with Roel Nieskens’ permission):

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" enable-background="new 55 25 555 775" id="glyph37" transform="scale(1,-1)">
<path fill="#ED0088"  d="M377 25 C414 88 433 164 433 250 C433 291 399 325 358 325 L305 325 L305 362 C326 374 347 384 369 392 C401 403 405 526 405 550 C405 591 371 625 330 625 L306 625 C312 681 328 730 352 771 C440 753 506 670 506 579 C506 429 425 417 425 417 C425 417 555 435 555 253 C555 120 482 32 377 25 L377 25 L377 25 Z " />
<path fill="#00AFE9"  d="M80 175 C121 175 155 209 155 250 L155 550 C155 591 121 625 80 625 L55 625 L55 775 L297 775 C269 718 253 650 254 575 C255 536 248 475 305 475 L330 475 C337 475 343 476 350 478 C347 463 344 448 341 435 C322 427 255 403 255 377 L255 225 C255 198 278 175 305 175 L358 175 C365 175 371 176 378 178 C368 117 347 66 316 25 L55 25 L55 175 L80 175 L80 175 Z " />
<path fill="#30328C"  d="M456 579 C456 568 455 557 455 547 L455 550 C456 619 399 675 330 675 L305 675 C250 675 205 630 205 575 L205 550 C205 610 162 661 105 672 L105 725 L315 725 C392 725 456 657 456 579 L456 579 L456 579 Z M505 253 C505 134 441 75 364 75 L105 75 L105 128 C162 139 205 190 205 250 L205 225 C205 170 250 125 305 125 L358 125 C427 125 483 181 483 250 C483 319 427 375 358 375 L305 375 C250 375 205 330 205 275 L205 525 C205 470 248 429 303 429 C395 429 505 413 505 253 L505 253 L505 253 Z " />
</svg>

Thanks,

Sairus

Received on Tuesday, 22 March 2016 02:42:07 UTC