<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>263000</bug_id>
          
          <creation_ts>2023-10-10 21:18:25 -0700</creation_ts>
          <short_desc>Trig function sometimes requires calc() wrapper to work</short_desc>
          <delta_ts>2023-10-11 04:23:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>Safari 16</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jane Ori">janeori</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1984215</commentid>
    <comment_count>0</comment_count>
    <who name="Jane Ori">janeori</who>
    <bug_when>2023-10-10 21:18:25 -0700</bug_when>
    <thetext>I am unsure of why or what causes this to happen, but I have a reduced test case where calc() must be wrapped around a tan() call to work in Safari

https://codepen.io/propjockey/pen/Jjwwwmo?editors=1100

The screen size will be shown in the preview, though it only shows 0 x 0 in Safari (this works in Chrome)

If you replace lines 10 and 11 of the css panel with the same code wrapped in calc():

```
  --px-width: calc(tan(atan2(var(--100vw), 1px)));
  --px-height: calc(tan(atan2(var(--100vh), 1px)));
```

then the values will begin working as expected.

No matter what values are passed into atan2() on lines 10 and 11, whether it has units or not, the tan() result is always 0 until it&apos;s wrapped in calc

Thank you for your time!
// Jane</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984217</commentid>
    <comment_count>1</comment_count>
    <who name="Jane Ori">janeori</who>
    <bug_when>2023-10-10 21:40:44 -0700</bug_when>
    <thetext>Here is a better reduction of the test case

https://codepen.io/propjockey/pen/rNoRayv/ccd8e39e0c5cf9c71007a76c643ef40c?editors=0100</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984264</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-11 04:23:28 -0700</bug_when>
    <thetext>(In reply to Jane Ori from comment #1)
&gt; Here is a better reduction of the test case
&gt; 
&gt; https://codepen.io/propjockey/pen/rNoRayv/
&gt; ccd8e39e0c5cf9c71007a76c643ef40c?editors=0100

It works in Safari Technology Preview 180. So it is already fixed upstream and both show &apos;100 100&apos; rather than &apos;0 100&apos; in Safari 17.

Marking this as &apos;RESOLVED CONFIGURATION CHANGED&apos;.

Appreciate if someone can mark and add relevant commit for reference.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>