Changeset 291841 in webkit
- Timestamp:
- Mar 24, 2022 6:03:07 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-function-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/calc/CSSCalcOperationNode.cpp (modified) (4 diffs)
-
Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r291830 r291841 1 2022-03-24 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 3 calc(): Handle finite value with infinite step in round() 4 https://bugs.webkit.org/show_bug.cgi?id=238231 5 6 Reviewed by Simon Fraser. 7 8 * web-platform-tests/css/css-values/round-function-expected.txt: 9 1 10 2022-03-24 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/round-function-expected.txt
r283434 r291841 50 50 PASS round(-infinity, 5) should be used-value-equivalent to calc(-infinity) 51 51 PASS round(-infinity, -5) should be used-value-equivalent to calc(-infinity) 52 FAIL calc(1 / round(5, infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(5, infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 53 FAIL calc(1 / round(5, -infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(5, -infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 54 FAIL calc(1 / round(-5, infinity)) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(-5, infinity)) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 55 FAIL calc(1 / round(-5, -infinity)) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(-5, -infinity)) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 56 FAIL calc(1 / round(to-zero, 5, infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(to-zero, 5, infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 57 FAIL calc(1 / round(to-zero, 5, -infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(to-zero, 5, -infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 58 FAIL calc(1 / round(to-zero, -5, infinity)) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(to-zero, -5, infinity)) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 59 FAIL calc(1 / round(to-zero, -5, -infinity)) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(to-zero, -5, -infinity)) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 60 FAIL round(up, 1, infinity) should be used-value-equivalent to calc(infinity) assert_equals: round(up, 1, infinity) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 61 FAIL calc(1 / round(up, 0, infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(up, 0, infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 62 FAIL calc(1 / round(up, -1 * 0, infinity) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(up, -1 * 0, infinity) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 63 FAIL calc(1 / round(up, -1, infinity) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(up, -1, infinity) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 64 FAIL round(down, -1, infinity) should be used-value-equivalent to calc(-infinity) assert_equals: round(down, -1, infinity) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 65 FAIL calc(1 / round(down, -1 * 0, infinity)) should be used-value-equivalent to calc(-infinity) assert_equals: calc(1 / round(down, -1 * 0, infinity)) and calc(-infinity) serialize to the same thing in used values. expected "matrix3d(-infinity, NaN, NaN, NaN, NaN, -infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 66 FAIL calc(1 / round(down, 0, infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(down, 0, infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 67 FAIL calc(1 / round(down, 1, infinity)) should be used-value-equivalent to calc(infinity) assert_equals: calc(1 / round(down, 1, infinity)) and calc(infinity) serialize to the same thing in used values. expected "matrix3d(infinity, NaN, NaN, NaN, NaN, infinity, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" but got "matrix3d(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0, 0, 1, 0, 0, 0, 0, 1)" 52 PASS calc(1 / round(5, infinity)) should be used-value-equivalent to calc(infinity) 53 PASS calc(1 / round(5, -infinity)) should be used-value-equivalent to calc(infinity) 54 PASS calc(1 / round(-5, infinity)) should be used-value-equivalent to calc(-infinity) 55 PASS calc(1 / round(-5, -infinity)) should be used-value-equivalent to calc(-infinity) 56 PASS calc(1 / round(to-zero, 5, infinity)) should be used-value-equivalent to calc(infinity) 57 PASS calc(1 / round(to-zero, 5, -infinity)) should be used-value-equivalent to calc(infinity) 58 PASS calc(1 / round(to-zero, -5, infinity)) should be used-value-equivalent to calc(-infinity) 59 PASS calc(1 / round(to-zero, -5, -infinity)) should be used-value-equivalent to calc(-infinity) 60 PASS round(up, 1, infinity) should be used-value-equivalent to calc(infinity) 61 PASS calc(1 / round(up, 0, infinity)) should be used-value-equivalent to calc(infinity) 62 PASS calc(1 / round(up, -1 * 0, infinity) should be used-value-equivalent to calc(-infinity) 63 PASS calc(1 / round(up, -1, infinity) should be used-value-equivalent to calc(-infinity) 64 PASS round(down, -1, infinity) should be used-value-equivalent to calc(-infinity) 65 PASS calc(1 / round(down, -1 * 0, infinity)) should be used-value-equivalent to calc(-infinity) 66 PASS calc(1 / round(down, 0, infinity)) should be used-value-equivalent to calc(infinity) 67 PASS calc(1 / round(down, 1, infinity)) should be used-value-equivalent to calc(infinity) 68 68 -
trunk/Source/WebCore/ChangeLog
r291837 r291841 1 2022-03-24 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 3 calc(): Handle finite value with infinite step in round() 4 https://bugs.webkit.org/show_bug.cgi?id=238231 5 6 Reviewed by Simon Fraser. 7 8 Add handling for finite value with infinite step in round(). 9 10 * css/calc/CSSCalcOperationNode.cpp: 11 (WebCore::CSSCalcOperationNode::evaluateOperator): 12 * css/calc/CSSCalcPrimitiveValueNode.cpp: 13 (WebCore::CSSCalcPrimitiveValueNode::invert): 14 1 15 2022-03-24 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/css/calc/CSSCalcOperationNode.cpp
r291516 r291841 1428 1428 if (children.size() != 2) 1429 1429 return std::numeric_limits<double>::quiet_NaN(); 1430 if (!isinf(children[0]) && std::isinf(children[1])) { 1431 if (!children[0]) 1432 return children[0]; 1433 return signbit(children[0]) ? -0.0 : std::numeric_limits<double>::infinity(); 1434 } 1430 1435 auto ret = getNearestMultiples(children[0], children[1]); 1431 1436 return ret.second; … … 1434 1439 if (children.size() != 2) 1435 1440 return std::numeric_limits<double>::quiet_NaN(); 1441 if (!isinf(children[0]) && isinf(children[1])) { 1442 if (!children[0]) 1443 return children[0]; 1444 return signbit(children[0]) ? -std::numeric_limits<double>::infinity() : +0.0; 1445 } 1436 1446 auto ret = getNearestMultiples(children[0], children[1]); 1437 1447 return ret.first; … … 1440 1450 if (children.size() != 2) 1441 1451 return std::numeric_limits<double>::quiet_NaN(); 1452 if (!isinf(children[0]) && isinf(children[1])) 1453 return signbit(children[0]) ? -0.0 : +0.0; 1442 1454 auto ret = getNearestMultiples(children[0], children[1]); 1443 1455 auto upperB = ret.second; … … 1448 1460 if (children.size() != 2) 1449 1461 return std::numeric_limits<double>::quiet_NaN(); 1462 if (!isinf(children[0]) && isinf(children[1])) 1463 return signbit(children[0]) ? -0.0 : +0.0; 1450 1464 auto ret = getNearestMultiples(children[0], children[1]); 1451 1465 auto upperB = ret.second; -
trunk/Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp
r287909 r291841 87 87 ASSERT(isNumericValue()); 88 88 if (!m_value->doubleValue()) { 89 m_value = CSSPrimitiveValue::create(std:: numeric_limits<double>::infinity(), m_value->primitiveType());89 m_value = CSSPrimitiveValue::create(std::copysign(std::numeric_limits<double>::infinity(), m_value->doubleValue()), m_value->primitiveType()); 90 90 return; 91 91 }
Note: See TracChangeset
for help on using the changeset viewer.