Skip to content

Commit

Permalink
Break the cyclic dependency if any of the desendants uses non-scaling…
Browse files Browse the repository at this point in the history
…-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
  • Loading branch information
BorisChiou authored and BruceDai committed Mar 25, 2024
1 parent 5ad5bbe commit 48714e9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions css/css-transforms/transform-box/svgbox-stroke-box-005.html
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<title>transform-box: border-box, stroke with vector-effect: non-scaling-stroke</title>
<link rel="match" href="reference/svgbox-rect-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box">
<link rel="help" href="https://svgwg.org/svg2-draft/coords.html#VectorEffects">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9640">
<meta name="assert" content="The used value of transform-box is fill-box on SVG with non-scaling-stroke"/>
<style>
#container {
fill: green;
stroke: black;
stroke-width: 20;
transform-box: border-box;
transform: scale(0.5) translateY(-100%);
}
#inner {
vector-effect: non-scaling-stroke;
}
</style>
<svg width="400" height="300">
<a id="container">
<rect id="inner" width="100" height="200" x="50" y="180"/>
</a>
</svg>

0 comments on commit 48714e9

Please sign in to comment.