Changeset 216188 in webkit


Ignore:
Timestamp:
May 4, 2017 8:41:13 AM (7 years ago)
Author:
hyatt@apple.com
Message:

REGRESSION(STP): rgb() with calc() containing variables doesn't work
https://bugs.webkit.org/show_bug.cgi?id=169939

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new test in fast/css/variables.

  • css/CSSCalculationValue.cpp:

(WebCore::CSSCalcExpressionNodeParser::parseValue):
Treat floats in calcs as integers when we can.

LayoutTests:

  • fast/css/variables/calc-float-to-int-expected.html: Added.
  • fast/css/variables/calc-float-to-int.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r216177 r216188  
     12017-05-04  Dave Hyatt  <hyatt@apple.com>
     2
     3        REGRESSION(STP): rgb() with calc() containing variables doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=169939
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * fast/css/variables/calc-float-to-int-expected.html: Added.
     9        * fast/css/variables/calc-float-to-int.html: Added.
     10
    1112017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r216183 r216188  
     12017-05-04  Dave Hyatt  <hyatt@apple.com>
     2
     3        REGRESSION(STP): rgb() with calc() containing variables doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=169939
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Added new test in fast/css/variables.
     9
     10        * css/CSSCalculationValue.cpp:
     11        (WebCore::CSSCalcExpressionNodeParser::parseValue):
     12        Treat floats in calcs as integers when we can.
     13
    1142017-05-04  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/css/CSSCalculationValue.cpp

    r210215 r216188  
    599599            return false;
    600600       
    601         result->value = CSSCalcPrimitiveValue::create(CSSPrimitiveValue::create(token.numericValue(), type), token.numericValueType() == IntegerValueType);
     601        bool isInteger = token.numericValueType() == IntegerValueType || (token.numericValueType() == NumberValueType && token.numericValue() == trunc(token.numericValue()));
     602        result->value = CSSCalcPrimitiveValue::create(CSSPrimitiveValue::create(token.numericValue(), type), isInteger);
    602603       
    603604        return true;
Note: See TracChangeset for help on using the changeset viewer.