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

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

Issue 1640293004: Support arbitrary length units for the z component of CSS property "translate" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review change Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/transforms/translate-expected.html ('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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 PassRefPtr<TranslateTransformOperation> StyleBuilderConverter::convertTranslate( StyleResolverState& state, const CSSValue& value) 904 PassRefPtr<TranslateTransformOperation> StyleBuilderConverter::convertTranslate( StyleResolverState& state, const CSSValue& value)
905 { 905 {
906 const CSSValueList& list = toCSSValueList(value); 906 const CSSValueList& list = toCSSValueList(value);
907 ASSERT(list.length() <= 3); 907 ASSERT(list.length() <= 3);
908 Length tx = convertLength(state, *list.item(0)); 908 Length tx = convertLength(state, *list.item(0));
909 Length ty(0, Fixed); 909 Length ty(0, Fixed);
910 double tz = 0; 910 double tz = 0;
911 if (list.length() >= 2) 911 if (list.length() >= 2)
912 ty = convertLength(state, *list.item(1)); 912 ty = convertLength(state, *list.item(1));
913 if (list.length() == 3) 913 if (list.length() == 3)
914 tz = toCSSPrimitiveValue(list.item(2))->getDoubleValue(); 914 tz = toCSSPrimitiveValue(list.item(2))->computeLength<double>(state.cssT oLengthConversionData());
915 915
916 return TranslateTransformOperation::create(tx, ty, tz, TransformOperation::T ranslate3D); 916 return TranslateTransformOperation::create(tx, ty, tz, TransformOperation::T ranslate3D);
917 } 917 }
918 918
919 PassRefPtr<RotateTransformOperation> StyleBuilderConverter::convertRotate(StyleR esolverState& state, const CSSValue& value) 919 PassRefPtr<RotateTransformOperation> StyleBuilderConverter::convertRotate(StyleR esolverState& state, const CSSValue& value)
920 { 920 {
921 const CSSValueList& list = toCSSValueList(value); 921 const CSSValueList& list = toCSSValueList(value);
922 ASSERT(list.length() == 1 || list.length() == 4); 922 ASSERT(list.length() == 1 || list.length() == 4);
923 double angle = toCSSPrimitiveValue(list.item(0))->computeDegrees(); 923 double angle = toCSSPrimitiveValue(list.item(0))->computeDegrees();
924 double x = 0; 924 double x = 0;
(...skipping 28 matching lines...) Expand all
953 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); 953 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
954 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation; 954 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation;
955 } 955 }
956 956
957 PassRefPtr<StylePath> StyleBuilderConverter::convertPath(StyleResolverState&, CS SValue& value) 957 PassRefPtr<StylePath> StyleBuilderConverter::convertPath(StyleResolverState&, CS SValue& value)
958 { 958 {
959 return toCSSPathValue(value).cachedPath(); 959 return toCSSPathValue(value).cachedPath();
960 } 960 }
961 961
962 } // namespace blink 962 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/transforms/translate-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698