Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
| 5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
| 6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
| 7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
| 8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
| 9 * distribution. | 9 * distribution. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1096 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) | 1096 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) |
| 1097 { | 1097 { |
| 1098 if (value.isPathValue()) | 1098 if (value.isPathValue()) |
| 1099 return toCSSPathValue(value).stylePath(); | 1099 return toCSSPathValue(value).stylePath(); |
| 1100 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); | 1100 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); |
| 1101 return nullptr; | 1101 return nullptr; |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl eResolverState& state, const CSSValue& value) | 1104 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl eResolverState& state, const CSSValue& value) |
| 1105 { | 1105 { |
| 1106 // TODO(timloh): Resolve ems, etc. | 1106 // TODO(timloh): Images and transform-function values can also contain lengt hs. |
| 1107 if (value.isValueList()) { | |
| 1108 CSSValueList* newList = CSSValueList::createSpaceSeparated(); | |
| 1109 for (const CSSValue* innerValue : toCSSValueList(value)) | |
| 1110 newList->append(convertRegisteredPropertyValue(state, *innerValue)); | |
| 1111 return *newList; | |
| 1112 } | |
| 1113 | |
| 1114 if (value.isPrimitiveValue()) { | |
| 1115 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | |
| 1116 if (primitiveValue.isCalculated() || CSSPrimitiveValue::isRelativeUnit(p rimitiveValue.typeWithCalcResolved())) { | |
| 1117 Length length = primitiveValue.convertToLength(state.cssToLengthConv ersionData().copyWithAdjustedZoom(1)); | |
|
sashab
2016/09/22 00:29:22
I think we should really use the actual zoom here.
Timothy Loh
2016/09/22 02:42:48
I'm not sure what you're getting at here. If I spe
sashab
2016/09/22 06:02:35
Ok, add this comment then :)
alancutter (OOO until 2018)
2016/09/22 07:58:41
Agreed, at the very least add the comment.
I think
Timothy Loh
2016/09/22 08:18:58
Comment added. Probably negligible, but I prefer i
| |
| 1118 return *CSSPrimitiveValue::create(length, 1); | |
| 1119 } | |
| 1120 } | |
| 1107 return value; | 1121 return value; |
| 1108 } | 1122 } |
| 1109 | 1123 |
| 1110 } // namespace blink | 1124 } // namespace blink |
| OLD | NEW |