[webkit-changes] [WebKit/WebKit] b6f7bf: [CSS Math Functions] calc(clamp(1px, 1em, 1vh)) sh...

Tim Nguyen noreply at github.com
Sun Sep 10 03:50:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b6f7bf8e3ed03ab92f544f0ffd6aa2bbb26860dc
      https://github.com/WebKit/WebKit/commit/b6f7bf8e3ed03ab92f544f0ffd6aa2bbb26860dc
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-09-10 (Sun, 10 Sep 2023)

  Changed paths:
    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 Source/WebCore/css/calc/CSSCalcOperationNode.cpp

  Log Message:
  -----------
  [CSS Math Functions] calc(clamp(1px, 1em, 1vh)) should collapse to clamp(1px, 1em, 1vh)
https://bugs.webkit.org/show_bug.cgi?id=261383
rdar://115240159

Reviewed by Cameron McCormack.

In the typical case, this type of function would collapse to `calc([X]px)` from having the children combined and resolved, however in this specific case,
clamp(1px, 1em, 1vh) has children that cannot resolved at parse-time (due to the mix of relative units).

In this case, the simplest form is without the `calc`, so we combine the calc with the only child.

* 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:
* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::simplifyNode):

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




More information about the webkit-changes mailing list