| Summary: | Allow NaN, infinity, and -infinity in calc | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Nikos Mouchtaris <nmouchtaris> | ||||||||||||||
| Component: | New Bugs | Assignee: | Nikos Mouchtaris <nmouchtaris> | ||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||
| Severity: | Normal | CC: | clopez, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jonlee, macpherson, menard, seokho, simon.fraser, webkit-bug-importer, youennf | ||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||
| OS: | Unspecified | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Nikos Mouchtaris
2021-09-30 16:24:39 PDT
Created attachment 439792 [details]
Patch
Created attachment 439910 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Created attachment 439914 [details]
Patch
Created attachment 439915 [details]
Patch
Comment on attachment 439915 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439915&action=review > Source/WebCore/css/CSSPrimitiveValue.cpp:955 > + if (m_value.num == -1*std::numeric_limits<double>::infinity()) Spaces around * > Source/WebCore/css/CSSValueKeywords.in:1369 > +INFINITY Why is this capitalized? > Source/WebCore/css/calc/CSSCalcExpressionNodeParser.cpp:100 > + return { { CSSValuePi, CSSUnitType::CSS_NUMBER, piDouble }, { CSSValueE, CSSUnitType::CSS_NUMBER, std::exp(1.0) }, { CSSValueInfinity, CSSUnitType::CSS_NUMBER, -1*std::numeric_limits<double>::infinity() }, { CSSValueINFINITY, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::infinity() }, { CSSValueNaN, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::quiet_NaN() } }; This need wrapping. CSSValueINFINITY is ugly. Comment on attachment 439915 [details]
Patch
r- for the -infinity confusion
Created attachment 439924 [details]
Patch
Comment on attachment 439924 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439924&action=review > Source/WebCore/css/calc/CSSCalcExpressionNodeParser.cpp:103 > + return { { CSSValuePi, CSSUnitType::CSS_NUMBER, piDouble }, { CSSValueE, CSSUnitType::CSS_NUMBER, std::exp(1.0) }, > + { CSSValueNegativeInfinity, CSSUnitType::CSS_NUMBER, -1 * std::numeric_limits<double>::infinity() }, > + { CSSValueInfinity, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::infinity() }, > + { CSSValueNaN, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::quiet_NaN() } }; I would wrap this like: return { { CSSValuePi, CSSUnitType::CSS_NUMBER, piDouble }, { CSSValueE, CSSUnitType::CSS_NUMBER, std::exp(1.0) }, { CSSValueNegativeInfinity, CSSUnitType::CSS_NUMBER, -1 * std::numeric_limits<double>::infinity() }, { CSSValueInfinity, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::infinity() }, { CSSValueNaN, CSSUnitType::CSS_NUMBER, std::numeric_limits<double>::quiet_NaN() }, }; Created attachment 439947 [details]
infinity
Committed r283434 (242421@main): <https://commits.webkit.org/242421@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 439947 [details]. *** Bug 219832 has been marked as a duplicate of this bug. *** |