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

Side by Side Diff: Source/core/css/parser/SizesCalcParserTest.cpp

Issue 273843003: [Oilpan]: Make StylePropertySet fully garbage collected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review feedback Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/css/resolver/MatchResult.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/css/parser/SizesCalcParser.h" 6 #include "core/css/parser/SizesCalcParser.h"
7 7
8 #include "core/css/CSSPrimitiveValue.h" 8 #include "core/css/CSSPrimitiveValue.h"
9 #include "core/css/MediaValuesCached.h" 9 #include "core/css/MediaValuesCached.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 14 matching lines...) Expand all
25 { 25 {
26 lengthArray.resize(CSSPrimitiveValue::LengthUnitTypeCount); 26 lengthArray.resize(CSSPrimitiveValue::LengthUnitTypeCount);
27 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i) 27 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i)
28 lengthArray.at(i) = 0; 28 lengthArray.at(i) = 0;
29 } 29 }
30 30
31 static void verifyCSSCalc(String text, double value, bool valid, unsigned fontSi ze, unsigned viewportWidth, unsigned viewportHeight) 31 static void verifyCSSCalc(String text, double value, bool valid, unsigned fontSi ze, unsigned viewportWidth, unsigned viewportHeight)
32 { 32 {
33 CSSLengthArray lengthArray; 33 CSSLengthArray lengthArray;
34 initLengthArray(lengthArray); 34 initLengthArray(lengthArray);
35 RefPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::creat e(); 35 RefPtrWillBeRawPtr<MutableStylePropertySet> propertySet = MutableStyleProper tySet::create();
36 propertySet->setProperty(CSSPropertyLeft, text); 36 propertySet->setProperty(CSSPropertyLeft, text);
37 RefPtrWillBeRawPtr<CSSValue> cssValue = propertySet->getPropertyCSSValue(CSS PropertyLeft); 37 RefPtrWillBeRawPtr<CSSValue> cssValue = propertySet->getPropertyCSSValue(CSS PropertyLeft);
38 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue.get()); 38 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue.get());
39 if (primitiveValue) 39 if (primitiveValue)
40 primitiveValue->accumulateLengthArray(lengthArray); 40 primitiveValue->accumulateLengthArray(lengthArray);
41 else 41 else
42 ASSERT_EQ(valid, false); 42 ASSERT_EQ(valid, false);
43 int length = lengthArray.at(CSSPrimitiveValue::UnitTypePixels); 43 int length = lengthArray.at(CSSPrimitiveValue::UnitTypePixels);
44 length += lengthArray.at(CSSPrimitiveValue::UnitTypeFontSize) * fontSize; 44 length += lengthArray.at(CSSPrimitiveValue::UnitTypeFontSize) * fontSize;
45 length += lengthArray.at(CSSPrimitiveValue::UnitTypeViewportWidth) * viewpor tWidth / 100.0; 45 length += lengthArray.at(CSSPrimitiveValue::UnitTypeViewportWidth) * viewpor tWidth / 100.0;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 for (unsigned i = 0; testCases[i].input; ++i) { 129 for (unsigned i = 0; testCases[i].input; ++i) {
130 if (testCases[i].dontRunInCSSCalc) 130 if (testCases[i].dontRunInCSSCalc)
131 continue; 131 continue;
132 verifyCSSCalc(testCases[i].input, testCases[i].output, testCases[i].vali d, data.defaultFontSize, data.viewportWidth, data.viewportHeight); 132 verifyCSSCalc(testCases[i].input, testCases[i].output, testCases[i].vali d, data.defaultFontSize, data.viewportWidth, data.viewportHeight);
133 } 133 }
134 } 134 }
135 135
136 } // namespace 136 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/css/resolver/MatchResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698