[webkit-changes] [WebKit/WebKit] 29ee9a: [CSS Math Functions] Correctly serialize mod/rem/c...

Tim Nguyen noreply at github.com
Sat Jul 8 18:34:35 PDT 2023


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

  Changed paths:
    M LayoutTests/fast/css/calc-parsing-expected.txt
    M LayoutTests/fast/css/calc-parsing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize.html
    M Source/WebCore/css/calc/CSSCalcOperationNode.h

  Log Message:
  -----------
  [CSS Math Functions] Correctly serialize mod/rem/clamp root nodes
https://bugs.webkit.org/show_bug.cgi?id=259020
rdar://111960904

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 mod/rem/clamp, e.g. clamp(1px, 2px, 3px) now gives calc(2px) instead of clamp(1px, 2px, 3px).
This is consistent with calc(clamp(1px, 2px, 3px)) being serialized as calc(2px).

* LayoutTests/fast/css/calc-parsing-expected.txt:
* LayoutTests/fast/css/calc-parsing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-mod-rem-serialize.html:
* Source/WebCore/css/calc/CSSCalcOperationNode.h:

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




More information about the webkit-changes mailing list