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

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, 1 month 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& valueList) {
106 for (auto& value : valueList) {
107 const CSSFunctionValue* transformValue = toCSSFunctionValue(value.get());
108
109 for (Member<const blink::CSSValue> item : *transformValue) {
Timothy Loh 2016/10/24 04:18:30 I think you can write for (const CSSValue* item :
Hwanseung Lee 2016/10/24 13:23:37 Done.
Timothy Loh 2016/10/25 04:48:01 You don't need to write blink::, this is already i
Hwanseung Lee 2016/10/27 16:24:47 Done.
110 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*item);
111
112 // TODO(hs1217.lee) : to prevent relative unit like calc(10px + 1em).
113 // but when calc() not take parameter of ralative unit like calc(1px +1
114 // px),
115 // shoud be return false;
116 if (primitiveValue.isCalculated()) {
117 return true;
118 }
119
120 if (CSSPrimitiveValue::isRelativeUnit(
121 primitiveValue.typeWithCalcResolved())) {
122 return true;
123 }
124 }
125 }
126 return false;
127 }
128
105 void TransformBuilder::createTransformOperations( 129 void TransformBuilder::createTransformOperations(
106 const CSSValue& inValue, 130 const CSSValue& inValue,
107 const CSSToLengthConversionData& conversionData, 131 const CSSToLengthConversionData& conversionData,
108 TransformOperations& outOperations) { 132 TransformOperations& outOperations) {
109 ASSERT(!outOperations.size()); 133 ASSERT(!outOperations.size());
110 if (!inValue.isValueList()) { 134 if (!inValue.isValueList()) {
111 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone); 135 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
112 return; 136 return;
113 } 137 }
114 138
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 break; 324 break;
301 } 325 }
302 default: 326 default:
303 ASSERT_NOT_REACHED(); 327 ASSERT_NOT_REACHED();
304 break; 328 break;
305 } 329 }
306 } 330 }
307 } 331 }
308 332
309 } // namespace blink 333 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698