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

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

Issue 2380713004: [GeometryInterface] Add setMatrixValue(transfromList) function. (Closed)
Patch Set: [GeometryInterface] Add setMatrixValue(transfromList) function. Created 4 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return TransformOperation::Matrix3D; 95 return TransformOperation::Matrix3D;
96 case CSSValuePerspective: 96 case CSSValuePerspective:
97 return TransformOperation::Perspective; 97 return TransformOperation::Perspective;
98 default: 98 default:
99 ASSERT_NOT_REACHED(); 99 ASSERT_NOT_REACHED();
100 // FIXME: We shouldn't have a type None since we never create them 100 // FIXME: We shouldn't have a type None since we never create them
101 return TransformOperation::None; 101 return TransformOperation::None;
102 } 102 }
103 } 103 }
104 104
105 bool TransformBuilder::hasRelativeLengths(const CSSValueList& inValueList) {
106 for (auto& value : inValueList) {
107 const CSSFunctionValue* transformValue = toCSSFunctionValue(value.get());
108
109 for (size_t i = 0; i < transformValue->length(); i++) {
Timothy Loh 2016/10/19 02:59:08 This can probably be a for ( : ) loop too.
Hwanseung Lee 2016/10/22 14:44:56 Done.
110 const CSSPrimitiveValue& primitiveValue =
111 toCSSPrimitiveValue(transformValue->item(i));
112
113 if (CSSPrimitiveValue::isRelativeUnit(
Timothy Loh 2016/10/19 02:59:08 I think this isn't sufficient and won't handle cas
Hwanseung Lee 2016/10/22 14:44:56 i add some code to prevent calc() function. i will
114 primitiveValue.typeWithCalcResolved())) {
115 return true;
116 }
117 }
118 }
119 return false;
120 }
121
105 void TransformBuilder::createTransformOperations( 122 void TransformBuilder::createTransformOperations(
106 const CSSValue& inValue, 123 const CSSValue& inValue,
107 const CSSToLengthConversionData& conversionData, 124 const CSSToLengthConversionData& conversionData,
108 TransformOperations& outOperations) { 125 TransformOperations& outOperations) {
109 ASSERT(!outOperations.size()); 126 ASSERT(!outOperations.size());
110 if (!inValue.isValueList()) { 127 if (!inValue.isValueList()) {
111 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone); 128 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
112 return; 129 return;
113 } 130 }
114 131
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 break; 317 break;
301 } 318 }
302 default: 319 default:
303 ASSERT_NOT_REACHED(); 320 ASSERT_NOT_REACHED();
304 break; 321 break;
305 } 322 }
306 } 323 }
307 } 324 }
308 325
309 } // namespace blink 326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698