-
Notifications
You must be signed in to change notification settings - Fork 715
containment probably shouldn't apply to most SVG elements #2987
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
Comments
At the moment SVG elements don't generate any boxes at all, as they're not defined to interact with the CSS box model in any way, besides the outermost SVG in an HTML document. |
What about a |
The |
You can't have an Ideally, the foreignObject would provide a fixed-height containing block (most browsers do not currently treat it as if it had a fixed height, so you can't set Basically, a More generally, see @tabatkins's comment on the filter / containing block issue:
|
Focusing on the original issue, containment: The For other SVG elements on which For other SVG elements, which don't have boxes other than those defined by their contents or drawing commands, containment doesn't make sense without a lot of special definitions.. |
So it seems like the right thing to implement is that containment should apply to outer (Note that for containment to make sense, it needs to be clear what it means for an element to establish a containing block for absolutely positioned and fixed positioned elements; see w3c/fxtf-drafts#307.) |
…er frames support contain:layout and contain:paint. r=dholbert This is needed for patch 4. This is based both on the wording in the spec and the discussion in w3c/csswg-drafts#2987, and also doesn't support them for nsMathMLContainerFrame, which is similar to inlines and ruby. Differential Revision: https://phabricator.services.mozilla.com/D2815 --HG-- extra : rebase_source : b7e23fb248fa34957ca2d539134e872f5a03f5a8
…er frames support contain:layout and contain:paint. r=dholbert This is needed for patch 4. This is based both on the wording in the spec and the discussion in w3c/csswg-drafts#2987, and also doesn't support them for nsMathMLContainerFrame, which is similar to inlines and ruby. Differential Revision: https://phabricator.services.mozilla.com/D2815
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: containment probably shouldn't apply to most SVG elements<dael> github: https://github.com//issues/2987 <dael> florian: Looking to raise attention and get a consentual answer. Last issue on containment. <dael> florian: Seemed dbaron and ameliabr were getting somewhere <dael> chrishtr: Agree with dbaron on outer svg and nothing else <dael> florian: Can we say that or need to be more specific? <dael> dbaron: I think applying to outer SVG is pretty straight forward <dael> astearns: Don't have ameliabr on the call. Shall we resolve on outer SVG and ask Amelia? <dael> chris: I think there's agreement on outer SVG. And it's what's outside foreign object. TabAtkins is correct foreign object est containing block but that's all it does. <dael> Rossen_: eq. of iframe basically <dael> astearns: Prop: containment should apply to outer SVG but nothing else in SVG <dael> astearns: Obj? <chris> +1 to proposed resolution <dael> RESOLVED: containment should apply to outer SVG but nothing else in SVG <dael> astearns: I'll tag ameliabr for review <dael> florian: I expect next call to have spec ready for CR. Thanks to Gerard for the test suite |
@AmeliaBR please let us know if you're good with the resolution above |
Sorry I missed the discussion. I agree that the "outer" SVG should support the containment properties. The wording should be something like "an As selectors, that looks like: @namespace svgns url(http://www.w3.org/2000/svg);
svg:root, /* root svg, starts an SVG canvas */
:not(svgns|*) > svg, /* svg that is a child of a non-SVG namespace element, also starts a canvas */
foreignObject > svg /* a new SVG canvas inside a foreignObject */
{ /* containment works */} I still think it would be perfectly sensible for |
Actually, I'm removing the "needs testcase" label here, as there isn't really anything to test. We just defined that the property does not apply to elements where it wouldn't be clear what applying means... It doesn't really seem meaningful to try and test for the lack of effect. If anyone catches a browser accidentally doing something when it should do nothing, we can add tests to wpt to make sure that doesn't happen again, but until then I think no test is needed for this. |
…er frames support contain:layout and contain:paint. r=dholbert This is needed for patch 4. This is based both on the wording in the spec and the discussion in w3c/csswg-drafts#2987, and also doesn't support them for nsMathMLContainerFrame, which is similar to inlines and ruby. Differential Revision: https://phabricator.services.mozilla.com/D2815 UltraBlame original commit: 8e24328ba71484dd144b9d0d2fdd287a9327c1b4
…er frames support contain:layout and contain:paint. r=dholbert This is needed for patch 4. This is based both on the wording in the spec and the discussion in w3c/csswg-drafts#2987, and also doesn't support them for nsMathMLContainerFrame, which is similar to inlines and ruby. Differential Revision: https://phabricator.services.mozilla.com/D2815 UltraBlame original commit: 8e24328ba71484dd144b9d0d2fdd287a9327c1b4
…er frames support contain:layout and contain:paint. r=dholbert This is needed for patch 4. This is based both on the wording in the spec and the discussion in w3c/csswg-drafts#2987, and also doesn't support them for nsMathMLContainerFrame, which is similar to inlines and ruby. Differential Revision: https://phabricator.services.mozilla.com/D2815 UltraBlame original commit: 8e24328ba71484dd144b9d0d2fdd287a9327c1b4
layout, size, and paint containment probably shouldn't apply to SVG elements other than
svg
andforeignObject
. Currently the spec excludes elements that "do not generate a principal box"... but I don't actually see anything in the relevant definitions that says that these SVG elements don't generate a principal box.I think it should be the case that they don't, and therefore that layout, size, and paint containment don't apply, but this ought to be defined. (It's also not 100% clear about things like outer
svg
,svg
within an SVG structure, andforeignObject
.)The text was updated successfully, but these errors were encountered: