Changeset 107724 in webkit


Ignore:
Timestamp:
Feb 14, 2012 12:22:03 PM (12 years ago)
Author:
mikelawther@chromium.org
Message:

CSS3 calc: add isZero implementations to catch divide by zero
https://bugs.webkit.org/show_bug.cgi?id=78603

Reviewed by Ojan Vafai.

Source/WebCore:

  • css/CSSCalculationValue.cpp:

(WebCore::CSSCalcPrimitiveValue::isZero):
(CSSCalcPrimitiveValue):
(WebCore::CSSCalcBinaryOperation::isZero):
(CSSCalcBinaryOperation):

  • css/CSSCalculationValue.h:

(CSSCalcExpressionNode):

LayoutTests:

  • css3/calc/calc-errors-expected.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107723 r107724  
     12012-02-14  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc: add isZero implementations to catch divide by zero
     4        https://bugs.webkit.org/show_bug.cgi?id=78603
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/calc/calc-errors-expected.txt:
     9
    1102012-02-14  Tony Chang  <tony@chromium.org>
    211
  • trunk/LayoutTests/css3/calc/calc-errors-expected.txt

    r107688 r107724  
    44unclosed calc with garbage => PASS
    55garbage => PASS
    6 zero division => FAIL: expected width of 100, but was 0
     6zero division => PASS
    77non length => PASS
    88number + length => PASS
  • trunk/Source/WebCore/ChangeLog

    r107715 r107724  
     12012-02-14  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc: add isZero implementations to catch divide by zero
     4        https://bugs.webkit.org/show_bug.cgi?id=78603
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css/CSSCalculationValue.cpp:
     9        (WebCore::CSSCalcPrimitiveValue::isZero):
     10        (CSSCalcPrimitiveValue):
     11        (WebCore::CSSCalcBinaryOperation::isZero):
     12        (CSSCalcBinaryOperation):
     13        * css/CSSCalculationValue.h:
     14        (CSSCalcExpressionNode):
     15
    1162012-02-12  Timothy Hatcher  <timothy@apple.com>
    217
  • trunk/Source/WebCore/css/CSSCalculationValue.cpp

    r107688 r107724  
    100100    }
    101101   
     102    virtual bool isZero() const
     103    {
     104        return !m_value->getDoubleValue();
     105    }
     106
    102107    virtual String cssText() const
    103108    {
     
    194199    }
    195200   
     201    virtual bool isZero() const
     202    {
     203        return !doubleValue();
     204    }
     205
    196206    virtual double doubleValue() const
    197207    {
  • trunk/Source/WebCore/css/CSSCalculationValue.h

    r107688 r107724  
    6060   
    6161    virtual ~CSSCalcExpressionNode() = 0; 
     62    virtual bool isZero() const = 0;
    6263    virtual double doubleValue() const = 0; 
    6364    virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
     
    6566    CalculationCategory category() const { return m_category; }   
    6667    bool isInteger() const { return m_isInteger; }
    67     bool isZero() const { return false; }
    6868   
    6969protected:
Note: See TracChangeset for help on using the changeset viewer.