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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 case CSSPrimitiveValue::CSS_VALUE_ID: | 139 case CSSPrimitiveValue::CSS_VALUE_ID: |
140 return false; | 140 return false; |
141 }; | 141 }; |
142 ASSERT_NOT_REACHED(); | 142 ASSERT_NOT_REACHED(); |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 static String buildCSSText(const String& expression) | 146 static String buildCSSText(const String& expression) |
147 { | 147 { |
148 StringBuilder result; | 148 StringBuilder result; |
149 result.append("calc"); | 149 result.appendLiteral("calc"); |
150 bool expressionHasSingleTerm = expression[0] != '('; | 150 bool expressionHasSingleTerm = expression[0] != '('; |
151 if (expressionHasSingleTerm) | 151 if (expressionHasSingleTerm) |
152 result.append('('); | 152 result.append('('); |
153 result.append(expression); | 153 result.append(expression); |
154 if (expressionHasSingleTerm) | 154 if (expressionHasSingleTerm) |
155 result.append(')'); | 155 result.append(')'); |
156 return result.toString(); | 156 return result.toString(); |
157 } | 157 } |
158 | 158 |
159 String CSSCalcValue::customCSSText() const | 159 String CSSCalcValue::customCSSText() const |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |