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

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

Issue 1373753002: Change CSSToStyleMap functions to take const CSSValue&s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fix for mask Created 5 years, 2 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
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (value->isPrimitiveValue()) { 70 if (value->isPrimitiveValue()) {
71 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone); 71 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
72 return ComputedStyle::initialBoxReflect(); 72 return ComputedStyle::initialBoxReflect();
73 } 73 }
74 74
75 CSSReflectValue* reflectValue = toCSSReflectValue(value); 75 CSSReflectValue* reflectValue = toCSSReflectValue(value);
76 RefPtr<StyleReflection> reflection = StyleReflection::create(); 76 RefPtr<StyleReflection> reflection = StyleReflection::create();
77 reflection->setDirection(*reflectValue->direction()); 77 reflection->setDirection(*reflectValue->direction());
78 if (reflectValue->offset()) 78 if (reflectValue->offset())
79 reflection->setOffset(reflectValue->offset()->convertToLength(state.cssT oLengthConversionData())); 79 reflection->setOffset(reflectValue->offset()->convertToLength(state.cssT oLengthConversionData()));
80 NinePieceImage mask; 80 if (reflectValue->mask()) {
81 mask.setMaskDefaults(); 81 NinePieceImage mask;
82 CSSToStyleMap::mapNinePieceImage(state, CSSPropertyWebkitBoxReflect, reflect Value->mask(), mask); 82 mask.setMaskDefaults();
83 reflection->setMask(mask); 83 CSSToStyleMap::mapNinePieceImage(state, CSSPropertyWebkitBoxReflect, *re flectValue->mask(), mask);
84 reflection->setMask(mask);
85 }
84 86
85 return reflection.release(); 87 return reflection.release();
86 } 88 }
87 89
88 Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* v alue, bool forVisitedLink) 90 Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* v alue, bool forVisitedLink)
89 { 91 {
90 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 92 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
91 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa lue, state.style()->color(), forVisitedLink); 93 return state.document().textLinkColors().colorFromPrimitiveValue(primitiveVa lue, state.style()->color(), forVisitedLink);
92 } 94 }
93 95
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); 970 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D);
969 } 971 }
970 972
971 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, CSSValue* value) 973 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, CSSValue* value)
972 { 974 {
973 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 975 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
974 return primitiveValue->getValueID() == CSSValueFromImage ? RespectImageOrien tation : DoNotRespectImageOrientation; 976 return primitiveValue->getValueID() == CSSValueFromImage ? RespectImageOrien tation : DoNotRespectImageOrientation;
975 } 977 }
976 978
977 } // namespace blink 979 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698