[webkit-changes] [WebKit/WebKit] 60b551: [CSS Math Functions] Correctly serialize asin/acos...

Tim Nguyen noreply at github.com
Sat Jul 8 18:12:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 60b5513a6168389918df61bca25ee20111627395
      https://github.com/WebKit/WebKit/commit/60b5513a6168389918df61bca25ee20111627395
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-07-08 (Sat, 08 Jul 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/acos-asin-atan-atan2-serialize-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/acos-asin-atan-atan2-serialize.html
    M Source/WebCore/css/calc/CSSCalcOperationNode.h

  Log Message:
  -----------
  [CSS Math Functions] Correctly serialize asin/acos/atan/atan2 root nodes
https://bugs.webkit.org/show_bug.cgi?id=259019
rdar://111960627

Reviewed by Darin Adler.

>From the spec https://drafts.csswg.org/css-values-4/#calc-simplification:

> If root is an operator node that’s not one of the calc-operator nodes, and all of its calculation children are numeric values with enough information to compute the operation root represents, return the result of running root’s operation using its children, expressed in the result’s canonical unit.

We now always try to resolve the top-level asin/acos/atan/atan2, e.g. acos(0) now gives calc(0deg) instead of acos(0).
This is consistent with calc(acos(0)) being serialized as calc(0deg).

* LayoutTests/imported/w3c/web-platform-tests/css/css-values/acos-asin-atan-atan2-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/acos-asin-atan-atan2-serialize.html:
* Source/WebCore/css/calc/CSSCalcOperationNode.h:

Canonical link: https://commits.webkit.org/265885@main




More information about the webkit-changes mailing list