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 for (size_t i = 0; i < length; ++i) { | 1096 for (size_t i = 0; i < length; ++i) { |
1097 array->append(convertLength(state, toCSSPrimitiveValue(dashes.item(i)))); | 1097 array->append(convertLength(state, toCSSPrimitiveValue(dashes.item(i)))); |
1098 } | 1098 } |
1099 | 1099 |
1100 return array.release(); | 1100 return array.release(); |
1101 } | 1101 } |
1102 | 1102 |
1103 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, | 1103 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, |
1104 const CSSValue& value, | 1104 const CSSValue& value, |
1105 bool forVisitedLink) { | 1105 bool forVisitedLink) { |
1106 if (value.isIdentifierValue() && | 1106 if (value.isIdentifierValue()) { |
1107 toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor) | 1107 if (toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor) |
Timothy Loh
2016/11/28 03:11:21
Not sure why this changed.
Manuel Rego
2016/11/28 10:47:55
This is a leftover from the previous version of th
| |
1108 return StyleColor::currentColor(); | 1108 return StyleColor::currentColor(); |
1109 } | |
1109 return state.document().textLinkColors().colorFromCSSValue(value, Color(), | 1110 return state.document().textLinkColors().colorFromCSSValue(value, Color(), |
1110 forVisitedLink); | 1111 forVisitedLink); |
1111 } | 1112 } |
1113 | |
1114 StyleAutoColor StyleBuilderConverter::convertStyleAutoColor( | |
1115 StyleResolverState& state, | |
1116 const CSSValue& value, | |
1117 bool forVisitedLink) { | |
1118 if (value.isIdentifierValue()) { | |
Timothy Loh
2016/11/28 03:11:21
if (value.isIdentifierValue() && toCSSIdentifierVa
Manuel Rego
2016/11/28 10:47:55
Ok.
| |
1119 if (toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor) | |
1120 return StyleAutoColor::currentColor(); | |
1121 if (toCSSIdentifierValue(value).getValueID() == CSSValueAuto) | |
1122 return StyleAutoColor::autoColor(); | |
1123 } | |
1124 return state.document().textLinkColors().colorFromCSSValue(value, Color(), | |
1125 forVisitedLink); | |
1126 } | |
1112 | 1127 |
1113 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, | 1128 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, |
1114 const CSSValue& value) { | 1129 const CSSValue& value) { |
1115 if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID()) { | 1130 if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID()) { |
1116 float multiplier = convertLineWidth<float>(state, value); | 1131 float multiplier = convertLineWidth<float>(state, value); |
1117 return CSSPrimitiveValue::create(multiplier / 48, | 1132 return CSSPrimitiveValue::create(multiplier / 48, |
1118 CSSPrimitiveValue::UnitType::Ems) | 1133 CSSPrimitiveValue::UnitType::Ems) |
1119 ->computeLength<float>(state.cssToLengthConversionData()); | 1134 ->computeLength<float>(state.cssToLengthConversionData()); |
1120 } | 1135 } |
1121 return toCSSPrimitiveValue(value).computeLength<float>( | 1136 return toCSSPrimitiveValue(value).computeLength<float>( |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1290 // Instead of the actual zoom, use 1 to avoid potential rounding errors | 1305 // Instead of the actual zoom, use 1 to avoid potential rounding errors |
1291 Length length = primitiveValue.convertToLength( | 1306 Length length = primitiveValue.convertToLength( |
1292 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); | 1307 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); |
1293 return *CSSPrimitiveValue::create(length, 1); | 1308 return *CSSPrimitiveValue::create(length, 1); |
1294 } | 1309 } |
1295 } | 1310 } |
1296 return value; | 1311 return value; |
1297 } | 1312 } |
1298 | 1313 |
1299 } // namespace blink | 1314 } // namespace blink |
OLD | NEW |