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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 71253002: Eliminate "FractionConversion" from CSSPrimitiveValue::convertToLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4427 break; 4427 break;
4428 } 4428 }
4429 } 4429 }
4430 4430
4431 enum LengthConversion { 4431 enum LengthConversion {
4432 AnyConversion = ~0, 4432 AnyConversion = ~0,
4433 FixedIntegerConversion = 1 << 0, 4433 FixedIntegerConversion = 1 << 0,
4434 FixedFloatConversion = 1 << 1, 4434 FixedFloatConversion = 1 << 1,
4435 AutoConversion = 1 << 2, 4435 AutoConversion = 1 << 2,
4436 PercentConversion = 1 << 3, 4436 PercentConversion = 1 << 3,
4437 FractionConversion = 1 << 4,
4438 }; 4437 };
4439 4438
4440 template<int supported> Length CSSPrimitiveValue::convertToLength(const RenderSt yle* style, const RenderStyle* rootStyle, double multiplier, bool computingFontS ize) 4439 template<int supported> Length CSSPrimitiveValue::convertToLength(const RenderSt yle* style, const RenderStyle* rootStyle, double multiplier, bool computingFontS ize)
4441 { 4440 {
4442 ASSERT(!hasVariableReference()); 4441 ASSERT(!hasVariableReference());
4443 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && isFontR elativeLength() && (!style || !rootStyle)) 4442 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && isFontR elativeLength() && (!style || !rootStyle))
4444 return Length(Undefined); 4443 return Length(Undefined);
4445 if ((supported & FixedIntegerConversion) && isLength()) 4444 if ((supported & FixedIntegerConversion) && isLength())
4446 return computeLength<Length>(style, rootStyle, multiplier, computingFont Size); 4445 return computeLength<Length>(style, rootStyle, multiplier, computingFont Size);
4447 if ((supported & FixedFloatConversion) && isLength()) 4446 if ((supported & FixedFloatConversion) && isLength())
4448 return Length(computeLength<double>(style, rootStyle, multiplier), Fixed ); 4447 return Length(computeLength<double>(style, rootStyle, multiplier), Fixed );
4449 if ((supported & PercentConversion) && isPercentage()) 4448 if ((supported & PercentConversion) && isPercentage())
4450 return Length(getDoubleValue(), Percent); 4449 return Length(getDoubleValue(), Percent);
4451 if ((supported & FractionConversion) && isNumber())
4452 return Length(getDoubleValue() * 100.0, Percent);
4453 if ((supported & AutoConversion) && getValueID() == CSSValueAuto) 4450 if ((supported & AutoConversion) && getValueID() == CSSValueAuto)
4454 return Length(Auto); 4451 return Length(Auto);
4455 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && (suppor ted & PercentConversion) && isCalculated()) 4452 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && (suppor ted & PercentConversion) && isCalculated())
4456 return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier)) ; 4453 return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier)) ;
4457 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && isViewp ortPercentageLength()) 4454 if ((supported & (FixedIntegerConversion | FixedFloatConversion)) && isViewp ortPercentageLength())
4458 return viewportPercentageLength(); 4455 return viewportPercentageLength();
4459 return Length(Undefined); 4456 return Length(Undefined);
4460 } 4457 }
4461 4458
4462 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBufferedRendering e) 4459 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBufferedRendering e)
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4953 break; 4950 break;
4954 } 4951 }
4955 4952
4956 ASSERT_NOT_REACHED(); 4953 ASSERT_NOT_REACHED();
4957 return TouchActionDelayNone; 4954 return TouchActionDelayNone;
4958 } 4955 }
4959 4956
4960 } 4957 }
4961 4958
4962 #endif 4959 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698