[Webkit-unassigned] [Bug 279714] New: SVG stroke-dasharray does not work with mixed units in calc

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Sep 14 07:40:43 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=279714

            Bug ID: 279714
           Summary: SVG stroke-dasharray does not work with mixed units in
                    calc
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: SVG
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: govett at adobe.com
                CC: sabouhallawa at apple.com, zimmermann at kde.org

When setting `stroke-dasharray` to a `calc` with mixed units (e.g. percentage and pixels), WebKit resolves the whole calculation to 0 instead of the correct result. For example, `stroke-dasharray="calc(2 * pi * (50% - 2px))" could be used to create a dash array that goes around the length of a circle. The circle is 50% of the width, minus 2px to account for the stroke width. This works with just `2 * pi * 50%`, and works with `2 * pi * (50px - 2px)` but as soon as percentages and pixels are mixed it no longer works.

Example: https://codepen.io/devongovett/pen/ZEdNbgE

This works correctly in Chrome and Firefox.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240914/ac0a17af/attachment.htm>


More information about the webkit-unassigned mailing list