Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: Source/core/css/CSSCalculationValue.cpp

Issue 1193753002: Serialize zIndex as an integer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix regression and add test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/animation/DoubleStyleInterpolation.h ('k') | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 TooDeep, 44 TooDeep,
45 NoMoreTokens 45 NoMoreTokens
46 }; 46 };
47 47
48 namespace blink { 48 namespace blink {
49 49
50 static CalculationCategory unitCategory(CSSPrimitiveValue::UnitType type) 50 static CalculationCategory unitCategory(CSSPrimitiveValue::UnitType type)
51 { 51 {
52 switch (type) { 52 switch (type) {
53 case CSSPrimitiveValue::CSS_NUMBER: 53 case CSSPrimitiveValue::CSS_NUMBER:
54 case CSSPrimitiveValue::CSS_INTEGER:
54 return CalcNumber; 55 return CalcNumber;
55 case CSSPrimitiveValue::CSS_PERCENTAGE: 56 case CSSPrimitiveValue::CSS_PERCENTAGE:
56 return CalcPercent; 57 return CalcPercent;
57 case CSSPrimitiveValue::CSS_EMS: 58 case CSSPrimitiveValue::CSS_EMS:
58 case CSSPrimitiveValue::CSS_EXS: 59 case CSSPrimitiveValue::CSS_EXS:
59 case CSSPrimitiveValue::CSS_PX: 60 case CSSPrimitiveValue::CSS_PX:
60 case CSSPrimitiveValue::CSS_CM: 61 case CSSPrimitiveValue::CSS_CM:
61 case CSSPrimitiveValue::CSS_MM: 62 case CSSPrimitiveValue::CSS_MM:
62 case CSSPrimitiveValue::CSS_IN: 63 case CSSPrimitiveValue::CSS_IN:
63 case CSSPrimitiveValue::CSS_PT: 64 case CSSPrimitiveValue::CSS_PT:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 case CSSPrimitiveValue::CSS_RGBCOLOR: 129 case CSSPrimitiveValue::CSS_RGBCOLOR:
129 case CSSPrimitiveValue::CSS_PAIR: 130 case CSSPrimitiveValue::CSS_PAIR:
130 case CSSPrimitiveValue::CSS_SHAPE: 131 case CSSPrimitiveValue::CSS_SHAPE:
131 case CSSPrimitiveValue::CSS_QUAD: 132 case CSSPrimitiveValue::CSS_QUAD:
132 case CSSPrimitiveValue::CSS_CALC: 133 case CSSPrimitiveValue::CSS_CALC:
133 case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER: 134 case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER:
134 case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH: 135 case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH:
135 case CSSPrimitiveValue::CSS_PROPERTY_ID: 136 case CSSPrimitiveValue::CSS_PROPERTY_ID:
136 case CSSPrimitiveValue::CSS_VALUE_ID: 137 case CSSPrimitiveValue::CSS_VALUE_ID:
137 case CSSPrimitiveValue::CSS_QEM: 138 case CSSPrimitiveValue::CSS_QEM:
139 case CSSPrimitiveValue::CSS_INTEGER:
Timothy Loh 2015/06/29 04:29:50 probably should be true? maybe see if you can make
138 return false; 140 return false;
139 }; 141 };
140 ASSERT_NOT_REACHED(); 142 ASSERT_NOT_REACHED();
141 return false; 143 return false;
142 } 144 }
143 145
144 static String buildCSSText(const String& expression) 146 static String buildCSSText(const String& expression)
145 { 147 {
146 StringBuilder result; 148 StringBuilder result;
147 result.appendLiteral("calc"); 149 result.appendLiteral("calc");
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); 761 return adoptRefWillBeNoop(new CSSCalcValue(expression, range));
760 } 762 }
761 763
762 DEFINE_TRACE_AFTER_DISPATCH(CSSCalcValue) 764 DEFINE_TRACE_AFTER_DISPATCH(CSSCalcValue)
763 { 765 {
764 visitor->trace(m_expression); 766 visitor->trace(m_expression);
765 CSSValue::traceAfterDispatch(visitor); 767 CSSValue::traceAfterDispatch(visitor);
766 } 768 }
767 769
768 } // namespace blink 770 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/DoubleStyleInterpolation.h ('k') | Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698