w3c / w3c/csswg-drafts

[css-transforms] `transform-box:stroke-box` with `vector-effect:non-scaling-stroke` creates a cyclical dependency

Open
#9,640 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Closed Accepted by CSSWG Resolution css-transforms-1 motion-1 Needs Edits
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

A cyclical dependency can be created if transform-box:stroke and vector-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 for border-box is stroke-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 has transform-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 of stroke-box (or border-box) if the element has vector-effect:non-scaling-stroke. (Probably regardless of whether it has a transform that contains percentage values, just to make implementation reasonable.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked CSS Transforms Level 1 transform-box definition and the SVG2 Vector Effects section first, then review the issue's explanation of the dependency between stroke bounds and percentage transforms. Done means reaching and documenting an agreed specification rule that resolves this interaction without the cyclical dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.