[webkit-changes] [WebKit/WebKit] fc94bf: [CSS-Typed-OM] Fix reification of calc() operation...

Chris Dumez noreply at github.com
Fri Dec 9 10:30:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fc94bf07f09bb331986f4023959baaa06bbd5dfc
      https://github.com/WebKit/WebKit/commit/fc94bf07f09bb331986f4023959baaa06bbd5dfc
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-12-09 (Fri, 09 Dec 2022)

  Changed paths:
    A LayoutTests/http/wpt/css/css-typed-om/parse-calc-expressions-expected.txt
    A LayoutTests/http/wpt/css/css-typed-om/parse-calc-expressions.html
    M LayoutTests/platform/win/TestExpectations
    M Source/WebCore/css/typedom/CSSNumericValue.cpp

  Log Message:
  -----------
  [CSS-Typed-OM] Fix reification of calc() operations with more than 2 operands
https://bugs.webkit.org/show_bug.cgi?id=248962

Reviewed by Antoine Quint.

The logic inside reifyMathExpression() was assuming that our
CSSCalcExpressionNodes were part of a binary tree and trying to convert
the structure into a n-ary tree. As a result, we would drop operands when
there are more than 2 present.

This patch simplifies the logic since we don't need to convert the tree
structure and since our internal representation of calc() expressions is
already simplified. This fixes the issue where we would drop operands
when more than 2 are present.

* LayoutTests/http/wpt/css/css-typed-om/parse-calc-expressions-expected.txt: Added.
* LayoutTests/http/wpt/css/css-typed-om/parse-calc-expressions.html: Added.
* Source/WebCore/css/typedom/CSSNumericValue.cpp:
(WebCore::reifyMathExpression):
(WebCore::canonicalOperator): Deleted.
(WebCore::canCombineNodes): Deleted.

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




More information about the webkit-changes mailing list