[css-typed-om-1][css-syntax-3][css-values-4] Clarify interaction between CSSNumericValue.parse() and `simplify a calculation tree`

Open
#9,870 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
css, javascript
Domain
documentation

Research direction

Start with the CSS Typed OM definitions of parse(cssText) and reify a math expression, then compare them with CSS Values 4's simplify a calculation tree and the cited browser result. Done means the specification clearly states whether and where simplification occurs, including the CSSMathSum behavior.

Written by the indexing model from the issue text.

Description

css-typed-om

Both Blink and Webkit seem to return a simplified value when running CSSNumericValue.parse().

CSSNumericValue.parse('calc(min(1,2,3) * 5px)').toString(); 
// returns calc(5px)

But, reading through parse(cssText) and the procedures it invokes, I can't find any references to Simplify a calculation tree.

It might seem like Simplify a calculation tree is invoked sometime during reify a math expression. The result is always wrapped in a CSSMathSum, even if the simplification results in a single value.)

Should reify a math expression invoke simplify a calculation tree or should it be invoked somewhere else?

I might have missed something reading through the specs. If this is already documented somewhere, I apologize.

Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.