Bug 229775

Summary: Implement atan, acos, asin, atan2 calc functions
Product: WebKit Reporter: Nikos Mouchtaris <nmouchtaris>
Component: New BugsAssignee: Nikos Mouchtaris <nmouchtaris>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jonlee, macpherson, menard, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
simon.fraser: review+
asin,acos,atan,atan2
none
inverse trig functions
none
inverse trig functions
none
inverse trig functions none

Description Nikos Mouchtaris 2021-09-01 16:06:28 PDT
Implement atan, acos, asin, atan2 calc functions
Comment 1 Nikos Mouchtaris 2021-09-01 16:08:03 PDT
Created attachment 437076 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-09-07 13:43:03 PDT
<rdar://problem/82837327>
Comment 3 Nikos Mouchtaris 2021-09-15 12:41:38 PDT
Created attachment 438279 [details]
Patch
Comment 4 EWS Watchlist 2021-09-15 12:42:30 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 5 Nikos Mouchtaris 2021-09-15 15:32:57 PDT
Created attachment 438298 [details]
Patch
Comment 6 Nikos Mouchtaris 2021-09-15 15:58:19 PDT
Created attachment 438299 [details]
Patch
Comment 7 Simon Fraser (smfr) 2021-09-15 16:59:28 PDT
Comment on attachment 438299 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438299&action=review

> Source/WebCore/ChangeLog:8
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Tests: imported/w3c/web-platform-tests/css/css-values/acos-asin-atan-atan2-computed.html

Words here please (like a spec link etc).

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:490
> +
>  

Too many blank lines.

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:-441
> -        return;

Is this removal significant?

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:630
> +        auto newChild = CSSCalcPrimitiveValueNode::create(CSSPrimitiveValue::create(resolvedValue, CSSUnitType::CSS_DEG));

Is it CSS_DEG because the spec says that degrees are the canonical angle unit?

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:1133
> +        return rad2deg(std::asin(children[0]));

Maybe link to the part of the spec that explains why returning angles in degrees is correct.

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:1138
> +        return rad2deg(std::asin(children[0]));

acts, not asin? Why did tests not catch this.

> Source/WebCore/css/calc/CSSCalcOperationNode.cpp:1143
> +        return rad2deg(std::asin(children[0]));

asin -> atan? Again, where is the test coverage.
Comment 8 Nikos Mouchtaris 2021-09-20 20:04:01 PDT
Created attachment 438772 [details]
asin,acos,atan,atan2
Comment 9 Nikos Mouchtaris 2021-09-21 13:03:51 PDT
Created attachment 438846 [details]
inverse trig functions
Comment 10 Nikos Mouchtaris 2021-09-21 13:58:10 PDT
Created attachment 438855 [details]
inverse trig functions
Comment 11 Nikos Mouchtaris 2021-09-21 15:07:13 PDT
Created attachment 438863 [details]
inverse trig functions
Comment 12 EWS 2021-09-23 15:01:24 PDT
Committed r283013 (242078@main): <https://commits.webkit.org/242078@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438863 [details].