Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1146 parsedValue = parseFillPositionY(m_valueList); | 1146 parsedValue = parseFillPositionY(m_valueList); |
| 1147 if (parsedValue) | 1147 if (parsedValue) |
| 1148 m_valueList->next(); | 1148 m_valueList->next(); |
| 1149 break; | 1149 break; |
| 1150 case CSSPropertyWebkitTransformOriginZ: | 1150 case CSSPropertyWebkitTransformOriginZ: |
| 1151 validPrimitive = validUnit(value, FLength); | 1151 validPrimitive = validUnit(value, FLength); |
| 1152 break; | 1152 break; |
| 1153 case CSSPropertyPerspective: | 1153 case CSSPropertyPerspective: |
| 1154 if (id == CSSValueNone) { | 1154 if (id == CSSValueNone) { |
| 1155 validPrimitive = true; | 1155 validPrimitive = true; |
| 1156 } else if (validUnit(value, FLength | FNonNeg)) { | 1156 } else { |
| 1157 addProperty(propId, createPrimitiveNumericValue(value), important); | 1157 bool isCalculationValue = isCalculation(value); |
| 1158 return true; | 1158 if (validUnit(value, FLength)) { |
| 1159 if (isCalculationValue || value->fValue > 0) { | |
| 1160 addProperty(propId, createPrimitiveNumericValue(value), impo rtant); | |
| 1161 return true; | |
| 1162 } | |
| 1163 } | |
|
alancutter (OOO until 2018)
2015/03/16 23:33:15
This can probably be simplified as:
if (id == CSSV
| |
| 1159 } | 1164 } |
| 1160 break; | 1165 break; |
| 1161 case CSSPropertyWebkitPerspective: | 1166 case CSSPropertyWebkitPerspective: |
| 1162 if (id == CSSValueNone) { | 1167 if (id == CSSValueNone) { |
| 1163 validPrimitive = true; | 1168 validPrimitive = true; |
| 1164 } else if (validUnit(value, FNumber | FLength | FNonNeg)) { | 1169 } else { |
| 1165 // Accepting valueless numbers is a quirk of the -webkit prefixed ve rsion of the property. | 1170 bool isCalculationValue = isCalculation(value); |
| 1166 addProperty(propId, createPrimitiveNumericValue(value), important); | 1171 if (validUnit(value, FNumber | FLength)) { |
| 1167 return true; | 1172 if (isCalculationValue || value->fValue > 0) { |
| 1173 // Accepting valueless numbers is a quirk of the -webkit pre fixed version of the property. | |
| 1174 addProperty(propId, createPrimitiveNumericValue(value), impo rtant); | |
| 1175 return true; | |
| 1176 } | |
| 1177 } | |
| 1168 } | 1178 } |
| 1169 break; | 1179 break; |
| 1170 case CSSPropertyPerspectiveOrigin: | 1180 case CSSPropertyPerspectiveOrigin: |
| 1171 case CSSPropertyWebkitPerspectiveOrigin: { | 1181 case CSSPropertyWebkitPerspectiveOrigin: { |
| 1172 RefPtrWillBeRawPtr<CSSValueList> list = parseTransformOrigin(); | 1182 RefPtrWillBeRawPtr<CSSValueList> list = parseTransformOrigin(); |
| 1173 if (!list || list->length() == 3) | 1183 if (!list || list->length() == 3) |
| 1174 return false; | 1184 return false; |
| 1175 // This values are added to match gecko serialization. | 1185 // This values are added to match gecko serialization. |
| 1176 if (list->length() == 1) | 1186 if (list->length() == 1) |
| 1177 list->append(cssValuePool().createValue(50, CSSPrimitiveValue::CSS_P ERCENTAGE)); | 1187 list->append(cssValuePool().createValue(50, CSSPrimitiveValue::CSS_P ERCENTAGE)); |
| (...skipping 7319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8497 } | 8507 } |
| 8498 } | 8508 } |
| 8499 | 8509 |
| 8500 if (!list->length()) | 8510 if (!list->length()) |
| 8501 return nullptr; | 8511 return nullptr; |
| 8502 | 8512 |
| 8503 return list.release(); | 8513 return list.release(); |
| 8504 } | 8514 } |
| 8505 | 8515 |
| 8506 } // namespace blink | 8516 } // namespace blink |
| OLD | NEW |