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

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

Issue 1193753002: Serialize zIndex as an integer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CSSCalculationValue.cpp Created 5 years, 5 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/css/CSSPrimitiveValue.h ('k') | Source/core/css/ComputedStyleCSSValueMapping.cpp » ('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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 case CSS_CALC_PERCENTAGE_WITH_LENGTH: 431 case CSS_CALC_PERCENTAGE_WITH_LENGTH:
432 ASSERT_NOT_REACHED(); 432 ASSERT_NOT_REACHED();
433 break; 433 break;
434 case CSS_SHAPE: 434 case CSS_SHAPE:
435 // We must not call deref() when oilpan is enabled because m_value.shape is traced. 435 // We must not call deref() when oilpan is enabled because m_value.shape is traced.
436 #if !ENABLE(OILPAN) 436 #if !ENABLE(OILPAN)
437 m_value.shape->deref(); 437 m_value.shape->deref();
438 #endif 438 #endif
439 break; 439 break;
440 case CSS_NUMBER: 440 case CSS_NUMBER:
441 case CSS_INTEGER:
441 case CSS_PERCENTAGE: 442 case CSS_PERCENTAGE:
442 case CSS_EMS: 443 case CSS_EMS:
443 case CSS_QEM: 444 case CSS_QEM:
444 case CSS_EXS: 445 case CSS_EXS:
445 case CSS_REMS: 446 case CSS_REMS:
446 case CSS_CHS: 447 case CSS_CHS:
447 case CSS_PX: 448 case CSS_PX:
448 case CSS_CM: 449 case CSS_CM:
449 case CSS_MM: 450 case CSS_MM:
450 case CSS_IN: 451 case CSS_IN:
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 848
848 static String formatNumber(double number, const char* characters) 849 static String formatNumber(double number, const char* characters)
849 { 850 {
850 return formatNumber(number, characters, strlen(characters)); 851 return formatNumber(number, characters, strlen(characters));
851 } 852 }
852 853
853 const char* CSSPrimitiveValue::unitTypeToString(UnitType type) 854 const char* CSSPrimitiveValue::unitTypeToString(UnitType type)
854 { 855 {
855 switch (type) { 856 switch (type) {
856 case CSS_NUMBER: 857 case CSS_NUMBER:
858 case CSS_INTEGER:
857 return ""; 859 return "";
858 case CSS_PERCENTAGE: 860 case CSS_PERCENTAGE:
859 return "%"; 861 return "%";
860 case CSS_EMS: 862 case CSS_EMS:
861 return "em"; 863 return "em";
862 case CSS_EXS: 864 case CSS_EXS:
863 return "ex"; 865 return "ex";
864 case CSS_REMS: 866 case CSS_REMS:
865 return "rem"; 867 return "rem";
866 case CSS_CHS: 868 case CSS_CHS:
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if (m_hasCachedCSSText) { 940 if (m_hasCachedCSSText) {
939 ASSERT(cssTextCache().contains(this)); 941 ASSERT(cssTextCache().contains(this));
940 return cssTextCache().get(this); 942 return cssTextCache().get(this);
941 } 943 }
942 944
943 String text; 945 String text;
944 switch (m_primitiveUnitType) { 946 switch (m_primitiveUnitType) {
945 case CSS_UNKNOWN: 947 case CSS_UNKNOWN:
946 // FIXME 948 // FIXME
947 break; 949 break;
950 case CSS_INTEGER:
951 text = String::format("%d", getIntValue());
952 break;
948 case CSS_NUMBER: 953 case CSS_NUMBER:
949 case CSS_PERCENTAGE: 954 case CSS_PERCENTAGE:
950 case CSS_EMS: 955 case CSS_EMS:
951 case CSS_EXS: 956 case CSS_EXS:
952 case CSS_REMS: 957 case CSS_REMS:
953 case CSS_CHS: 958 case CSS_CHS:
954 case CSS_PX: 959 case CSS_PX:
955 case CSS_CM: 960 case CSS_CM:
956 case CSS_DPPX: 961 case CSS_DPPX:
957 case CSS_DPI: 962 case CSS_DPI:
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 visitor->trace(m_value.shape); 1143 visitor->trace(m_value.shape);
1139 break; 1144 break;
1140 default: 1145 default:
1141 break; 1146 break;
1142 } 1147 }
1143 #endif 1148 #endif
1144 CSSValue::traceAfterDispatch(visitor); 1149 CSSValue::traceAfterDispatch(visitor);
1145 } 1150 }
1146 1151
1147 } // namespace blink 1152 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698