Skip to content

Commit 8102aa6

Browse files
Calme1709tabatkins
andauthored
[css-values-4] Properly handle simplification of sum nodes containing negated sum nodes #13020 (#13069)
* [css-values-4] Remove erroneous </a> tag * [css-values-4] Properly handle simplification of sum nodes containing negated sum nodes #13020 A WPT test already exists in the form of css/css-values/calc-nesting-002.html * ws --------- Co-authored-by: Tab Atkins Jr. <jackalmage@gmail.com>
1 parent ed21afd commit 8102aa6

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

css-values-4/Overview.bs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4937,7 +4937,28 @@ Simplification</h4>
49374937
(0 - value).
49384938
2. If |root|'s child is a Negate node,
49394939
return the child's child.
4940-
3. Return |root|.
4940+
3. If |root|'s child is a Sum node:
4941+
4942+
1. Let |negated grandchildren| be an empty list
4943+
4944+
2. For each |grandchild| of the child's children:
4945+
4946+
1. If |grandchild| is a numeric value,
4947+
create an equivalent numeric value,
4948+
but with the value negated
4949+
(0 - value),
4950+
and append the result to |negated grandchildren|.
4951+
4952+
2. If |grandchild| is a Negate node
4953+
append |grandchild|'s child to |negated grandchildren|
4954+
4955+
3. Otherwise,
4956+
create a Negate node with |grandchild| as its child,
4957+
and append the result to |negated grandchildren|
4958+
4959+
3. Return a Sum node with |negated grandchildren| as its children
4960+
4961+
4. Return |root|.
49414962

49424963
7. If |root| is an Invert node:
49434964

0 commit comments

Comments
 (0)