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

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

Issue 2380713004: [GeometryInterface] Add setMatrixValue(transfromList) function. (Closed)
Patch Set: rebase & check relative length unit. 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::checkHavingRelativeLengthUnit(const CSSValue& inValue) {
meade_UTC10 2016/10/17 03:22:28 Perhaps this should take a CSSValueList? Then you
meade_UTC10 2016/10/17 03:22:28 In other places we've used "hasRelativeLengths". P
Hwanseung Lee 2016/10/18 16:37:52 Done.
Hwanseung Lee 2016/10/18 16:37:52 Done.
106 if (!inValue.isValueList()) {
107 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
meade_UTC10 2016/10/17 03:22:28 I don't understand what this DCHECK is for... Do y
Hwanseung Lee 2016/10/18 16:37:52 i did remove this it when change to CSSVauleList.
Hwanseung Lee 2016/10/18 16:37:52 i did remove this code because parameter was chang
108 return false;
109 }
110
111 for (auto& value : toCSSValueList(inValue)) {
112 const CSSFunctionValue* transformValue = toCSSFunctionValue(value.get());
113
114 for (size_t i = 0; i < transformValue->length(); i++) {
115 const CSSPrimitiveValue& primitiveValue =
116 toCSSPrimitiveValue(transformValue->item(i));
117
118 if (CSSPrimitiveValue::isRelativeUnit(
119 primitiveValue.typeWithCalcResolved())) {
120 return true;
121 }
122 }
123 }
124 return false;
125 }
126
105 void TransformBuilder::createTransformOperations( 127 void TransformBuilder::createTransformOperations(
106 const CSSValue& inValue, 128 const CSSValue& inValue,
107 const CSSToLengthConversionData& conversionData, 129 const CSSToLengthConversionData& conversionData,
108 TransformOperations& outOperations) { 130 TransformOperations& outOperations) {
109 ASSERT(!outOperations.size()); 131 ASSERT(!outOperations.size());
110 if (!inValue.isValueList()) { 132 if (!inValue.isValueList()) {
111 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone); 133 DCHECK_EQ(toCSSIdentifierValue(inValue).getValueID(), CSSValueNone);
112 return; 134 return;
113 } 135 }
114 136
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 break; 322 break;
301 } 323 }
302 default: 324 default:
303 ASSERT_NOT_REACHED(); 325 ASSERT_NOT_REACHED();
304 break; 326 break;
305 } 327 }
306 } 328 }
307 } 329 }
308 330
309 } // namespace blink 331 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698