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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2520873002: [css-ui] Add support for caret-color property (Closed)
Patch Set: Patch for landing applying suggested changes Created 4 years 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
OLDNEW
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor)
1108 return StyleColor::currentColor(); 1108 return StyleColor::currentColor();
1109 return state.document().textLinkColors().colorFromCSSValue(value, Color(), 1109 return state.document().textLinkColors().colorFromCSSValue(value, Color(),
1110 forVisitedLink); 1110 forVisitedLink);
1111 } 1111 }
1112 1112
1113 StyleAutoColor StyleBuilderConverter::convertStyleAutoColor(
1114 StyleResolverState& state,
1115 const CSSValue& value,
1116 bool forVisitedLink) {
1117 if (value.isIdentifierValue()) {
1118 if (toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor)
1119 return StyleAutoColor::currentColor();
1120 if (toCSSIdentifierValue(value).getValueID() == CSSValueAuto)
1121 return StyleAutoColor::autoColor();
1122 }
1123 return state.document().textLinkColors().colorFromCSSValue(value, Color(),
1124 forVisitedLink);
1125 }
1126
1113 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, 1127 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state,
1114 const CSSValue& value) { 1128 const CSSValue& value) {
1115 if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID()) { 1129 if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID()) {
1116 float multiplier = convertLineWidth<float>(state, value); 1130 float multiplier = convertLineWidth<float>(state, value);
1117 return CSSPrimitiveValue::create(multiplier / 48, 1131 return CSSPrimitiveValue::create(multiplier / 48,
1118 CSSPrimitiveValue::UnitType::Ems) 1132 CSSPrimitiveValue::UnitType::Ems)
1119 ->computeLength<float>(state.cssToLengthConversionData()); 1133 ->computeLength<float>(state.cssToLengthConversionData());
1120 } 1134 }
1121 return toCSSPrimitiveValue(value).computeLength<float>( 1135 return toCSSPrimitiveValue(value).computeLength<float>(
1122 state.cssToLengthConversionData()); 1136 state.cssToLengthConversionData());
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 // 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
1292 Length length = primitiveValue.convertToLength( 1306 Length length = primitiveValue.convertToLength(
1293 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); 1307 state.cssToLengthConversionData().copyWithAdjustedZoom(1));
1294 return *CSSPrimitiveValue::create(length, 1); 1308 return *CSSPrimitiveValue::create(length, 1);
1295 } 1309 }
1296 } 1310 }
1297 return value; 1311 return value;
1298 } 1312 }
1299 1313
1300 } // namespace blink 1314 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698