Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define how SVG paint server units interact with CSS-inspired fill/stroke sizing properties #167

Open
AmeliaBR opened this issue Jun 20, 2016 · 5 comments

Comments

@AmeliaBR
Copy link
Contributor

E.g., if you have objectBoundingBox units versus userSpaceOnUse units, how are those resolved if you also have the new CSS background-image inspired properties in the fill/stroke property.

@tabatkins
Copy link
Member

Are you talking about what's defined in https://drafts.csswg.org/css-images-4/#paint-sources?

@AmeliaBR
Copy link
Contributor Author

AmeliaBR commented Jun 21, 2016

@tabatkins Yep, pretty much. Didn't know that was in a spec.

But now I'm concerned that the definition you have in CSS Images for userSpaceOnUse isn't consistent with how SVG gradients work. It is mostly consistent with SVG patterns: the origin gets reset to the pattern tile in which you're painting, but the units don't get scaled. But in gradients, you use the user space origin as well.

Edited to add:

The definition also implies that percentages in patterns would be reset to the pattern tile or mask, which is how it should have been defined in SVG (in my opinion), but is not how it currently works.

The definition is also not clear about which coordinate system is used to determine the value of 1 CSS px. SVG spec is clear that it should be the "on use" coordinate system (i.e., the coordinate system of the shape being painted), but Firefox is currently the only major browser to do that correctly.

@AmeliaBR
Copy link
Contributor Author

AmeliaBR commented Jun 21, 2016

Given that SVG 2 no longer includes CSS images in paint & the sizing parameters that go with them (see #168), this is not a SVG 2 / CR issue; labels corrected accordingly.

It still needs to be resolved for the new fill / stroke paint spec (PS @tabatkins, have we got a stable link for that? Not text decoration, something of its own.). The same issues also come up in most of the FX specs that use SVG graphics effects elements: mask, clipPath, filter all need more clearly defined interactions between SVG sizing and CSS sizing.

@tabatkins
Copy link
Member

But now I'm concerned that the definition you have in CSS Images for userSpaceOnUse isn't consistent with how SVG gradients work. It is mostly consistent with SVG patterns: the origin gets reset to the pattern tile in which you're painting, but the units don't get scaled. But in gradients, you use the user space origin as well.

Right, those definitions are for paint servers used in CSS properties, where images intentionally don't control their own origin. I guess it's not as useful to SVG's own properties, tho we need to resolve the contradiction for the fill/stroke properties that we want to share between SVG and CSS.

@tabatkins
Copy link
Member

It still needs to be resolved for the new fill / stroke paint spec (PS @tabatkins, have we got a stable link for that? Not text decoration, something of its own.).

I don't understand what you mean by "not text decoration", but the current draft from fantasai and I (still experimental) is https://drafts.csswg.org/css-text-decor-4/.

@boggydigital boggydigital added this to the SVG 2.1 Working Draft milestone Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants