-
Notifications
You must be signed in to change notification settings - Fork 659
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-transforms] transform-box:stroke-box
with vector-effect:non-scaling-stroke
creates a cyclical dependency
#9640
Comments
This also applies to offset: ray when combined with non-scaling-stroke. |
Yes. This may have impact on any CSS property which uses |
That solution (with |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> emilio: Several transform-related things<fantasai> emilio: You end up in a circular dependency where you need the containing transform <fantasai> emilio: What we did for now is what was suggested, which was if you set transform-box: stroke-box, we use the fill-box if you have non-scaling stroke <fantasai> emilio: other solutions welcome <fantasai> TabAtkins: [relays ChrisL's comment] <fantasai> https://github.com//issues/9640#issuecomment-1905952267 <fantasai> emilio: In situations where computing a transform-box specified as stroke-box creates a cyclical dependency, use fill-box instead <fantasai> TabAtkins: if you set `transform-box: stroke-box` and don't use percentages, then you don't have a dependency <fantasai> TabAtkins: but we want to do this computation fix even if those observable things <fantasai> emilio: Let's do it always <dbaron> emilio: you could see it through transform-origin <fantasai> dbaron: I don't think you want the cyclical wording into the spec, you want to detail the cases in the spec <fantasai> dholbert: Isn't it just the `vector-effect: non-scaling-stroke` case? <fantasai> dbaron: any dependency on descendants? <fantasai> dholbert: no <fantasai> TabAtkins: also affects offset property <dbaron> s/also affects/this should apply to other things that use stroke-box on the element, such as the/ <fantasai> PROPOSED: If the specified tranform-box is stroke-box and the element has non-scaling-stroke, then the used transform-box is fill-box. <fantasai> emilio: I think this also applies to the border-box value <fantasai> PROPOSED: If the tranform-box is stroke-box and the element has non-scaling-stroke, then the used transform-box is fill-box. <fantasai> RESOLVED: If the tranform-box is stroke-box and the element has non-scaling-stroke, then the used transform-box is fill-box. |
…-stroke. While we are computing the transform-box:stroke-box, for CSS Transforms or Motion path Transforms, we have to avoid the cyclic dependency not only for the SVG geometry frame itself, but also for the desendants of the SVG container frame. Therefore, we just compute its fill-box (i.e. make |getStroke| be false). w3c/csswg-drafts#9640 Differential Revision: https://phabricator.services.mozilla.com/D203184 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870200 gecko-commit: ec44194caefb41931247d18ad886326cf6d89a93 gecko-reviewers: emilio
…es non-scaling-stroke. r=emilio While we are computing the transform-box:stroke-box, for CSS Transforms or Motion path Transforms, we have to avoid the cyclic dependency not only for the SVG geometry frame itself, but also for the desendants of the SVG container frame. Therefore, we just compute its fill-box (i.e. make |getStroke| be false). w3c/csswg-drafts#9640 Differential Revision: https://phabricator.services.mozilla.com/D203184
…es non-scaling-stroke. r=emilio While we are computing the transform-box:stroke-box, for CSS Transforms or Motion path Transforms, we have to avoid the cyclic dependency not only for the SVG geometry frame itself, but also for the desendants of the SVG container frame. Therefore, we just compute its fill-box (i.e. make |getStroke| be false). w3c/csswg-drafts#9640 Differential Revision: https://phabricator.services.mozilla.com/D203184
…-stroke. While we are computing the transform-box:stroke-box, for CSS Transforms or Motion path Transforms, we have to avoid the cyclic dependency not only for the SVG geometry frame itself, but also for the desendants of the SVG container frame. Therefore, we just compute its fill-box (i.e. make |getStroke| be false). w3c/csswg-drafts#9640 Differential Revision: https://phabricator.services.mozilla.com/D203184 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870200 gecko-commit: ec44194caefb41931247d18ad886326cf6d89a93 gecko-reviewers: emilio
…-stroke. While we are computing the transform-box:stroke-box, for CSS Transforms or Motion path Transforms, we have to avoid the cyclic dependency not only for the SVG geometry frame itself, but also for the desendants of the SVG container frame. Therefore, we just compute its fill-box (i.e. make |getStroke| be false). w3c/csswg-drafts#9640 Differential Revision: https://phabricator.services.mozilla.com/D203184 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870200 gecko-commit: ec44194caefb41931247d18ad886326cf6d89a93 gecko-reviewers: emilio
A cyclical dependency can be created if
transform-box:stroke
andvector-effect:non-scaling-stroke
are both used on the same stroked SVG element. (And by implication,transform-box:border-box
too, since the spec says "For SVG elements ... the used value forborder-box
isstroke-box
.")To calculate the stroke bounds of an element with
vector-effect:non-scaling-stroke
we need to resolve the transform to the element's outer-<svg>
, but to resolve that transform when the element hastransform-box:stroke-box
requires the element's stroke bounds if the transform contains percentage values.I don't think there's an ideal way to break this cyclical dependency, but I would suggest breaking it by requiring implementations to use
fill-box
in place ofstroke-box
(orborder-box
) if the element hasvector-effect:non-scaling-stroke
. (Probably regardless of whether it has a transform that contains percentage values, just to make implementation reasonable.)The text was updated successfully, but these errors were encountered: