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

[css-compositing] Clarify what "SVG" and "SVG element" refer to in "3.3 Behavior specific to SVG" #403

Open
wangxianzhu opened this issue Aug 24, 2020 · 2 comments

Comments

@wangxianzhu
Copy link

https://drafts.fxtf.org/compositing-1/#csscompositingrules_SVG

It's not clear what "SVG" and "SVG element" refer to. Chrome interprets "SVG" as "SVG document" and "SVG element" as "SVG document element", so an embedded SVG doesn't create a isolated group by default. Firefox seems to interpret them differently.

In Chrome (86), the box is black, while in Firefox (68.11.0esr) it's yellow.

@chrishtr
Copy link
Contributor

chrishtr commented Sep 4, 2020

The example referenced above is:

https://output.jsbin.com/suzolaq

@chrishtr
Copy link
Contributor

chrishtr commented Sep 4, 2020

SVG elements paint atomically, so they are similar to stacking contexts in that respect. However, they are perhaps even more like replaced elements, in that they paint atomically but don't paint-as-if stacked (see here for more research into that latter concept). Replaced elements generally paint as foreign objects/documents embedded within a parent document. Under either the "stacking context" or "replaced element" reasoning, we would conclude that an SVG element should create an isolated group.

However, there may be use cases where developers want to blend SVG with the parent content, and forcing the SVG element to be an isolated group would disallow that, without a clear benefit that I can see other than possibly reducing developer confusion (though I don't know of any examples of this confusion right now). If the developer desires an isolated group, it's easy to add with isolation: isolate: http://output.jsbin.com/suzolaq/2. In addition, Chromium and WebKit browsers agree on this particular behavior.

I conclude that we should edit the spec to clarify that embedded SVG elements within an HTML document do not by themselves create an isolated group.

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