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 29 matching lines...) Expand all Loading... |
40 static const int maxExpressionDepth = 100; | 40 static const int maxExpressionDepth = 100; |
41 | 41 |
42 enum ParseState { | 42 enum ParseState { |
43 OK, | 43 OK, |
44 TooDeep, | 44 TooDeep, |
45 NoMoreTokens | 45 NoMoreTokens |
46 }; | 46 }; |
47 | 47 |
48 namespace WebCore { | 48 namespace WebCore { |
49 | 49 |
50 DEFINE_GC_INFO(CSSCalcExpressionNode); | |
51 | |
52 static CalculationCategory unitCategory(CSSPrimitiveValue::UnitTypes type) | 50 static CalculationCategory unitCategory(CSSPrimitiveValue::UnitTypes type) |
53 { | 51 { |
54 switch (type) { | 52 switch (type) { |
55 case CSSPrimitiveValue::CSS_NUMBER: | 53 case CSSPrimitiveValue::CSS_NUMBER: |
56 case CSSPrimitiveValue::CSS_PARSER_INTEGER: | 54 case CSSPrimitiveValue::CSS_PARSER_INTEGER: |
57 return CalcNumber; | 55 return CalcNumber; |
58 case CSSPrimitiveValue::CSS_PERCENTAGE: | 56 case CSSPrimitiveValue::CSS_PERCENTAGE: |
59 return CalcPercent; | 57 return CalcPercent; |
60 case CSSPrimitiveValue::CSS_EMS: | 58 case CSSPrimitiveValue::CSS_EMS: |
61 case CSSPrimitiveValue::CSS_EXS: | 59 case CSSPrimitiveValue::CSS_EXS: |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSCalcValue(expr
ession, range)); | 760 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSCalcValue(expr
ession, range)); |
763 } | 761 } |
764 | 762 |
765 void CSSCalcValue::traceAfterDispatch(Visitor* visitor) | 763 void CSSCalcValue::traceAfterDispatch(Visitor* visitor) |
766 { | 764 { |
767 visitor->trace(m_expression); | 765 visitor->trace(m_expression); |
768 CSSValue::traceAfterDispatch(visitor); | 766 CSSValue::traceAfterDispatch(visitor); |
769 } | 767 } |
770 | 768 |
771 } // namespace WebCore | 769 } // namespace WebCore |
OLD | NEW |