Bug 231044

Summary: Allow NaN, infinity, and -infinity in calc
Product: WebKit Reporter: Nikos Mouchtaris <nmouchtaris>
Component: New BugsAssignee: 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 Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
simon.fraser: review+, ews-feeder: commit-queue-
infinity none

Nikos Mouchtaris
Reported 2021-09-30 16:24:39 PDT
Allow NaN, infinity, and -infinity in calc
Attachments
Patch (21.50 KB, patch)
2021-09-30 16:32 PDT, Nikos Mouchtaris
no flags
Patch (24.32 KB, patch)
2021-10-01 14:13 PDT, Nikos Mouchtaris
no flags
Patch (27.00 KB, patch)
2021-10-01 14:56 PDT, Nikos Mouchtaris
no flags
Patch (29.85 KB, patch)
2021-10-01 15:02 PDT, Nikos Mouchtaris
no flags
Patch (30.56 KB, patch)
2021-10-01 16:10 PDT, Nikos Mouchtaris
simon.fraser: review+
ews-feeder: commit-queue-
infinity (39.09 KB, patch)
2021-10-01 18:54 PDT, Nikos Mouchtaris
no flags
Nikos Mouchtaris
Comment 1 2021-09-30 16:32:37 PDT
Radar WebKit Bug Importer
Comment 2 2021-10-01 10:32:32 PDT
Nikos Mouchtaris
Comment 3 2021-10-01 14:13:17 PDT
EWS Watchlist
Comment 4 2021-10-01 14:14:43 PDT
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
Nikos Mouchtaris
Comment 5 2021-10-01 14:56:42 PDT
Nikos Mouchtaris
Comment 6 2021-10-01 15:02:57 PDT
Simon Fraser (smfr)
Comment 7 2021-10-01 15:17:35 PDT
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.
Simon Fraser (smfr)
Comment 8 2021-10-01 15:29:57 PDT
Comment on attachment 439915 [details] Patch r- for the -infinity confusion
Nikos Mouchtaris
Comment 9 2021-10-01 16:10:16 PDT
Simon Fraser (smfr)
Comment 10 2021-10-01 16:14:43 PDT
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() }, };
Nikos Mouchtaris
Comment 11 2021-10-01 18:54:01 PDT
Created attachment 439947 [details] infinity
EWS
Comment 12 2021-10-01 23:23:04 PDT
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].
Tim Nguyen (:ntim)
Comment 13 2021-11-07 01:38:16 PST
*** Bug 219832 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.