Changeset 292732 in webkit


Ignore:
Timestamp:
Apr 11, 2022 4:05:22 PM (3 months ago)
Author:
Nikos Mouchtaris
Message:

calc(): Propogate nan for min, max, clamp, and hypot
https://bugs.webkit.org/show_bug.cgi?id=238974

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-values/calc-catch-divide-by-0-expected.txt:
  • web-platform-tests/css/css-values/calc-infinity-nan-serialize-angle-expected.txt:
  • web-platform-tests/css/css-values/calc-infinity-nan-serialize-length-expected.txt:
  • web-platform-tests/css/css-values/calc-infinity-nan-serialize-time-expected.txt:

Source/WebCore:

If min, max, clamp, and hypot have a NaN value we need to propagate the NaN. This has to
do with the "infectious" NaN behavior the spec mentions. This patch also removes some
unnecessary code in CSSCalcPrimitiveValueNode::invert() and has clamp() properly serialize.
May want to separate them and expand clamp() serialization testing so it would have caught
this issue.

  • css/calc/CSSCalcOperationNode.cpp:

(WebCore::CSSCalcOperationNode::combineChildren):
(WebCore::CSSCalcOperationNode::simplifyNode):
(WebCore::CSSCalcOperationNode::evaluateOperator):

  • css/calc/CSSCalcOperationNode.h:
  • css/calc/CSSCalcPrimitiveValueNode.cpp:

