| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 createExpressionNode(CSSPrimitiveValue::create(pixels, CSSPrimitiveValue
::CSS_PX), pixels == trunc(pixels)), | 746 createExpressionNode(CSSPrimitiveValue::create(pixels, CSSPrimitiveValue
::CSS_PX), pixels == trunc(pixels)), |
| 747 createExpressionNode(CSSPrimitiveValue::create(percent, CSSPrimitiveValu
e::CSS_PERCENTAGE), percent == trunc(percent)), | 747 createExpressionNode(CSSPrimitiveValue::create(percent, CSSPrimitiveValu
e::CSS_PERCENTAGE), percent == trunc(percent)), |
| 748 CalcAdd); | 748 CalcAdd); |
| 749 } | 749 } |
| 750 | 750 |
| 751 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(CSSParserString name,
CSSParserValueList* parserValueList, ValueRange range) | 751 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(CSSParserString name,
CSSParserValueList* parserValueList, ValueRange range) |
| 752 { | 752 { |
| 753 CSSCalcExpressionNodeParser parser; | 753 CSSCalcExpressionNodeParser parser; |
| 754 RefPtrWillBeRawPtr<CSSCalcExpressionNode> expression = nullptr; | 754 RefPtrWillBeRawPtr<CSSCalcExpressionNode> expression = nullptr; |
| 755 | 755 |
| 756 if (equalIgnoringCase(name, "calc(") || equalIgnoringCase(name, "-webkit-cal
c(")) | 756 if (equalIgnoringCase(name, "calc") || equalIgnoringCase(name, "-webkit-calc
")) |
| 757 expression = parser.parseCalc(parserValueList); | 757 expression = parser.parseCalc(parserValueList); |
| 758 // FIXME calc (http://webkit.org/b/16662) Add parsing for min and max here | 758 // FIXME calc (http://webkit.org/b/16662) Add parsing for min and max here |
| 759 | 759 |
| 760 return expression ? adoptRefWillBeNoop(new CSSCalcValue(expression, range))
: nullptr; | 760 return expression ? adoptRefWillBeNoop(new CSSCalcValue(expression, range))
: nullptr; |
| 761 } | 761 } |
| 762 | 762 |
| 763 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtrWillBeRawPtr
<CSSCalcExpressionNode> expression, ValueRange range) | 763 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtrWillBeRawPtr
<CSSCalcExpressionNode> expression, ValueRange range) |
| 764 { | 764 { |
| 765 return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); | 765 return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void CSSCalcValue::traceAfterDispatch(Visitor* visitor) | 768 void CSSCalcValue::traceAfterDispatch(Visitor* visitor) |
| 769 { | 769 { |
| 770 visitor->trace(m_expression); | 770 visitor->trace(m_expression); |
| 771 CSSValue::traceAfterDispatch(visitor); | 771 CSSValue::traceAfterDispatch(visitor); |
| 772 } | 772 } |
| 773 | 773 |
| 774 } // namespace blink | 774 } // namespace blink |
| OLD | NEW |