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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/StyleCalcLength.cpp

Issue 1604133003: Add missing variable initialization in StyleCalcLength::toCSSValue(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/cssom/StyleCalcLength.h" 5 #include "core/css/cssom/StyleCalcLength.h"
6 6
7 #include "core/css/CSSCalculationValue.h" 7 #include "core/css/CSSCalculationValue.h"
8 #include "core/css/CSSPrimitiveValue.h" 8 #include "core/css/CSSPrimitiveValue.h"
9 #include "core/css/cssom/CalcDictionary.h" 9 #include "core/css/cssom/CalcDictionary.h"
10 #include "core/css/cssom/SimpleLength.h" 10 #include "core/css/cssom/SimpleLength.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (has(lengthUnit)) { 120 if (has(lengthUnit)) {
121 result->set(m_values[i] / x, lengthUnit); 121 result->set(m_values[i] / x, lengthUnit);
122 } 122 }
123 } 123 }
124 return result; 124 return result;
125 } 125 }
126 126
127 PassRefPtrWillBeRawPtr<CSSValue> StyleCalcLength::toCSSValue() const 127 PassRefPtrWillBeRawPtr<CSSValue> StyleCalcLength::toCSSValue() const
128 { 128 {
129 // Create a CSS Calc Value, then put it into a CSSPrimitiveValue 129 // Create a CSS Calc Value, then put it into a CSSPrimitiveValue
130 RefPtrWillBeRawPtr<CSSCalcExpressionNode> node; 130 RefPtrWillBeRawPtr<CSSCalcExpressionNode> node = nullptr;
131 for (unsigned i = 0; i < LengthUnit::Count; ++i) { 131 for (unsigned i = 0; i < LengthUnit::Count; ++i) {
132 LengthUnit lengthUnit = static_cast<LengthUnit>(i); 132 LengthUnit lengthUnit = static_cast<LengthUnit>(i);
133 if (!has(lengthUnit)) 133 if (!has(lengthUnit))
134 continue; 134 continue;
135 double value = get(lengthUnit); 135 double value = get(lengthUnit);
136 CSSPrimitiveValue::UnitType primitiveUnit = lengthTypeToPrimitiveType(le ngthUnit); 136 CSSPrimitiveValue::UnitType primitiveUnit = lengthTypeToPrimitiveType(le ngthUnit);
137 if (node) { 137 if (node) {
138 node = CSSCalcValue::createExpressionNode( 138 node = CSSCalcValue::createExpressionNode(
139 node, 139 node,
140 CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(std ::abs(value), primitiveUnit)), 140 CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(std ::abs(value), primitiveUnit)),
141 value >= 0 ? CalcAdd : CalcSubtract); 141 value >= 0 ? CalcAdd : CalcSubtract);
142 } else { 142 } else {
143 node = CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create( value, primitiveUnit)); 143 node = CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create( value, primitiveUnit));
144 } 144 }
145 } 145 }
146 return CSSPrimitiveValue::create(CSSCalcValue::create(node)); 146 return CSSPrimitiveValue::create(CSSCalcValue::create(node));
147 } 147 }
148 148
149 } // namespace blink 149 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698