(WebCore::CSSCalcPrimitiveValueNode::invert):

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r292722 r292732  
     12022-04-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        calc(): Propogate nan for min, max, clamp, and hypot
     4        https://bugs.webkit.org/show_bug.cgi?id=238974
     5
     6        Reviewed by Darin Adler.
     7
     8        * web-platform-tests/css/css-values/calc-catch-divide-by-0-expected.txt:
     9        * web-platform-tests/css/css-values/calc-infinity-nan-serialize-angle-expected.txt:
     10        * web-platform-tests/css/css-values/calc-infinity-nan-serialize-length-expected.txt:
     11        * web-platform-tests/css/css-values/calc-infinity-nan-serialize-time-expected.txt:
     12
    1132022-04-11  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-catch-divide-by-0-expected.txt

    r291830 r292732  
    1414PASS 'calc(1px * min(0/0, 0))' as a specified value should serialize as 'calc(NaN * 1px)'.
    1515PASS 'calc(1px * max(0/0, min(0,10)))' as a specified value should serialize as 'calc(NaN * 1px)'.
    16 FAIL 'calc(1px * clamp(0/0, 0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(0/0, 0, 10))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(NaN, 0, 10))"
    17 FAIL 'calc(1px * max(0, min(10, 0/0)))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * max(0, min(10, 0/0)))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(10px)"
    18 FAIL 'calc(1px * clamp(0, 10, 0/0))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(0, 10, 0/0))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(0, 10, NaN))"
    19 FAIL 'calc(1px * max(0, min(0/0, 10)))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * max(0, min(0/0, 10)))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(0px)"
    20 FAIL 'calc(1px * clamp(0, 0/0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(0, 0/0, 10))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(0, NaN, 10))"
    21 FAIL 'calc(1px * clamp(-1/0, 0, 1/0))' as a specified value should serialize as 'calc(0px)'. assert_equals: 'calc(1px * clamp(-1/0, 0, 1/0))' and 'calc(0px)' should serialize the same in specified values. expected "calc(0px)" but got "calc(1px * clamp(-infinity, 0, infinity))"
    22 FAIL 'calc(1px * clamp(-1/0, 1/0, 10))' as a specified value should serialize as 'calc(10px)'. assert_equals: 'calc(1px * clamp(-1/0, 1/0, 10))' and 'calc(10px)' should serialize the same in specified values. expected "calc(10px)" but got "calc(1px * clamp(-infinity, infinity, 10))"
     16PASS 'calc(1px * clamp(0/0, 0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'.
     17PASS 'calc(1px * max(0, min(10, 0/0)))' as a specified value should serialize as 'calc(NaN * 1px)'.
     18PASS 'calc(1px * clamp(0, 10, 0/0))' as a specified value should serialize as 'calc(NaN * 1px)'.
     19PASS 'calc(1px * max(0, min(0/0, 10)))' as a specified value should serialize as 'calc(NaN * 1px)'.
     20PASS 'calc(1px * clamp(0, 0/0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'.
     21PASS 'calc(1px * clamp(-1/0, 0, 1/0))' as a specified value should serialize as 'calc(0px)'.
     22PASS 'calc(1px * clamp(-1/0, 1/0, 10))' as a specified value should serialize as 'calc(10px)'.
    2323
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-infinity-nan-serialize-angle-expected.txt

    r291830 r292732  
    2121PASS 'rotate(calc(1 * max(nAn*2deg, 0deg)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
    2222PASS 'rotate(calc(1 * min(nan*3deg, 0deg)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
    23 FAIL 'rotate(calc(1 * clamp(-INFINITY*20deg, 0deg, infiniTY*10deg)))' as a specified value should serialize as 'rotate(calc(0deg))'. assert_equals: 'rotate(calc(1 * clamp(-INFINITY*20deg, 0deg, infiniTY*10deg)))' and 'rotate(calc(0deg))' should serialize the same in specified values. expected "rotate(calc(0deg))" but got "rotate(calc(1 * clamp(-infinity * 1deg, 0deg, infinity * 1deg)))"
     23PASS 'rotate(calc(1 * clamp(-INFINITY*20deg, 0deg, infiniTY*10deg)))' as a specified value should serialize as 'rotate(calc(0deg))'.
    2424PASS 'rotate(calc(1deg * max(NaN, min(0,10))))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
    25 FAIL 'rotate(calc(1deg * clamp(NaN, 0, 10)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'. assert_equals: 'rotate(calc(1deg * clamp(NaN, 0, 10)))' and 'rotate(calc(NaN * 1deg))' should serialize the same in specified values. expected "rotate(calc(NaN * 1deg))" but got "rotate(calc(1deg * clamp(NaN, 0, 10)))"
    26 FAIL 'rotate(calc(1deg * max(0, min(10, NaN))))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'. assert_equals: 'rotate(calc(1deg * max(0, min(10, NaN))))' and 'rotate(calc(NaN * 1deg))' should serialize the same in specified values. expected "rotate(calc(NaN * 1deg))" but got "rotate(calc(10deg))"
    27 FAIL 'rotate(calc(1deg * clamp(0, 10, NaN)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'. assert_equals: 'rotate(calc(1deg * clamp(0, 10, NaN)))' and 'rotate(calc(NaN * 1deg))' should serialize the same in specified values. expected "rotate(calc(NaN * 1deg))" but got "rotate(calc(1deg * clamp(0, 10, NaN)))"
    28 FAIL 'rotate(calc(1deg * max(0, min(NaN, 10))))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'. assert_equals: 'rotate(calc(1deg * max(0, min(NaN, 10))))' and 'rotate(calc(NaN * 1deg))' should serialize the same in specified values. expected "rotate(calc(NaN * 1deg))" but got "rotate(calc(0deg))"
    29 FAIL 'rotate(calc(1deg * clamp(0, NaN, 10)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'. assert_equals: 'rotate(calc(1deg * clamp(0, NaN, 10)))' and 'rotate(calc(NaN * 1deg))' should serialize the same in specified values. expected "rotate(calc(NaN * 1deg))" but got "rotate(calc(1deg * clamp(0, NaN, 10)))"
    30 FAIL 'rotate(calc(1deg * clamp(-Infinity, 0, infinity)))' as a specified value should serialize as 'rotate(calc(0deg))'. assert_equals: 'rotate(calc(1deg * clamp(-Infinity, 0, infinity)))' and 'rotate(calc(0deg))' should serialize the same in specified values. expected "rotate(calc(0deg))" but got "rotate(calc(1deg * clamp(-infinity, 0, infinity)))"
    31 FAIL 'rotate(calc(1deg * clamp(-inFinity, infinity, 10)))' as a specified value should serialize as 'rotate(calc(10deg))'. assert_equals: 'rotate(calc(1deg * clamp(-inFinity, infinity, 10)))' and 'rotate(calc(10deg))' should serialize the same in specified values. expected "rotate(calc(10deg))" but got "rotate(calc(1deg * clamp(-infinity, infinity, 10)))"
     25PASS 'rotate(calc(1deg * clamp(NaN, 0, 10)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
     26PASS 'rotate(calc(1deg * max(0, min(10, NaN))))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
     27PASS 'rotate(calc(1deg * clamp(0, 10, NaN)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
     28PASS 'rotate(calc(1deg * max(0, min(NaN, 10))))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
     29PASS 'rotate(calc(1deg * clamp(0, NaN, 10)))' as a specified value should serialize as 'rotate(calc(NaN * 1deg))'.
     30PASS 'rotate(calc(1deg * clamp(-Infinity, 0, infinity)))' as a specified value should serialize as 'rotate(calc(0deg))'.
     31PASS 'rotate(calc(1deg * clamp(-inFinity, infinity, 10)))' as a specified value should serialize as 'rotate(calc(10deg))'.
    3232
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-infinity-nan-serialize-length-expected.txt

    r291830 r292732  
    1919PASS 'calc(1 * max(nAn*2px, 0px))' as a specified value should serialize as 'calc(NaN * 1px)'.
    2020PASS 'calc(1 * min(nan*3px, 0px))' as a specified value should serialize as 'calc(NaN * 1px)'.
    21 FAIL 'calc(1 * clamp(-INFINITY*20px, 0px, infiniTY*10px))' as a specified value should serialize as 'calc(0px)'. assert_equals: 'calc(1 * clamp(-INFINITY*20px, 0px, infiniTY*10px))' and 'calc(0px)' should serialize the same in specified values. expected "calc(0px)" but got "calc(1 * clamp(-infinity * 1px, 0px, infinity * 1px))"
     21PASS 'calc(1 * clamp(-INFINITY*20px, 0px, infiniTY*10px))' as a specified value should serialize as 'calc(0px)'.
    2222PASS 'calc(1px * max(NaN, min(0,10)))' as a specified value should serialize as 'calc(NaN * 1px)'.
    23 FAIL 'calc(1px * clamp(NaN, 0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(NaN, 0, 10))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(NaN, 0, 10))"
    24 FAIL 'calc(1px * max(0, min(10, NaN)))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * max(0, min(10, NaN)))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(10px)"
    25 FAIL 'calc(1px * clamp(0, 10, NaN))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(0, 10, NaN))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(0, 10, NaN))"
    26 FAIL 'calc(1px * max(0, min(NaN, 10)))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * max(0, min(NaN, 10)))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(0px)"
    27 FAIL 'calc(1px * clamp(0, NaN, 10))' as a specified value should serialize as 'calc(NaN * 1px)'. assert_equals: 'calc(1px * clamp(0, NaN, 10))' and 'calc(NaN * 1px)' should serialize the same in specified values. expected "calc(NaN * 1px)" but got "calc(1px * clamp(0, NaN, 10))"
    28 FAIL 'calc(1px * clamp(-Infinity, 0, infinity))' as a specified value should serialize as 'calc(0px)'. assert_equals: 'calc(1px * clamp(-Infinity, 0, infinity))' and 'calc(0px)' should serialize the same in specified values. expected "calc(0px)" but got "calc(1px * clamp(-infinity, 0, infinity))"
    29 FAIL 'calc(1px * clamp(-inFinity, infinity, 10))' as a specified value should serialize as 'calc(10px)'. assert_equals: 'calc(1px * clamp(-inFinity, infinity, 10))' and 'calc(10px)' should serialize the same in specified values. expected "calc(10px)" but got "calc(1px * clamp(-infinity, infinity, 10))"
     23PASS 'calc(1px * clamp(NaN, 0, 10))' as a specified value should serialize as 'calc(NaN * 1px)'.
     24PASS 'calc(1px * max(0, min(10, NaN)))' as a specified value should serialize as 'calc(NaN * 1px)'.
     25PASS 'calc(1px * clamp(0, 10, NaN))' as a specified value should serialize as 'calc(NaN * 1px)'.
     26PASS 'calc(1px * max(0, min(NaN, 10)))' as a specified value should serialize as 'calc(NaN * 1px)'.
     27PASS 'calc(1px * clamp(0, NaN, 10))' as a specified value should serialize as 'calc(NaN * 1px)'.
     28PASS 'calc(1px * clamp(-Infinity, 0, infinity))' as a specified value should serialize as 'calc(0px)'.
     29PASS 'calc(1px * clamp(-inFinity, infinity, 10))' as a specified value should serialize as 'calc(10px)'.
    3030
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-infinity-nan-serialize-time-expected.txt

    r291830 r292732  
    1919PASS 'calc(1 * max(nAn*2s, 0s))' as a specified value should serialize as 'calc(NaN * 1s)'.
    2020PASS 'calc(1 * min(nan*3s, 0s))' as a specified value should serialize as 'calc(NaN * 1s)'.
    21 FAIL 'calc(1 * clamp(-INFINITY*20s, 0s, infiniTY*10s))' as a specified value should serialize as 'calc(0s)'. assert_equals: 'calc(1 * clamp(-INFINITY*20s, 0s, infiniTY*10s))' and 'calc(0s)' should serialize the same in specified values. expected "calc(0s)" but got "calc(1 * clamp(-infinity * 1s, 0s, infinity * 1s))"
     21PASS 'calc(1 * clamp(-INFINITY*20s, 0s, infiniTY*10s))' as a specified value should serialize as 'calc(0s)'.
    2222PASS 'calc(1s * max(NaN, min(0,10)))' as a specified value should serialize as 'calc(NaN * 1s)'.
    23 FAIL 'calc(1s * clamp(NaN, 0, 10))' as a specified value should serialize as 'calc(NaN * 1s)'. assert_equals: 'calc(1s * clamp(NaN, 0, 10))' and 'calc(NaN * 1s)' should serialize the same in specified values. expected "calc(NaN * 1s)" but got "calc(1s * clamp(NaN, 0, 10))"
    24 FAIL 'calc(1s * max(0, min(10, NaN)))' as a specified value should serialize as 'calc(NaN * 1s)'. assert_equals: 'calc(1s * max(0, min(10, NaN)))' and 'calc(NaN * 1s)' should serialize the same in specified values. expected "calc(NaN * 1s)" but got "calc(10s)"
    25 FAIL 'calc(1s * clamp(0, 10, NaN))' as a specified value should serialize as 'calc(NaN * 1s)'. assert_equals: 'calc(1s * clamp(0, 10, NaN))' and 'calc(NaN * 1s)' should serialize the same in specified values. expected "calc(NaN * 1s)" but got "calc(1s * clamp(0, 10, NaN))"
    26 FAIL 'calc(1s * max(0, min(NaN, 10)))' as a specified value should serialize as 'calc(NaN * 1s)'. assert_equals: 'calc(1s * max(0, min(NaN, 10)))' and 'calc(NaN * 1s)' should serialize the same in specified values. expected "calc(NaN * 1s)" but got "calc(0s)"
    27 FAIL 'calc(1s * clamp(0, NaN, 10))' as a specified value should serialize as 'calc(NaN * 1s)'. assert_equals: 'calc(1s * clamp(0, NaN, 10))' and 'calc(NaN * 1s)' should serialize the same in specified values. expected "calc(NaN * 1s)" but got "calc(1s * clamp(0, NaN, 10))"
    28 FAIL 'calc(1s * clamp(-Infinity, 0, infinity))' as a specified value should serialize as 'calc(0s)'. assert_equals: 'calc(1s * clamp(-Infinity, 0, infinity))' and 'calc(0s)' should serialize the same in specified values. expected "calc(0s)" but got "calc(1s * clamp(-infinity, 0, infinity))"
    29 FAIL 'calc(1s * clamp(-inFinity, infinity, 10))' as a specified value should serialize as 'calc(10s)'. assert_equals: 'calc(1s * clamp(-inFinity, infinity, 10))' and 'calc(10s)' should serialize the same in specified values. expected "calc(10s)" but got "calc(1s * clamp(-infinity, infinity, 10))"
     23PASS 'calc(1s * clamp(NaN, 0, 10))' as a specified value should serialize as 'calc(NaN * 1s)'.
     24PASS 'calc(1s * max(0, min(10, NaN)))' as a specified value should serialize as 'calc(NaN * 1s)'.
     25PASS 'calc(1s * clamp(0, 10, NaN))' as a specified value should serialize as 'calc(NaN * 1s)'.
     26PASS 'calc(1s * max(0, min(NaN, 10)))' as a specified value should serialize as 'calc(NaN * 1s)'.
     27PASS 'calc(1s * clamp(0, NaN, 10))' as a specified value should serialize as 'calc(NaN * 1s)'.
     28PASS 'calc(1s * clamp(-Infinity, 0, infinity))' as a specified value should serialize as 'calc(0s)'.
     29PASS 'calc(1s * clamp(-inFinity, infinity, 10))' as a specified value should serialize as 'calc(10s)'.
    3030
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-length-serialize.html

    r251521 r292732  
    1111
    1212test_valid_length('clamp(1px, 2px, 3px)', 'clamp(1px, 2px, 3px)');
    13 test_valid_length('clamp(1px, 2px, clamp(2px, 3px, 4px))', 'clamp(1px, 2px, clamp(2px, 3px, 4px))');
     13test_valid_length('clamp(1px, 2px, clamp(2px, 3px, 4px))', 'clamp(1px, 2px, 3px)');
    1414
    1515</script>
  • trunk/Source/WebCore/ChangeLog

    r292730 r292732  
     12022-04-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        calc(): Propogate nan for min, max, clamp, and hypot
     4        https://bugs.webkit.org/show_bug.cgi?id=238974
     5
     6        Reviewed by Darin Adler.
     7
     8        If min, max, clamp, and hypot have a NaN value we need to propagate the NaN. This has to
     9        do with the "infectious" NaN behavior the spec mentions. This patch also removes some
     10        unnecessary code in CSSCalcPrimitiveValueNode::invert() and has clamp() properly serialize.
     11        May want to separate them and expand clamp() serialization testing so it would have caught
     12        this issue.
     13
     14        * css/calc/CSSCalcOperationNode.cpp:
     15        (WebCore::CSSCalcOperationNode::combineChildren):
     16        (WebCore::CSSCalcOperationNode::simplifyNode):
     17        (WebCore::CSSCalcOperationNode::evaluateOperator):
     18        * css/calc/CSSCalcOperationNode.h:
     19        * css/calc/CSSCalcPrimitiveValueNode.cpp:
     20        (WebCore::CSSCalcPrimitiveValueNode::invert):
     21
    1222022-04-11  Devin Rousso  <drousso@apple.com>
    223
  • trunk/Source/WebCore/css/calc/CSSCalcOperationNode.cpp

    r291946 r292732  
    782782    }
    783783
    784     if ((isMinOrMaxNode() || isHypotNode()) && canCombineAllChildren()) {
     784    if ((isMinOrMaxNode() || isHypotNode() || isClampNode()) && canCombineAllChildren()) {
    785785        auto combinedUnitType = m_children[0]->primitiveType();
    786786        auto involvesPercentageComparisons = [&]() {
     
    13041304            return std::numeric_limits<double>::quiet_NaN();
    13051305        double minimum = children[0];
    1306         for (auto child : children)
     1306        for (auto child : children) {
     1307            if (std::isnan(child))
     1308                return child;
    13071309            minimum = std::min(minimum, child);
     1310        }
    13081311        return minimum;
    13091312    }
     
    13121315            return std::numeric_limits<double>::quiet_NaN();
    13131316        double maximum = children[0];
    1314         for (auto child : children)
     1317        for (auto child : children) {
     1318            if (std::isnan(child))
     1319                return child;
    13151320            maximum = std::max(maximum, child);
     1321        }
    13161322        return maximum;
    13171323    }
     
    13221328        double value = children[1];
    13231329        double max = children[2];
     1330        if (std::isnan(min) || std::isnan(value) || std::isnan(max))
     1331            return std::numeric_limits<double>::quiet_NaN();
    13241332        return std::max(min, std::min(value, max));
    13251333    }
     
    13391347            return std::abs(children[0]);
    13401348        double sum = 0;
    1341         for (auto child : children)
     1349        for (auto child : children) {
     1350            if (std::isnan(child))
     1351                return child;
    13421352            sum += (child * child);
     1353        }
    13431354        return std::sqrt(sum);
    13441355    }
  • trunk/Source/WebCore/css/calc/CSSCalcOperationNode.h

    r291911 r292732  
    7070    bool isHypotNode() const { return m_operator == CalcOperator::Hypot; }
    7171    bool isPowOrSqrtNode() const { return m_operator == CalcOperator::Pow || m_operator == CalcOperator::Sqrt; }
    72     bool shouldPreserveFunction() const { return isTrigNode() || isExpNode() || isInverseTrigNode() || isAtan2Node() || isSignNode() || isSignNode() || isSteppedNode() || isRoundOperation() || isPowOrSqrtNode(); }
     72    bool shouldPreserveFunction() const { return isTrigNode() || isExpNode() || isInverseTrigNode() || isAtan2Node() || isSignNode() || isSignNode() || isSteppedNode() || isRoundOperation() || isPowOrSqrtNode() || isClampNode(); }
     73    bool isClampNode() const { return m_operator == CalcOperator::Clamp; }
    7374
    7475    void hoistChildrenWithOperator(CalcOperator);
  • trunk/Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp

    r291841 r292732  
    8686{
    8787    ASSERT(isNumericValue());
    88     if (!m_value->doubleValue()) {
    89         m_value = CSSPrimitiveValue::create(std::copysign(std::numeric_limits<double>::infinity(), m_value->doubleValue()), m_value->primitiveType());
    90         return;
    91     }
    92 
    9388    m_value = CSSPrimitiveValue::create(1.0 / m_value->doubleValue(), m_value->primitiveType());
    9489}
Note: See TracChangeset for help on using the changeset viewer.