[Webkit-unassigned] [Bug 242629] New: atan2 behaves incorrectly with different units

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 11 19:54:00 PDT 2022


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

            Bug ID: 242629
           Summary: atan2 behaves incorrectly with different units
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: govett at adobe.com

The atan2 function in CSS accepts dimensions, percentages, or numbers as inputs as long as the two arguments have the same type. However, the matching type doesn't mean the values are of the same units. As discussed in https://github.com/w3c/csswg-drafts/issues/7482, WebKit's current implementation behaves incorrectly when the units differ.

For example, currently the following behave identically:

```
rotate: atan2(90px, 90px);
rotate: atan2(90px, 90vw);
```

However, `90vw` should be resolved at computed value time and used rather than ignoring the unit completely. The same is true for examples like the following, where a computation includes incompatible units:

```
rotate: atan2(90px, 10px + 10vw);
```

Currently, WebKit ignores the 10vw completely here, and behaves the same as atan2(90px, 10px). The computation should be resolved and the result should be based on whatever 10px + 10vw computes to.

The current tests in web platform tests don't include any examples of differing units, but probably should.

Here's a codepen where you can see how WebKit currently renders some examples. https://codepen.io/devongovett/pen/GRxqNYj

-- 
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/20220712/d43902ce/attachment.htm>


More information about the webkit-unassigned mailing list