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

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

Issue 2736043002: Re-land Catch up the spec update in CSS Rhythmic Sizing (Closed)
Patch Set: Fix core/BUILD.gn Created 3 years, 9 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 294
295 template <> 295 template <>
296 unsigned short CSSPrimitiveValue::computeLength( 296 unsigned short CSSPrimitiveValue::computeLength(
297 const CSSToLengthConversionData& conversionData) const { 297 const CSSToLengthConversionData& conversionData) const {
298 return roundForImpreciseConversion<unsigned short>( 298 return roundForImpreciseConversion<unsigned short>(
299 computeLengthDouble(conversionData)); 299 computeLengthDouble(conversionData));
300 } 300 }
301 301
302 template <> 302 template <>
303 uint8_t CSSPrimitiveValue::computeLength(
304 const CSSToLengthConversionData& conversionData) const {
305 return roundForImpreciseConversion<uint8_t>(
306 computeLengthDouble(conversionData));
307 }
308
309 template <>
303 float CSSPrimitiveValue::computeLength( 310 float CSSPrimitiveValue::computeLength(
304 const CSSToLengthConversionData& conversionData) const { 311 const CSSToLengthConversionData& conversionData) const {
305 return clampTo<float>(computeLengthDouble(conversionData)); 312 return clampTo<float>(computeLengthDouble(conversionData));
306 } 313 }
307 314
308 template <> 315 template <>
309 double CSSPrimitiveValue::computeLength( 316 double CSSPrimitiveValue::computeLength(
310 const CSSToLengthConversionData& conversionData) const { 317 const CSSToLengthConversionData& conversionData) const {
311 return computeLengthDouble(conversionData); 318 return computeLengthDouble(conversionData);
312 } 319 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 case UnitType::Calc: 713 case UnitType::Calc:
707 visitor->trace(m_value.calc); 714 visitor->trace(m_value.calc);
708 break; 715 break;
709 default: 716 default:
710 break; 717 break;
711 } 718 }
712 CSSValue::traceAfterDispatch(visitor); 719 CSSValue::traceAfterDispatch(visitor);
713 } 720 }
714 721
715 } // namespace blink 722 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698