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

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

Issue 1219153003: Unify handling of <color> for SVG/non-SVG properties (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | no next file » | 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 * 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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 } 864 }
865 865
866 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C SSValue* value, bool forVisitedLink) 866 StyleColor StyleBuilderConverter::convertStyleColor(StyleResolverState& state, C SSValue* value, bool forVisitedLink)
867 { 867 {
868 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 868 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
869 if (primitiveValue->getValueID() == CSSValueCurrentcolor) 869 if (primitiveValue->getValueID() == CSSValueCurrentcolor)
870 return StyleColor::currentColor(); 870 return StyleColor::currentColor();
871 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa lue, Color(), forVisitedLink); 871 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa lue, Color(), forVisitedLink);
872 } 872 }
873 873
874 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue * value)
875 {
876 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
877 if (primitiveValue->isRGBColor())
878 return primitiveValue->getRGBA32Value();
879 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor);
880 return state.style()->color();
881 }
882
883 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value) 874 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value)
884 { 875 {
885 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 876 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
886 if (primitiveValue->getValueID()) { 877 if (primitiveValue->getValueID()) {
887 float multiplier = convertLineWidth<float>(state, value); 878 float multiplier = convertLineWidth<float>(state, value);
888 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData()); 879 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData());
889 } 880 }
890 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); 881 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( ));
891 } 882 }
892 883
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 double sz = 1; 972 double sz = 1;
982 if (list.length() >= 2) 973 if (list.length() >= 2)
983 sy = toCSSPrimitiveValue(list.item(1))->getDoubleValue(); 974 sy = toCSSPrimitiveValue(list.item(1))->getDoubleValue();
984 if (list.length() == 3) 975 if (list.length() == 3)
985 sz = toCSSPrimitiveValue(list.item(2))->getDoubleValue(); 976 sz = toCSSPrimitiveValue(list.item(2))->getDoubleValue();
986 977
987 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); 978 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D);
988 } 979 }
989 980
990 } // namespace blink 981 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698