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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107724
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-14 Mike Lawther <mikelawther@chromium.org>
+
+ CSS3 calc: add isZero implementations to catch divide by zero
+ https://bugs.webkit.org/show_bug.cgi?id=78603
+
+ Reviewed by Ojan Vafai.
+
+ * css3/calc/calc-errors-expected.txt:
+
2012-02-14 Tony Chang <tony@chromium.org>
[chromium] Unreviewed, marking a perf test as slow in debug and two
unclosed calc => PASS
unclosed calc with garbage => PASS
garbage => PASS
-zero division => FAIL: expected width of 100, but was 0
+zero division => PASS
non length => PASS
number + length => PASS
length + number => PASS
+2012-02-14 Mike Lawther <mikelawther@chromium.org>
+
+ CSS3 calc: add isZero implementations to catch divide by zero
+ https://bugs.webkit.org/show_bug.cgi?id=78603
+
+ Reviewed by Ojan Vafai.
+
+ * css/CSSCalculationValue.cpp:
+ (WebCore::CSSCalcPrimitiveValue::isZero):
+ (CSSCalcPrimitiveValue):
+ (WebCore::CSSCalcBinaryOperation::isZero):
+ (CSSCalcBinaryOperation):
+ * css/CSSCalculationValue.h:
+ (CSSCalcExpressionNode):
+
2012-02-12 Timothy Hatcher <timothy@apple.com>
Don't include CachedResources that haven't downloaded when populating the Web Inspector on load.
return adoptRef(new CSSCalcPrimitiveValue(value, isInteger));
}
+ virtual bool isZero() const
+ {
+ return !m_value->getDoubleValue();
+ }
+
virtual String cssText() const
{
return m_value->cssText();
return adoptRef(new CSSCalcBinaryOperation(leftSide, rightSide, op, newCategory));
}
+ virtual bool isZero() const
+ {
+ return !doubleValue();
+ }
+
virtual double doubleValue() const
{
return evaluate(m_leftSide->doubleValue(), m_rightSide->doubleValue());
public:
virtual ~CSSCalcExpressionNode() = 0;
+ virtual bool isZero() const = 0;
virtual double doubleValue() const = 0;
virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
CalculationCategory category() const { return m_category; }
bool isInteger() const { return m_isInteger; }
- bool isZero() const { return false; }
protected:
CSSCalcExpressionNode(CalculationCategory category, bool isInteger)