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

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 (const CSSValue* item : *transformValue) {
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 TransformOperations TransformBuilder::createTransformOperations( 129 TransformOperations TransformBuilder::createTransformOperations(
106 const CSSValue& inValue, 130 const CSSValue& inValue,
107 const CSSToLengthConversionData& conversionData) { 131 const CSSToLengthConversionData& conversionData) {
108 TransformOperations operations; 132 TransformOperations operations;
109 if (!inValue.isValueList()) { 133 if (!inValue.isValueList()) {
110 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone); 134 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
111 return operations; 135 return operations;
112 } 136 }
113 137
114 float zoomFactor = conversionData.zoom(); 138 float zoomFactor = conversionData.zoom();
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 324 }
301 default: 325 default:
302 ASSERT_NOT_REACHED(); 326 ASSERT_NOT_REACHED();
303 break; 327 break;
304 } 328 }
305 } 329 }
306 return operations; 330 return operations;
307 } 331 }
308 332
309 } // namespace blink 333 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/TransformBuilder.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698